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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user