renamed "mixer::framesPerAudioBuffer()" to "mixer::framesPerPeriod()" and type "fpab_t" to "fpp_t"

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@502 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2007-08-04 01:15:33 +00:00
parent d4501ac57b
commit 1647da26fd
67 changed files with 215 additions and 211 deletions

View File

@@ -213,13 +213,13 @@ void audioALSA::stopProcessing( void )
void audioALSA::run( void )
{
surroundSampleFrame * temp =
new surroundSampleFrame[getMixer()->framesPerAudioBuffer()];
new surroundSampleFrame[getMixer()->framesPerPeriod()];
int_sample_t * outbuf =
new int_sample_t[getMixer()->framesPerAudioBuffer() *
new int_sample_t[getMixer()->framesPerPeriod() *
channels()];
int_sample_t * pcmbuf = new int_sample_t[m_periodSize * channels()];
int outbuf_size = getMixer()->framesPerAudioBuffer() * channels();
int outbuf_size = getMixer()->framesPerPeriod() * channels();
int outbuf_pos = 0;
int pcmbuf_size = m_periodSize * channels();
@@ -233,7 +233,7 @@ void audioALSA::run( void )
if( outbuf_pos == 0 )
{
// frames depend on the sample rate
const fpab_t frames = getNextBuffer( temp );
const fpp_t frames = getNextBuffer( temp );
if( !frames )
{
quit = TRUE;
@@ -371,7 +371,7 @@ int audioALSA::setHWParams( const sample_rate_t _sample_rate,
}
}
m_periodSize = getMixer()->framesPerAudioBuffer();
m_periodSize = getMixer()->framesPerPeriod();
m_bufferSize = m_periodSize * 8;
dir = 0;
err = snd_pcm_hw_params_set_period_size_near( m_handle, m_hwParams,

View File

@@ -42,7 +42,7 @@ audioDevice::audioDevice( const sample_rate_t _sample_rate,
m_sampleRate( _sample_rate ),
m_channels( _channels ),
m_mixer( _mixer ),
m_buffer( new surroundSampleFrame[getMixer()->framesPerAudioBuffer()] )
m_buffer( new surroundSampleFrame[getMixer()->framesPerPeriod()] )
{
int error;
if( ( m_srcState = src_new(
@@ -81,7 +81,7 @@ audioDevice::~audioDevice()
void audioDevice::processNextBuffer( void )
{
const fpab_t frames = getNextBuffer( m_buffer );
const fpp_t frames = getNextBuffer( m_buffer );
if( frames )
{
writeBuffer( m_buffer, frames, getMixer()->masterGain() );
@@ -95,9 +95,9 @@ void audioDevice::processNextBuffer( void )
fpab_t audioDevice::getNextBuffer( surroundSampleFrame * _ab )
fpp_t audioDevice::getNextBuffer( surroundSampleFrame * _ab )
{
fpab_t frames = getMixer()->framesPerAudioBuffer();
fpp_t frames = getMixer()->framesPerPeriod();
const surroundSampleFrame * b = getMixer()->nextBuffer();
if( !b )
{
@@ -163,7 +163,7 @@ void audioDevice::renamePort( audioPort * )
void FASTCALL audioDevice::resample( const surroundSampleFrame * _src,
const fpab_t _frames,
const fpp_t _frames,
surroundSampleFrame * _dst,
const sample_rate_t _src_sr,
const sample_rate_t _dst_sr )
@@ -190,7 +190,7 @@ void FASTCALL audioDevice::resample( const surroundSampleFrame * _src,
Uint32 FASTCALL audioDevice::convertToS16( const surroundSampleFrame * _ab,
const fpab_t _frames,
const fpp_t _frames,
const float _master_gain,
int_sample_t * _output_buffer,
const bool _convert_endian )
@@ -198,7 +198,7 @@ Uint32 FASTCALL audioDevice::convertToS16( const surroundSampleFrame * _ab,
if( _convert_endian )
{
Uint16 temp;
for( fpab_t frame = 0; frame < _frames; ++frame )
for( fpp_t frame = 0; frame < _frames; ++frame )
{
for( ch_cnt_t chnl = 0; chnl < channels(); ++chnl )
{
@@ -215,7 +215,7 @@ Uint32 FASTCALL audioDevice::convertToS16( const surroundSampleFrame * _ab,
}
else
{
for( fpab_t frame = 0; frame < _frames; ++frame )
for( fpp_t frame = 0; frame < _frames; ++frame )
{
for( ch_cnt_t chnl = 0; chnl < channels(); ++chnl )
{
@@ -235,7 +235,7 @@ Uint32 FASTCALL audioDevice::convertToS16( const surroundSampleFrame * _ab,
void FASTCALL audioDevice::clearS16Buffer( int_sample_t * _outbuf,
const fpab_t _frames )
const fpp_t _frames )
{
#ifdef LMMS_DEBUG
assert( _outbuf != NULL );

View File

@@ -179,7 +179,7 @@ bool audioFileOgg::startEncoding( void )
void FASTCALL audioFileOgg::writeBuffer( const surroundSampleFrame * _ab,
const fpab_t _frames,
const fpp_t _frames,
const float _master_gain )
{
int eos = 0;
@@ -187,7 +187,7 @@ void FASTCALL audioFileOgg::writeBuffer( const surroundSampleFrame * _ab,
float * * buffer = vorbis_analysis_buffer( &m_vd, _frames *
BYTES_PER_SAMPLE *
channels() );
for( fpab_t frame = 0; frame < _frames; ++frame )
for( fpp_t frame = 0; frame < _frames; ++frame )
{
for( ch_cnt_t chnl = 0; chnl < channels(); ++chnl )
{

View File

@@ -92,7 +92,7 @@ bool audioFileWave::startEncoding( void )
void FASTCALL audioFileWave::writeBuffer( const surroundSampleFrame * _ab,
const fpab_t _frames,
const fpp_t _frames,
const float _master_gain )
{
int_sample_t * outbuf = new int_sample_t[_frames * channels()];

View File

@@ -67,7 +67,7 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful,
m_client( NULL ),
m_active( FALSE ),
m_stop_semaphore( 1 ),
m_outBuf( new surroundSampleFrame[getMixer()->framesPerAudioBuffer()] ),
m_outBuf( new surroundSampleFrame[getMixer()->framesPerPeriod()] ),
m_framesDoneInCurBuf( 0 ),
m_framesToDoInCurBuf( 0 )
{
@@ -232,7 +232,7 @@ void audioJACK::startProcessing( void )
// try to sync JACK's and LMMS's buffer-size
jack_set_buffer_size( m_client, getMixer()->framesPerAudioBuffer() );
jack_set_buffer_size( m_client, getMixer()->framesPerPeriod() );
@@ -369,7 +369,7 @@ int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata )
}
/* const Uint32 frames = tMin<Uint32>( _nframes,
getMixer()->framesPerAudioBuffer() );
getMixer()->framesPerPeriod() );
for( jackPortMap::iterator it = _this->m_portMap.begin();
it != _this->m_portMap.end(); ++it )
{

View File

@@ -127,7 +127,7 @@ audioOSS::audioOSS( const sample_rate_t _sample_rate, bool & _success_ful,
int frag_spec;
for( frag_spec = 0; static_cast<int>( 0x01 << frag_spec ) <
getMixer()->framesPerAudioBuffer() * channels() *
getMixer()->framesPerPeriod() * channels() *
BYTES_PER_INT_SAMPLE;
++frag_spec )
{
@@ -316,14 +316,14 @@ void audioOSS::stopProcessing( void )
void audioOSS::run( void )
{
surroundSampleFrame * temp =
new surroundSampleFrame[getMixer()->framesPerAudioBuffer()];
new surroundSampleFrame[getMixer()->framesPerPeriod()];
int_sample_t * outbuf =
new int_sample_t[getMixer()->framesPerAudioBuffer() *
new int_sample_t[getMixer()->framesPerPeriod() *
channels()];
while( TRUE )
{
const fpab_t frames = getNextBuffer( temp );
const fpp_t frames = getNextBuffer( temp );
if( !frames )
{
break;

View File

@@ -36,19 +36,19 @@
audioPort::audioPort( const QString & _name ) :
m_bufferUsage( NONE ),
m_firstBuffer( new surroundSampleFrame[
engine::getMixer()->framesPerAudioBuffer()] ),
engine::getMixer()->framesPerPeriod()] ),
m_secondBuffer( new surroundSampleFrame[
engine::getMixer()->framesPerAudioBuffer()] ),
engine::getMixer()->framesPerPeriod()] ),
m_extOutputEnabled( FALSE ),
m_nextFxChannel( -1 ),
m_name( "unnamed port" ),
m_effects( new effectChain ),
m_frames( engine::getMixer()->framesPerAudioBuffer() )
m_frames( engine::getMixer()->framesPerPeriod() )
{
engine::getMixer()->clearAudioBuffer( m_firstBuffer,
engine::getMixer()->framesPerAudioBuffer() );
engine::getMixer()->framesPerPeriod() );
engine::getMixer()->clearAudioBuffer( m_secondBuffer,
engine::getMixer()->framesPerAudioBuffer() );
engine::getMixer()->framesPerPeriod() );
engine::getMixer()->addAudioPort( this );
setExtOutputEnabled( TRUE );
}
@@ -71,7 +71,7 @@ audioPort::~audioPort()
void audioPort::nextPeriod( void )
{
engine::getMixer()->clearAudioBuffer( m_firstBuffer,
engine::getMixer()->framesPerAudioBuffer() );
engine::getMixer()->framesPerPeriod() );
qSwap( m_firstBuffer, m_secondBuffer );
// this is how we decrease state of buffer-usage ;-)
m_bufferUsage = ( m_bufferUsage != NONE ) ?

View File

@@ -102,10 +102,10 @@ void audioSampleRecorder::createSampleBuffer( sampleBuffer * * _sample_buf )
void audioSampleRecorder::writeBuffer( const surroundSampleFrame * _ab,
const fpab_t _frames, const float )
const fpp_t _frames, const float )
{
sampleFrame * buf = new sampleFrame[_frames];
for( fpab_t frame = 0; frame < _frames; ++frame )
for( fpp_t frame = 0; frame < _frames; ++frame )
{
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
{

View File

@@ -54,14 +54,14 @@
audioSDL::audioSDL( const sample_rate_t _sample_rate, bool & _success_ful,
mixer * _mixer ) :
audioDevice( _sample_rate, DEFAULT_CHANNELS, _mixer ),
m_outBuf( new surroundSampleFrame[getMixer()->framesPerAudioBuffer()] ),
m_outBuf( new surroundSampleFrame[getMixer()->framesPerPeriod()] ),
m_convertedBuf_pos( 0 ),
m_convertEndian( FALSE ),
m_stop_semaphore( 1 )
{
_success_ful = FALSE;
m_convertedBuf_size = getMixer()->framesPerAudioBuffer() * channels()
m_convertedBuf_size = getMixer()->framesPerPeriod() * channels()
* sizeof( int_sample_t );
m_convertedBuf = new Uint8[m_convertedBuf_size];
@@ -90,7 +90,7 @@ audioSDL::audioSDL( const sample_rate_t _sample_rate, bool & _success_ful,
// of system, so we don't have
// to convert the buffers
m_audioHandle.channels = channels();
m_audioHandle.samples = getMixer()->framesPerAudioBuffer();
m_audioHandle.samples = getMixer()->framesPerPeriod();
m_audioHandle.callback = sdlAudioCallback;
m_audioHandle.userdata = this;
@@ -190,7 +190,7 @@ void audioSDL::sdlAudioCallback( Uint8 * _buf, int _len )
if( m_convertedBuf_pos == 0 )
{
// frames depend on the sample rate
const fpab_t frames = getNextBuffer( m_outBuf );
const fpp_t frames = getNextBuffer( m_outBuf );
if( !frames )
{
m_stopped = TRUE;

View File

@@ -468,7 +468,7 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n )
// create sub-note-play-handle, only note is
// different
new notePlayHandle( _n->getInstrumentTrack(),
_n->framesAhead(),
_n->offset(),
_n->frames(), note_copy,
_n );
}
@@ -524,13 +524,13 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n )
// used for loop
f_cnt_t frames_processed = 0;
while( frames_processed < engine::getMixer()->framesPerAudioBuffer() )
while( frames_processed < engine::getMixer()->framesPerPeriod() )
{
const f_cnt_t remaining_frames_for_cur_arp = arp_frames -
( cur_frame % arp_frames );
// does current arp-note fill whole audio-buffer?
if( remaining_frames_for_cur_arp >
engine::getMixer()->framesPerAudioBuffer() )
engine::getMixer()->framesPerPeriod() )
{
// then we don't have to do something!
break;
@@ -622,8 +622,8 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n )
// and is_arp_note=TRUE
new notePlayHandle( _n->getInstrumentTrack(),
( ( m_arpModeComboBox->value() != FREE ) ?
cnphv.first()->framesAhead() :
_n->framesAhead() ) +
cnphv.first()->offset() :
_n->offset() ) +
frames_processed,
gated_frames,
new_note,

View File

@@ -227,8 +227,8 @@ tact bbEditor::lengthOfBB( csize _bb )
bool FASTCALL bbEditor::play( midiTime _start, fpab_t _frames,
f_cnt_t _frame_base,
bool FASTCALL bbEditor::play( midiTime _start, fpp_t _frames,
f_cnt_t _offset,
Sint16 _tco_num )
{
bool played_a_note = FALSE;
@@ -242,7 +242,7 @@ bool FASTCALL bbEditor::play( midiTime _start, fpab_t _frames,
trackVector tv = tracks();
for( trackVector::iterator it = tv.begin(); it != tv.end(); ++it )
{
if( ( *it )->play( _start, _frames, _frame_base,
if( ( *it )->play( _start, _frames, _offset,
_tco_num ) == TRUE )
{
played_a_note = TRUE;

View File

@@ -67,7 +67,7 @@ effect::~effect()
bool FASTCALL effect::processAudioBuffer( surroundSampleFrame * _buf,
const fpab_t _frames )
const fpp_t _frames )
{
return( FALSE );
}
@@ -78,7 +78,7 @@ bool FASTCALL effect::processAudioBuffer( surroundSampleFrame * _buf,
void FASTCALL effect::setGate( float _level )
{
m_gate = _level * _level * m_processors *
engine::getMixer()->framesPerAudioBuffer();
engine::getMixer()->framesPerPeriod();
}

View File

@@ -117,7 +117,7 @@ void FASTCALL effectChain::moveUp( effect * _effect )
bool FASTCALL effectChain::processAudioBuffer( surroundSampleFrame * _buf,
const fpab_t _frames )
const fpp_t _frames )
{
if( m_bypassed )
{

View File

@@ -481,7 +481,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
SLOT( updateSampleVars() ) );
m_lfoShapeData =
new sample_t[engine::getMixer()->framesPerAudioBuffer()];
new sample_t[engine::getMixer()->framesPerPeriod()];
updateSampleVars();
}
@@ -504,7 +504,7 @@ envelopeAndLFOWidget::~envelopeAndLFOWidget()
inline sample_t envelopeAndLFOWidget::lfoShapeSample( fpab_t _frame_offset )
inline sample_t envelopeAndLFOWidget::lfoShapeSample( fpp_t _frame_offset )
{
f_cnt_t frame = ( m_lfoFrame + _frame_offset ) % m_lfoOscillationFrames;
const float phase = frame / static_cast<float>(
@@ -537,8 +537,8 @@ inline sample_t envelopeAndLFOWidget::lfoShapeSample( fpab_t _frame_offset )
void envelopeAndLFOWidget::updateLFOShapeData( void )
{
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
for( fpab_t offset = 0; offset < frames; ++offset )
const fpp_t frames = engine::getMixer()->framesPerPeriod();
for( fpp_t offset = 0; offset < frames; ++offset )
{
m_lfoShapeData[offset] = lfoShapeSample( offset );
}
@@ -555,7 +555,7 @@ void envelopeAndLFOWidget::triggerLFO( void )
it != v.end(); ++it )
{
( *it )->m_lfoFrame +=
engine::getMixer()->framesPerAudioBuffer();
engine::getMixer()->framesPerPeriod();
( *it )->m_bad_lfoShapeData = TRUE;
}
}
@@ -579,11 +579,11 @@ void envelopeAndLFOWidget::resetLFO( void )
inline void FASTCALL envelopeAndLFOWidget::fillLFOLevel( float * _buf,
f_cnt_t _frame,
const fpab_t _frames )
const fpp_t _frames )
{
if( m_lfoAmountIsZero || _frame <= m_lfoPredelayFrames )
{
for( fpab_t offset = 0; offset < _frames; ++offset )
for( fpp_t offset = 0; offset < _frames; ++offset )
{
*_buf++ = 0.0f;
}
@@ -596,7 +596,7 @@ inline void FASTCALL envelopeAndLFOWidget::fillLFOLevel( float * _buf,
updateLFOShapeData();
}
fpab_t offset = 0;
fpp_t offset = 0;
for( ; offset < _frames && _frame < m_lfoAttackFrames; ++offset,
++_frame )
{
@@ -613,11 +613,11 @@ inline void FASTCALL envelopeAndLFOWidget::fillLFOLevel( float * _buf,
void FASTCALL envelopeAndLFOWidget::fillLevel( float * _buf, f_cnt_t _frame,
const f_cnt_t _release_begin,
const fpab_t _frames )
const fpp_t _frames )
{
fillLFOLevel( _buf, _frame, _frames );
for( fpab_t offset = 0; offset < _frames; ++offset, ++_buf, ++_frame )
for( fpp_t offset = 0; offset < _frames; ++offset, ++_buf, ++_frame )
{
float env_level;
if( _frame < _release_begin )

View File

@@ -234,7 +234,7 @@ float FASTCALL envelopeTabWidget::volumeLevel( notePlayHandle * _n,
if( _n->released() == FALSE )
{
release_begin += engine::getMixer()->framesPerAudioBuffer();
release_begin += engine::getMixer()->framesPerPeriod();
}
float volume_level;
@@ -248,7 +248,7 @@ float FASTCALL envelopeTabWidget::volumeLevel( notePlayHandle * _n,
void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
const fpab_t _frames,
const fpp_t _frames,
notePlayHandle * _n )
{
const f_cnt_t total_frames = _n->totalFramesPlayed();
@@ -257,7 +257,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
if( _n->released() == FALSE )
{
release_begin += engine::getMixer()->framesPerAudioBuffer();
release_begin += engine::getMixer()->framesPerPeriod();
}
// because of optimizations, there's special code for several cases:
@@ -299,7 +299,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
if( m_envLFOWidgets[CUT]->used() &&
m_envLFOWidgets[RES]->used() )
{
for( fpab_t frame = 0; frame < _frames; ++frame )
for( fpp_t frame = 0; frame < _frames; ++frame )
{
float new_cut_val = envelopeAndLFOWidget::expKnobVal( cut_buf[frame] ) * CUT_FREQ_MULTIPLIER +
m_filterCutKnob->value();
@@ -323,7 +323,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
}
else if( m_envLFOWidgets[CUT]->used() )
{
for( fpab_t frame = 0; frame < _frames; ++frame )
for( fpp_t frame = 0; frame < _frames; ++frame )
{
float new_cut_val = envelopeAndLFOWidget::expKnobVal( cut_buf[frame] ) * CUT_FREQ_MULTIPLIER +
m_filterCutKnob->value();
@@ -342,7 +342,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
}
else if( m_envLFOWidgets[RES]->used() )
{
for( fpab_t frame = 0; frame < _frames; ++frame )
for( fpp_t frame = 0; frame < _frames; ++frame )
{
float new_res_val = m_filterResKnob->value() + RES_MULTIPLIER *
res_buf[frame];
@@ -363,7 +363,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
{
_n->m_filter->calcFilterCoeffs( m_filterCutKnob->value(), m_filterResKnob->value() );
for( fpab_t frame = 0; frame < _frames; ++frame )
for( fpp_t frame = 0; frame < _frames; ++frame )
{
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
{
@@ -382,7 +382,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
m_envLFOWidgets[VOLUME]->fillLevel( vol_buf, total_frames,
release_begin, _frames );
for( fpab_t frame = 0; frame < _frames; ++frame )
for( fpp_t frame = 0; frame < _frames; ++frame )
{
float vol_level = vol_buf[frame];
vol_level = vol_level * vol_level;
@@ -398,7 +398,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
/* else if( m_envLFOWidgets[VOLUME]->used() == FALSE && m_envLFOWidgets[PANNING]->used() )
{
// only use panning-envelope...
for( fpab_t frame = 0; frame < _frames; ++frame )
for( fpp_t frame = 0; frame < _frames; ++frame )
{
float vol_level = pan_buf[frame];
vol_level = vol_level*vol_level;

View File

@@ -112,23 +112,15 @@ samplePlayHandle::~samplePlayHandle()
void samplePlayHandle::play( bool _try_parallelizing )
{
play( 0, _try_parallelizing );
}
void samplePlayHandle::play( const fpab_t _frame_base, bool )
void samplePlayHandle::play( bool /* _try_parallelizing */ )
{
//play( 0, _try_parallelizing );
if( framesDone() >= totalFrames() )
{
return;
}
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer()
- _frame_base;
const fpp_t frames = engine::getMixer()->framesPerPeriod();
if( !( m_track && m_track->muted() )
&& !( m_bbTrack && m_bbTrack->muted() ) )
{
@@ -139,7 +131,7 @@ void samplePlayHandle::play( const fpab_t _frame_base, bool )
#endif
} } ;
m_sampleBuffer->play( buf, &m_state, frames );
engine::getMixer()->bufferToPort( buf, frames, _frame_base, v,
engine::getMixer()->bufferToPort( buf, frames, offset(), v,
m_audioPort );
delete[] buf;

View File

@@ -990,10 +990,10 @@ void songEditor::processNextBuffer( void )
float frames_per_tact64th = engine::framesPerTact64th();
while( total_frames_played
< engine::getMixer()->framesPerAudioBuffer() )
< engine::getMixer()->framesPerPeriod() )
{
f_cnt_t played_frames = engine::getMixer()
->framesPerAudioBuffer() - total_frames_played;
->framesPerPeriod() - total_frames_played;
float current_frame = m_playPos[m_playMode].currentFrame();
// did we play a 64th of a tact?

View File

@@ -52,7 +52,7 @@ oscillator::oscillator( const waveShapes & _wave_shape,
void oscillator::update( sampleFrame * _ab, const fpab_t _frames,
void oscillator::update( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
if( m_subOsc != NULL )
@@ -84,7 +84,7 @@ void oscillator::update( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updateNoSub( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updateNoSub( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
switch( m_waveShape )
@@ -120,7 +120,7 @@ void oscillator::updateNoSub( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updatePM( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updatePM( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
switch( m_waveShape )
@@ -156,7 +156,7 @@ void oscillator::updatePM( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updateAM( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updateAM( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
switch( m_waveShape )
@@ -192,7 +192,7 @@ void oscillator::updateAM( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updateMix( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updateMix( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
switch( m_waveShape )
@@ -228,7 +228,7 @@ void oscillator::updateMix( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updateSync( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updateSync( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
switch( m_waveShape )
@@ -264,7 +264,7 @@ void oscillator::updateSync( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updateFM( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
switch( m_waveShape )
@@ -326,7 +326,7 @@ inline bool oscillator::syncOk( float _osc_coeff )
float oscillator::syncInit( sampleFrame * _ab, const fpab_t _frames,
float oscillator::syncInit( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
if( m_subOsc != NULL )
@@ -342,13 +342,13 @@ float oscillator::syncInit( sampleFrame * _ab, const fpab_t _frames,
// if we have no sub-osc, we can't do any modulation... just get our samples
template<oscillator::waveShapes W>
void oscillator::updateNoSub( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updateNoSub( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
recalcPhase();
const float osc_coeff = m_freq * m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
for( fpp_t frame = 0; frame < _frames; ++frame )
{
_ab[frame][_chnl] = getSample<W>( m_phase ) * m_volume;
m_phase += osc_coeff;
@@ -360,14 +360,14 @@ void oscillator::updateNoSub( sampleFrame * _ab, const fpab_t _frames,
// do pm by using sub-osc as modulator
template<oscillator::waveShapes W>
void oscillator::updatePM( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updatePM( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
m_subOsc->update( _ab, _frames, _chnl );
recalcPhase();
const float osc_coeff = m_freq * m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
for( fpp_t frame = 0; frame < _frames; ++frame )
{
_ab[frame][_chnl] = getSample<W>( m_phase + _ab[frame][_chnl] )
* m_volume;
@@ -380,14 +380,14 @@ void oscillator::updatePM( sampleFrame * _ab, const fpab_t _frames,
// do am by using sub-osc as modulator
template<oscillator::waveShapes W>
void oscillator::updateAM( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updateAM( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
m_subOsc->update( _ab, _frames, _chnl );
recalcPhase();
const float osc_coeff = m_freq * m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
for( fpp_t frame = 0; frame < _frames; ++frame )
{
_ab[frame][_chnl] *= getSample<W>( m_phase ) * m_volume;
m_phase += osc_coeff;
@@ -399,14 +399,14 @@ void oscillator::updateAM( sampleFrame * _ab, const fpab_t _frames,
// do mix by using sub-osc as mix-sample
template<oscillator::waveShapes W>
void oscillator::updateMix( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updateMix( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
m_subOsc->update( _ab, _frames, _chnl );
recalcPhase();
const float osc_coeff = m_freq * m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
for( fpp_t frame = 0; frame < _frames; ++frame )
{
_ab[frame][_chnl] += getSample<W>( m_phase ) * m_volume;
m_phase += osc_coeff;
@@ -419,14 +419,14 @@ void oscillator::updateMix( sampleFrame * _ab, const fpab_t _frames,
// sync with sub-osc (every time sub-osc starts new period, we also start new
// period)
template<oscillator::waveShapes W>
void oscillator::updateSync( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updateSync( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
const float sub_osc_coeff = m_subOsc->syncInit( _ab, _frames, _chnl );
recalcPhase();
const float osc_coeff = m_freq * m_detuning;
for( fpab_t frame = 0; frame < _frames ; ++frame )
for( fpp_t frame = 0; frame < _frames ; ++frame )
{
if( m_subOsc->syncOk( sub_osc_coeff ) )
{
@@ -442,14 +442,14 @@ void oscillator::updateSync( sampleFrame * _ab, const fpab_t _frames,
// do fm by using sub-osc as modulator
template<oscillator::waveShapes W>
void oscillator::updateFM( sampleFrame * _ab, const fpab_t _frames,
void oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
m_subOsc->update( _ab, _frames, _chnl );
recalcPhase();
const float osc_coeff = m_freq * m_detuning;
for( fpab_t frame = 0; frame < _frames; ++frame )
for( fpp_t frame = 0; frame < _frames; ++frame )
{
m_phase += _ab[frame][_chnl];
_ab[frame][_chnl] = getSample<W>( m_phase ) * m_volume;

View File

@@ -594,7 +594,7 @@ void sampleBuffer::initResampling( void )
bool FASTCALL sampleBuffer::play( sampleFrame * _ab, handleState * _state,
const fpab_t _frames,
const fpp_t _frames,
const float _freq,
const bool _looped )
{

View File

@@ -55,7 +55,7 @@ track::trackTypes automationTrack::type( void ) const
bool automationTrack::play( const midiTime & _start,
const fpab_t _frames,
const fpp_t _frames,
const f_cnt_t _frame_base,
Sint16 _tco_num )
{

View File

@@ -404,8 +404,8 @@ track::trackTypes bbTrack::type( void ) const
// play _frames frames of given TCO within starting with _start
bool FASTCALL bbTrack::play( const midiTime & _start,
const fpab_t _frames,
const f_cnt_t _frame_base,
const fpp_t _frames,
const f_cnt_t _offset,
Sint16 _tco_num )
{
sendMidiTime( _start );
@@ -413,7 +413,7 @@ bool FASTCALL bbTrack::play( const midiTime & _start,
if( _tco_num >= 0 )
{
return( engine::getBBEditor()->play( _start, _frames,
_frame_base,
_offset,
s_infoMap[this] ) );
}
@@ -442,7 +442,7 @@ bool FASTCALL bbTrack::play( const midiTime & _start,
{
return( engine::getBBEditor()->play( _start - lastPosition,
_frames,
_frame_base,
_offset,
s_infoMap[this] ) );
}
return( FALSE );

View File

@@ -279,7 +279,7 @@ void rackPlugin::setAutoQuit( float _value )
{
float samples = engine::getMixer()->sampleRate() * _value / 1000.0f;
Uint32 buffers = 1 + ( static_cast<Uint32>( samples ) /
engine::getMixer()->framesPerAudioBuffer() );
engine::getMixer()->framesPerPeriod() );
m_effect->setTimeout( buffers );
}

View File

@@ -66,7 +66,7 @@ visualizationWidget::visualizationWidget( const QPixmap & _bg, QWidget * _p,
setFixedSize( s_background.width(), s_background.height() );
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
const fpp_t frames = engine::getMixer()->framesPerPeriod();
m_buffer = new surroundSampleFrame[frames];
engine::getMixer()->clearAudioBuffer( m_buffer, frames );
@@ -139,11 +139,11 @@ void visualizationWidget::paintEvent( QPaintEvent * )
float max_level = 0.0;
const fpab_t frames =
engine::getMixer()->framesPerAudioBuffer();
const fpp_t frames =
engine::getMixer()->framesPerPeriod();
// analyse wave-stream for max-level
for( fpab_t frame = 0; frame < frames; ++frame )
for( fpp_t frame = 0; frame < frames; ++frame )
{
for( ch_cnt_t chnl = 0; chnl < SURROUND_CHANNELS;
++chnl )
@@ -171,7 +171,7 @@ void visualizationWidget::paintEvent( QPaintEvent * )
}
// now draw all that stuff
for( fpab_t frame = 0; frame < frames; ++frame )
for( fpp_t frame = 0; frame < frames; ++frame )
{
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
{