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

@@ -69,7 +69,7 @@ bassBoosterEffect::~bassBoosterEffect()
bool FASTCALL bassBoosterEffect::processAudioBuffer( surroundSampleFrame * _buf,
const fpab_t _frames )
const fpp_t _frames )
{
if( isBypassed() || !isRunning () )
{
@@ -77,7 +77,7 @@ bool FASTCALL bassBoosterEffect::processAudioBuffer( surroundSampleFrame * _buf,
}
double out_sum = 0.0;
for( fpab_t f = 0; f < _frames; ++f )
for( fpp_t f = 0; f < _frames; ++f )
{
sample_t s[2] = { _buf[f][0], _buf[f][1] };
m_bbFX.nextSample( s[0], s[1] );

View File

@@ -41,7 +41,7 @@ public:
bassBoosterEffect( const descriptor::subPluginFeatures::key * _key );
virtual ~bassBoosterEffect();
virtual bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf,
const fpab_t _frames );
const fpp_t _frames );
inline virtual QString nodeName( void ) const
{
return( "bassboostereffect" );

View File

@@ -701,11 +701,11 @@ void bitInvader::playNote( notePlayHandle * _n, bool )
engine::getMixer()->sampleRate() );
}
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
const fpp_t frames = _n->framesLeftForCurrentPeriod();
sampleFrame * buf = new sampleFrame[frames];
bSynth * ps = static_cast<bSynth *>( _n->m_pluginData );
for( fpab_t frame = 0; frame < frames; ++frame )
for( fpp_t frame = 0; frame < frames; ++frame )
{
const sample_t cur = ps->nextStringSample();
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )

View File

@@ -192,12 +192,13 @@ void kickerInstrument::playNote( notePlayHandle * _n, bool )
//const float freq = getInstrumentTrack()->frequency( _n ) / 2;
const float fdiff = m_endFreqKnob->value() - m_startFreqKnob->value();
const fpab_t frames = _n->released() ?
/* const fpp_t frames = _n->released() ?
tMax( tMin<f_cnt_t>( desiredReleaseFrames() -
_n->releaseFramesDone(),
engine::getMixer()->framesPerAudioBuffer() ), 0 )
:
engine::getMixer()->framesPerAudioBuffer();
engine::getMixer()->framesPerAudioBuffer();*/
const fpp_t frames = _n->framesLeftForCurrentPeriod();
const float f1 = m_startFreqKnob->value() + tfp * fdiff / decfr;
const float f2 = m_startFreqKnob->value() + (frames+tfp-1)*fdiff/decfr;
@@ -209,7 +210,7 @@ void kickerInstrument::playNote( notePlayHandle * _n, bool )
if( _n->released() )
{
for( fpab_t f = 0; f < frames; ++f )
for( fpp_t f = 0; f < frames; ++f )
{
const float fac = 1.0f -
(float)( _n->releaseFramesDone()+f ) /

View File

@@ -116,7 +116,7 @@ ladspaEffect::ladspaEffect( const descriptor::subPluginFeatures::key * _key ) :
// during cleanup. It was easier to troubleshoot with the
// memory management all taking place in one file.
p->buffer =
new LADSPA_Data[engine::getMixer()->framesPerAudioBuffer()];
new LADSPA_Data[engine::getMixer()->framesPerPeriod()];
if( p->name.toUpper().contains( "IN" ) &&
m_ladspa->isPortInput( m_key, port ) )
@@ -334,7 +334,7 @@ ladspaEffect::~ladspaEffect()
bool FASTCALL ladspaEffect::processAudioBuffer( surroundSampleFrame * _buf,
const fpab_t _frames )
const fpp_t _frames )
{
if( !isOkay() || dontRun() || !isRunning() || isBypassed() )
{
@@ -353,7 +353,7 @@ bool FASTCALL ladspaEffect::processAudioBuffer( surroundSampleFrame * _buf,
switch( m_ports[proc][port]->rate )
{
case CHANNEL_IN:
for( fpab_t frame = 0;
for( fpp_t frame = 0;
frame < _frames; frame++ )
{
m_ports[proc][port]->buffer[frame] =
@@ -369,7 +369,7 @@ bool FASTCALL ladspaEffect::processAudioBuffer( surroundSampleFrame * _buf,
// This only supports control rate ports, so the audio rates are
// treated as though they were control rate by setting the
// port buffer to all the same value.
for( fpab_t frame = 0;
for( fpp_t frame = 0;
frame < _frames; frame++ )
{
m_ports[proc][port]->buffer[frame] =
@@ -419,7 +419,7 @@ bool FASTCALL ladspaEffect::processAudioBuffer( surroundSampleFrame * _buf,
case CONTROL_RATE_INPUT:
break;
case CHANNEL_OUT:
for( fpab_t frame = 0;
for( fpp_t frame = 0;
frame < _frames; frame++ )
{
_buf[frame][channel] =

View File

@@ -50,7 +50,7 @@ public:
virtual ~ladspaEffect();
virtual bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf,
const fpab_t _frames );
const fpp_t _frames );
void FASTCALL setControl( Uint16 _control, LADSPA_Data _data );
@@ -89,7 +89,7 @@ private:
ladspa2LMMS * m_ladspa;
Uint16 m_effectChannels;
Uint16 m_portCount;
fpab_t m_bufferSize;
fpp_t m_bufferSize;
const LADSPA_Descriptor * m_descriptor;
vvector<LADSPA_Handle> m_handles;

View File

@@ -738,7 +738,7 @@ void lb302Synth::playNote( notePlayHandle * _n, bool )
}
}
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
const fpp_t frames = _n->framesLeftForCurrentPeriod();
sampleFrame *buf = new sampleFrame[frames];
process(buf, frames);

View File

@@ -359,7 +359,7 @@ void organicInstrument::playNote( notePlayHandle * _n, bool )
oscillator * osc_r = static_cast<oscPtr *>( _n->m_pluginData
)->oscRight;
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
const fpp_t frames = _n->framesLeftForCurrentPeriod();
sampleFrame * buf = new sampleFrame[frames];
osc_l->update( buf, frames, 0 );

View File

@@ -213,7 +213,7 @@ QString patmanSynth::nodeName( void ) const
void patmanSynth::playNote( notePlayHandle * _n, bool )
{
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
const fpp_t frames = _n->framesLeftForCurrentPeriod();
sampleFrame * buf = new sampleFrame[frames];
if( !_n->m_pluginData )

View File

@@ -143,11 +143,11 @@ void pluckedStringSynth::playNote( notePlayHandle * _n, bool )
engine::getMixer()->sampleRate() );
}
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
const fpp_t frames = _n->framesLeftForCurrentPeriod();
sampleFrame * buf = new sampleFrame[frames];
pluckSynth * ps = static_cast<pluckSynth *>( _n->m_pluginData );
for( Uint32 frame = 0; frame < frames; ++frame )
for( fpp_t frame = 0; frame < frames; ++frame )
{
const sample_t cur = ps->nextStringSample();
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )

View File

@@ -551,7 +551,7 @@ void polyb302Synth::playNote( notePlayHandle * _n, bool )
}
}
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
const fpp_t frames = _n->framesLeftForCurrentPeriod();
sampleFrame * buf = new sampleFrame[frames];
hstate->process( buf, frames, _n->frequency() );

View File

@@ -145,7 +145,7 @@ singerBot::~singerBot()
void singerBot::playNote( notePlayHandle * _n, bool )
{
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
const fpp_t frames = _n->framesLeftForCurrentPeriod();
if( !_n->m_pluginData )
{
@@ -293,7 +293,7 @@ void singerBot::createWave( notePlayHandle * _n )
void singerBot::play( sampleFrame * _ab, handle_data * _hdata,
const fpab_t _frames )
const fpp_t _frames )
{
const f_cnt_t offset = _hdata->wave->num_samples()
- _hdata->remaining_frames;

View File

@@ -144,7 +144,7 @@ private:
void createWave( notePlayHandle * _n );
void play( sampleFrame * _ab, handle_data * _hdata,
const fpab_t _frames );
const fpp_t _frames );
void updateWords( void );
} ;

View File

@@ -94,7 +94,7 @@ mallets::mallets( instrumentTrack * _channel_track ) :
m_spread->move( 178, 173 );
m_spread->setHintText( tr( "Spread:" ) + " ", "" );
m_buffer = new sampleFrame[engine::getMixer()->framesPerAudioBuffer()];
m_buffer = new sampleFrame[engine::getMixer()->framesPerPeriod()];
}
@@ -441,7 +441,7 @@ void mallets::playNote( notePlayHandle * _n, bool )
}
}
const Uint32 frames = engine::getMixer()->framesPerAudioBuffer();
const fpp_t frames = _n->framesLeftForCurrentPeriod();
malletsSynth * ps = static_cast<malletsSynth *>( _n->m_pluginData );
sample_t add_scale = 0.0f;
@@ -450,7 +450,7 @@ void mallets::playNote( notePlayHandle * _n, bool )
add_scale =
static_cast<sample_t>( m_strike->value() ) * freq * 2.5f;
}
for( Uint32 frame = 0; frame < frames; ++frame )
for( fpp_t frame = 0; frame < frames; ++frame )
{
const sample_t left = ps->nextSampleLeft() *
( m_scalers[m_presets->value()] + add_scale );

View File

@@ -686,7 +686,7 @@ void tripleOscillator::playNote( notePlayHandle * _n, bool )
oscillator * osc_r = static_cast<oscPtr *>( _n->m_pluginData
)->oscRight;
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
const fpp_t frames = _n->framesLeftForCurrentPeriod();
sampleFrame * buf = new sampleFrame[frames];
osc_l->update( buf, frames, 0 );

View File

@@ -302,7 +302,7 @@ void vestigeInstrument::waitForWorkerThread( void )
return;
}
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
const fpp_t frames = engine::getMixer()->framesPerPeriod();
sampleFrame * buf = new sampleFrame[frames];
if( m_plugin->waitForProcessingFinished( buf ) )
@@ -358,7 +358,7 @@ void vestigeInstrument::playNote( notePlayHandle * _n, bool )
m_noteStates[k] = ON;
}
m_plugin->enqueueMidiEvent( midiEvent( NOTE_ON, 0, k,
_n->getVolume() ), _n->framesAhead() );
_n->getVolume() ), _n->offset() );
// notify when the handle stops, call to deleteNotePluginData
_n->m_pluginData = _n;
}

View File

@@ -575,13 +575,13 @@ void vibed::playNote( notePlayHandle * _n, bool )
}
}
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
const fpp_t frames = _n->framesLeftForCurrentPeriod();
stringContainer * ps = static_cast<stringContainer *>(
_n->m_pluginData );
sampleFrame * buf = new sampleFrame[frames];
for( fpab_t i = 0; i < frames; ++i )
for( fpp_t i = 0; i < frames; ++i )
{
buf[i][0] = 0.0f;
buf[i][1] = 0.0f;

View File

@@ -289,7 +289,7 @@ void remoteVSTPlugin::hideEditor( void )
bool remoteVSTPlugin::process( const sampleFrame * _in_buf,
sampleFrame * _out_buf, bool _wait )
{
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
const fpp_t frames = engine::getMixer()->framesPerPeriod();
if( m_shm == NULL )
{
@@ -317,7 +317,7 @@ bool remoteVSTPlugin::process( const sampleFrame * _in_buf,
{
for( ch_cnt_t ch = 0; ch < inputs; ++ch )
{
for( fpab_t frame = 0; frame < frames; ++frame )
for( fpp_t frame = 0; frame < frames; ++frame )
{
m_shm[ch * frames + frame] = _in_buf[frame][ch];
}
@@ -353,7 +353,7 @@ bool remoteVSTPlugin::waitForProcessingFinished( sampleFrame * _out_buf )
usleep( 10 );
}
const fpab_t frames = engine::getMixer()->framesPerAudioBuffer();
const fpp_t frames = engine::getMixer()->framesPerPeriod();
const ch_cnt_t outputs = tMax<ch_cnt_t>( m_outputCount,
DEFAULT_CHANNELS );
if( outputs != DEFAULT_CHANNELS )
@@ -364,7 +364,7 @@ bool remoteVSTPlugin::waitForProcessingFinished( sampleFrame * _out_buf )
for( ch_cnt_t ch = 0; ch < outputs; ++ch )
{
for( fpab_t frame = 0; frame < frames; ++frame )
for( fpp_t frame = 0; frame < frames; ++frame )
{
_out_buf[frame][ch] = m_shm[(m_inputCount+ch)*
frames+frame];
@@ -571,8 +571,8 @@ Sint16 remoteVSTPlugin::processNextMessage( void )
case VST_GET_BUFFER_SIZE:
writeValueS<Sint16>( VST_BUFFER_SIZE );
// handle is the same
writeValueS<fpab_t>(
engine::getMixer()->framesPerAudioBuffer() );
writeValueS<fpp_t>(
engine::getMixer()->framesPerPeriod() );
break;
case VST_SHM_KEY_AND_SIZE:

View File

@@ -161,7 +161,7 @@ public:
}
// set given block-size for plugin
void setBlockSize( const fpab_t _bsize );
void setBlockSize( const fpp_t _bsize );
// set given tempo
void setBPM( const bpm_t _bpm )
@@ -244,7 +244,7 @@ private:
DWORD m_guiThreadID;
fpab_t m_blockSize;
fpp_t m_blockSize;
float * m_shm;
float * * m_inputs;
@@ -532,7 +532,7 @@ void VSTPlugin::enqueueMidiEvent( const midiEvent & _event,
void VSTPlugin::setBlockSize( const fpab_t _bsize )
void VSTPlugin::setBlockSize( const fpp_t _bsize )
{
if( _bsize == m_blockSize )
{
@@ -1219,7 +1219,7 @@ int main( void )
case VST_BUFFER_SIZE:
plugin->setBlockSize( readValue<fpab_t>() );
plugin->setBlockSize( readValue<fpp_t>() );
break;
case VST_BPM:

View File

@@ -88,7 +88,7 @@ vstEffect::~vstEffect()
bool FASTCALL vstEffect::processAudioBuffer( surroundSampleFrame * _buf,
const fpab_t _frames )
const fpp_t _frames )
{
if( isBypassed() || !isRunning () )
{
@@ -98,7 +98,7 @@ bool FASTCALL vstEffect::processAudioBuffer( surroundSampleFrame * _buf,
if( m_plugin )
{
sampleFrame * buf = new sampleFrame[_frames];
for( fpab_t f = 0; f < _frames; ++f )
for( fpp_t f = 0; f < _frames; ++f )
{
for( ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch )
{
@@ -109,7 +109,7 @@ bool FASTCALL vstEffect::processAudioBuffer( surroundSampleFrame * _buf,
m_plugin->process( buf, buf, TRUE );
m_pluginMutex.unlock();
double out_sum = 0.0;
for( fpab_t f = 0; f < _frames; ++f )
for( fpp_t f = 0; f < _frames; ++f )
{
for( ch_cnt_t ch = 0; ch < SURROUND_CHANNELS; ++ch )
{

View File

@@ -53,7 +53,7 @@ public:
virtual ~vstEffect();
virtual bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf,
const fpab_t _frames );
const fpp_t _frames );
virtual inline QString publicName( void ) const
{