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:
10
ChangeLog
10
ChangeLog
@@ -1,3 +1,13 @@
|
||||
2007-08-04 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* include/mixer.h:
|
||||
* most other files:
|
||||
renamed "framesPerAudioBuffer()" to "framesPerPeriod()"
|
||||
|
||||
* include/types.h:
|
||||
* most other files:
|
||||
renamed type "fpab_t" to "fpp_t"
|
||||
|
||||
2007-07-30 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* plugins/singerbot/singerbot.h:
|
||||
|
||||
@@ -144,29 +144,29 @@ protected:
|
||||
// subclasses can re-implement this for being used in conjunction with
|
||||
// processNextBuffer()
|
||||
virtual void FASTCALL writeBuffer( const surroundSampleFrame * _ab,
|
||||
const fpab_t _frames,
|
||||
const fpp_t _frames,
|
||||
const float _master_gain )
|
||||
{
|
||||
}
|
||||
|
||||
// called by according driver for fetching new sound-data
|
||||
fpab_t FASTCALL getNextBuffer( surroundSampleFrame * _ab );
|
||||
fpp_t FASTCALL getNextBuffer( surroundSampleFrame * _ab );
|
||||
|
||||
// convert a given audio-buffer to a buffer in signed 16-bit samples
|
||||
// returns num of bytes in outbuf
|
||||
Uint32 FASTCALL 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 = FALSE );
|
||||
|
||||
// clear given signed-int-16-buffer
|
||||
void FASTCALL clearS16Buffer( int_sample_t * _outbuf,
|
||||
const fpab_t _frames );
|
||||
const fpp_t _frames );
|
||||
|
||||
// resample given buffer from samplerate _src_sr to samplerate _dst_sr
|
||||
void FASTCALL 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 );
|
||||
|
||||
@@ -109,7 +109,7 @@ private:
|
||||
delete[] b;
|
||||
|
||||
const Sint32 microseconds = static_cast<Sint32>(
|
||||
getMixer()->framesPerAudioBuffer() *
|
||||
getMixer()->framesPerPeriod() *
|
||||
1000000.0f / getMixer()->sampleRate() -
|
||||
timer.elapsed() );
|
||||
if( microseconds > 0 )
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
|
||||
private:
|
||||
virtual void FASTCALL writeBuffer( const surroundSampleFrame * _ab,
|
||||
const fpab_t _frames,
|
||||
const fpp_t _frames,
|
||||
const float _master_gain );
|
||||
|
||||
bool startEncoding( void );
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
|
||||
private:
|
||||
virtual void FASTCALL writeBuffer( const surroundSampleFrame * _ab,
|
||||
const fpab_t _frames,
|
||||
const fpp_t _frames,
|
||||
float _master_gain );
|
||||
|
||||
bool startEncoding( void );
|
||||
|
||||
@@ -109,7 +109,7 @@ private:
|
||||
QString m_name;
|
||||
|
||||
effectChain * m_effects;
|
||||
fpab_t m_frames;
|
||||
fpp_t m_frames;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -64,10 +64,10 @@ public:
|
||||
|
||||
private:
|
||||
virtual void FASTCALL writeBuffer( const surroundSampleFrame * _ab,
|
||||
const fpab_t _frames,
|
||||
const fpp_t _frames,
|
||||
const float _master_gain );
|
||||
|
||||
typedef vlist<QPair<sampleFrame *, fpab_t> > bufferList;
|
||||
typedef vlist<QPair<sampleFrame *, fpp_t> > bufferList;
|
||||
bufferList m_buffers;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -47,7 +47,7 @@ private:
|
||||
virtual trackTypes type( void ) const;
|
||||
|
||||
virtual bool FASTCALL play( const midiTime & _start,
|
||||
const fpab_t _frames,
|
||||
const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class bbEditor : public trackContainer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
virtual bool FASTCALL play( midiTime _start, const fpab_t _frames,
|
||||
virtual bool FASTCALL play( midiTime _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
|
||||
virtual trackTypes type( void ) const;
|
||||
virtual bool FASTCALL play( const midiTime & _start,
|
||||
const fpab_t _frames,
|
||||
const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
virtual trackContentObject * FASTCALL createTCO( const midiTime &
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
virtual ~effect();
|
||||
|
||||
virtual bool FASTCALL processAudioBuffer(
|
||||
surroundSampleFrame * _buf, const fpab_t _frames );
|
||||
surroundSampleFrame * _buf, const fpp_t _frames );
|
||||
|
||||
inline ch_cnt_t getProcessorCount( void )
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
void FASTCALL moveDown( effect * _effect );
|
||||
void FASTCALL moveUp( effect * _effect );
|
||||
bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf,
|
||||
const fpab_t _frames );
|
||||
const fpp_t _frames );
|
||||
void startRunning( void );
|
||||
bool isRunning( void );
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
|
||||
void FASTCALL fillLevel( float * _buf, f_cnt_t _frame,
|
||||
const f_cnt_t _release_begin,
|
||||
const fpab_t _frames );
|
||||
const fpp_t _frames );
|
||||
|
||||
inline bool used( void ) const
|
||||
{
|
||||
@@ -115,7 +115,7 @@ protected:
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
|
||||
void FASTCALL fillLFOLevel( float * _buf, f_cnt_t _frame,
|
||||
const fpab_t _frames );
|
||||
const fpp_t _frames );
|
||||
|
||||
|
||||
protected slots:
|
||||
@@ -182,7 +182,7 @@ private:
|
||||
USER
|
||||
} m_lfoShape;
|
||||
|
||||
sample_t lfoShapeSample( fpab_t _frame_offset );
|
||||
sample_t lfoShapeSample( fpp_t _frame_offset );
|
||||
void updateLFOShapeData( void );
|
||||
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
virtual ~envelopeTabWidget();
|
||||
|
||||
void FASTCALL processAudioBuffer( sampleFrame * _ab,
|
||||
const fpab_t _frames,
|
||||
const fpp_t _frames,
|
||||
notePlayHandle * _n );
|
||||
|
||||
enum targets
|
||||
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
|
||||
// used by instrument
|
||||
void FASTCALL processAudioBuffer( sampleFrame * _buf,
|
||||
const fpab_t _frames,
|
||||
const fpp_t _frames,
|
||||
notePlayHandle * _n );
|
||||
|
||||
virtual void FASTCALL processInEvent( const midiEvent & _me,
|
||||
@@ -134,7 +134,7 @@ public:
|
||||
|
||||
// play everything in given frame-range - creates note-play-handles
|
||||
virtual bool FASTCALL play( const midiTime & _start,
|
||||
const fpab_t _frames,
|
||||
const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
// create new track-content-object = pattern
|
||||
|
||||
@@ -59,7 +59,7 @@ class midiClient;
|
||||
class audioPort;
|
||||
|
||||
|
||||
const fpab_t DEFAULT_BUFFER_SIZE = 512;
|
||||
const fpp_t DEFAULT_BUFFER_SIZE = 512;
|
||||
|
||||
const ch_cnt_t DEFAULT_CHANNELS = 2;
|
||||
|
||||
@@ -196,9 +196,9 @@ public:
|
||||
|
||||
|
||||
// methods providing information for other classes
|
||||
inline fpab_t framesPerAudioBuffer( void ) const
|
||||
inline fpp_t framesPerPeriod( void ) const
|
||||
{
|
||||
return( m_framesPerAudioBuffer );
|
||||
return( m_framesPerPeriod );
|
||||
}
|
||||
|
||||
inline const surroundSampleFrame * currentAudioBuffer( void ) const
|
||||
@@ -282,16 +282,18 @@ public:
|
||||
|
||||
// audio-buffer-mgm
|
||||
void FASTCALL bufferToPort( const sampleFrame * _buf,
|
||||
const fpab_t _frames,
|
||||
const f_cnt_t _framesAhead,
|
||||
const fpp_t _frames,
|
||||
const f_cnt_t _offset,
|
||||
const volumeVector & _volumeVector,
|
||||
audioPort * _port );
|
||||
|
||||
void FASTCALL clearAudioBuffer( sampleFrame * _ab,
|
||||
const f_cnt_t _frames );
|
||||
const f_cnt_t _frames,
|
||||
const f_cnt_t _offset = 0 );
|
||||
#ifndef DISABLE_SURROUND
|
||||
void FASTCALL clearAudioBuffer( surroundSampleFrame * _ab,
|
||||
const f_cnt_t _frames );
|
||||
const f_cnt_t _frames,
|
||||
const f_cnt_t _offset = 0 );
|
||||
#endif
|
||||
|
||||
bool criticalXRuns( void ) const;
|
||||
@@ -346,13 +348,13 @@ private:
|
||||
void processBuffer( const surroundSampleFrame * _buf,
|
||||
const fx_ch_t _fx_chnl );
|
||||
|
||||
void FASTCALL scaleClip( fpab_t _frame, ch_cnt_t _chnl );
|
||||
void FASTCALL scaleClip( fpp_t _frame, ch_cnt_t _chnl );
|
||||
|
||||
const surroundSampleFrame * renderNextBuffer( void );
|
||||
|
||||
vvector<audioPort *> m_audioPorts;
|
||||
|
||||
fpab_t m_framesPerAudioBuffer;
|
||||
fpp_t m_framesPerPeriod;
|
||||
|
||||
surroundSampleFrame * m_readBuf;
|
||||
surroundSampleFrame * m_writeBuf;
|
||||
@@ -366,7 +368,7 @@ private:
|
||||
bool m_scaleClip;
|
||||
surroundSampleFrame m_maxClip;
|
||||
surroundSampleFrame m_previousSample;
|
||||
fpab_t m_halfStart[SURROUND_CHANNELS];
|
||||
fpp_t m_halfStart[SURROUND_CHANNELS];
|
||||
bool m_clipped[SURROUND_CHANNELS];
|
||||
bool m_oldBuffer[SURROUND_CHANNELS];
|
||||
bool m_newBuffer[SURROUND_CHANNELS];
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
m_userWave = _wave;
|
||||
}
|
||||
|
||||
void update( sampleFrame * _ab, const fpab_t _frames,
|
||||
void update( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl );
|
||||
|
||||
/*#define FLOAT_TO_INT(in,out) \
|
||||
@@ -166,40 +166,40 @@ private:
|
||||
const sampleBuffer * m_userWave;
|
||||
|
||||
|
||||
void updateNoSub( sampleFrame * _ab, const fpab_t _frames,
|
||||
void updateNoSub( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl );
|
||||
void updatePM( sampleFrame * _ab, const fpab_t _frames,
|
||||
void updatePM( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl );
|
||||
void updateAM( sampleFrame * _ab, const fpab_t _frames,
|
||||
void updateAM( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl );
|
||||
void updateMix( sampleFrame * _ab, const fpab_t _frames,
|
||||
void updateMix( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl );
|
||||
void updateSync( sampleFrame * _ab, const fpab_t _frames,
|
||||
void updateSync( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl );
|
||||
void updateFM( sampleFrame * _ab, const fpab_t _frames,
|
||||
void updateFM( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl );
|
||||
|
||||
float syncInit( sampleFrame * _ab, const fpab_t _frames,
|
||||
float syncInit( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl );
|
||||
inline bool syncOk( float _osc_coeff );
|
||||
|
||||
template<waveShapes W>
|
||||
void updateNoSub( sampleFrame * _ab, const fpab_t _frames,
|
||||
void updateNoSub( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl );
|
||||
template<waveShapes W>
|
||||
void updatePM( sampleFrame * _ab, const fpab_t _frames,
|
||||
void updatePM( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl );
|
||||
template<waveShapes W>
|
||||
void updateAM( sampleFrame * _ab, const fpab_t _frames,
|
||||
void updateAM( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl );
|
||||
template<waveShapes W>
|
||||
void updateMix( sampleFrame * _ab, const fpab_t _frames,
|
||||
void updateMix( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl );
|
||||
template<waveShapes W>
|
||||
void updateSync( sampleFrame * _ab, const fpab_t _frames,
|
||||
void updateSync( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl );
|
||||
template<waveShapes W>
|
||||
void updateFM( sampleFrame * _ab, const fpab_t _frames,
|
||||
void updateFM( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl );
|
||||
|
||||
template<waveShapes W>
|
||||
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
virtual ~sampleBuffer();
|
||||
|
||||
bool FASTCALL play( sampleFrame * _ab, handleState * _state,
|
||||
const fpab_t _frames,
|
||||
const fpp_t _frames,
|
||||
const float _freq = BASE_FREQ,
|
||||
const bool _looped = FALSE );
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ public:
|
||||
virtual ~samplePlayHandle();
|
||||
|
||||
virtual void play( bool _try_parallelizing );
|
||||
void play( const fpab_t _frame_base, bool _try_parallelizing );
|
||||
virtual bool done( void ) const;
|
||||
|
||||
virtual bool isFromTrack( const track * _track ) const;
|
||||
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
|
||||
virtual trackTypes type( void ) const;
|
||||
virtual bool FASTCALL play( const midiTime & _start,
|
||||
const fpab_t _frames,
|
||||
const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
virtual trackContentObject * FASTCALL createTCO( const midiTime &
|
||||
|
||||
@@ -48,12 +48,12 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void update( sampleFrame * _ab, const fpab_t _frames,
|
||||
void update( sampleFrame * _ab, const fpp_t _frames,
|
||||
const float _freq1, const float _freq2,
|
||||
const float _sample_rate )
|
||||
{
|
||||
const float df = _freq2 - _freq1;
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame )
|
||||
for( fpp_t frame = 0; frame < _frames; ++frame )
|
||||
{
|
||||
sample_t s = oscillator::sinSample( m_phase );
|
||||
for( ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch )
|
||||
|
||||
@@ -431,7 +431,7 @@ public:
|
||||
virtual trackTypes type( void ) const = 0;
|
||||
|
||||
virtual bool FASTCALL play( const midiTime & _start,
|
||||
const fpab_t _frames,
|
||||
const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 ) = 0;
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ typedef Sint16 int_sample_t; // 16-bit-int-sample
|
||||
|
||||
|
||||
typedef Uint32 sample_rate_t; // sample-rate
|
||||
typedef Sint16 fpab_t; // frames per audio-buffer (0-16384)
|
||||
typedef Sint16 fpp_t; // frames per period (0-16384)
|
||||
typedef Sint32 f_cnt_t; // standard frame-count
|
||||
typedef Uint8 ch_cnt_t; // channel-count (0-SURROUND_CHANNELS)
|
||||
typedef Uint16 bpm_t; // tempo (MIN_BPM to MAX_BPM)
|
||||
|
||||
@@ -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] );
|
||||
|
||||
@@ -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" );
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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 ) /
|
||||
|
||||
@@ -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] =
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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() );
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 );
|
||||
|
||||
} ;
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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()];
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 ) ?
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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?
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user