From 1647da26fdb33a0d657a35c0f6532fad338aa636 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sat, 4 Aug 2007 01:15:33 +0000 Subject: [PATCH] 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 --- ChangeLog | 10 +++++ include/audio_device.h | 10 ++--- include/audio_dummy.h | 2 +- include/audio_file_ogg.h | 2 +- include/audio_file_wave.h | 2 +- include/audio_port.h | 2 +- include/audio_sample_recorder.h | 4 +- include/automation_track.h | 2 +- include/bb_editor.h | 2 +- include/bb_track.h | 2 +- include/effect.h | 2 +- include/effect_chain.h | 2 +- include/envelope_and_lfo_widget.h | 6 +-- include/envelope_tab_widget.h | 2 +- include/instrument_track.h | 4 +- include/mixer.h | 22 +++++----- include/oscillator.h | 28 ++++++------- include/sample_buffer.h | 2 +- include/sample_play_handle.h | 1 - include/sample_track.h | 2 +- include/sweep_oscillator.h | 4 +- include/track.h | 2 +- include/types.h | 2 +- plugins/bass_booster/bass_booster.cpp | 4 +- plugins/bass_booster/bass_booster.h | 2 +- plugins/bit_invader/bit_invader.cpp | 4 +- plugins/kicker/kicker.cpp | 7 ++-- plugins/ladspa_effect/ladspa_effect.cpp | 10 ++--- plugins/ladspa_effect/ladspa_effect.h | 4 +- plugins/lb302/lb302.cpp | 2 +- plugins/organic/organic.cpp | 2 +- plugins/patman/patman.cpp | 2 +- .../plucked_string_synth.cpp | 4 +- plugins/polyb302/polyb302.cpp | 2 +- plugins/singerbot/singerbot.cpp | 4 +- plugins/singerbot/singerbot.h | 2 +- plugins/stk/mallets/mallets.cpp | 6 +-- .../triple_oscillator/triple_oscillator.cpp | 2 +- plugins/vestige/vestige.cpp | 4 +- plugins/vibed/vibed.cpp | 4 +- plugins/vst_base/lvsl_client.cpp | 12 +++--- plugins/vst_base/lvsl_server.c | 8 ++-- plugins/vst_effect/vst_effect.cpp | 6 +-- plugins/vst_effect/vst_effect.h | 2 +- src/audio/audio_alsa.cpp | 10 ++--- src/audio/audio_device.cpp | 18 ++++----- src/audio/audio_file_ogg.cpp | 4 +- src/audio/audio_file_wave.cpp | 2 +- src/audio/audio_jack.cpp | 6 +-- src/audio/audio_oss.cpp | 8 ++-- src/audio/audio_port.cpp | 12 +++--- src/audio/audio_sample_recorder.cpp | 4 +- src/audio/audio_sdl.cpp | 8 ++-- src/core/arp_and_chords_tab_widget.cpp | 10 ++--- src/core/bb_editor.cpp | 6 +-- src/core/effect.cpp | 4 +- src/core/effect_chain.cpp | 2 +- src/core/envelope_and_lfo_widget.cpp | 20 +++++----- src/core/envelope_tab_widget.cpp | 18 ++++----- src/core/sample_play_handle.cpp | 16 ++------ src/core/song_editor.cpp | 4 +- src/lib/oscillator.cpp | 40 +++++++++---------- src/lib/sample_buffer.cpp | 2 +- src/tracks/automation_track.cpp | 2 +- src/tracks/bb_track.cpp | 8 ++-- src/widgets/rack_plugin.cpp | 2 +- src/widgets/visualization_widget.cpp | 10 ++--- 67 files changed, 215 insertions(+), 211 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c6cd7461d..35fb4d2645 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-08-04 Tobias Doerffel + + * 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 * plugins/singerbot/singerbot.h: diff --git a/include/audio_device.h b/include/audio_device.h index 2d0a3b3028..8d8a13cf39 100644 --- a/include/audio_device.h +++ b/include/audio_device.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 ); diff --git a/include/audio_dummy.h b/include/audio_dummy.h index ffcdfd4e86..bf9ec590eb 100644 --- a/include/audio_dummy.h +++ b/include/audio_dummy.h @@ -109,7 +109,7 @@ private: delete[] b; const Sint32 microseconds = static_cast( - getMixer()->framesPerAudioBuffer() * + getMixer()->framesPerPeriod() * 1000000.0f / getMixer()->sampleRate() - timer.elapsed() ); if( microseconds > 0 ) diff --git a/include/audio_file_ogg.h b/include/audio_file_ogg.h index ef88b6f8dd..398c5c2e13 100644 --- a/include/audio_file_ogg.h +++ b/include/audio_file_ogg.h @@ -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 ); diff --git a/include/audio_file_wave.h b/include/audio_file_wave.h index 7e832e1fad..9f123e835a 100644 --- a/include/audio_file_wave.h +++ b/include/audio_file_wave.h @@ -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 ); diff --git a/include/audio_port.h b/include/audio_port.h index 2ca7464cb9..3a30443ed1 100644 --- a/include/audio_port.h +++ b/include/audio_port.h @@ -109,7 +109,7 @@ private: QString m_name; effectChain * m_effects; - fpab_t m_frames; + fpp_t m_frames; } ; diff --git a/include/audio_sample_recorder.h b/include/audio_sample_recorder.h index 27201e798e..50b9c101c7 100644 --- a/include/audio_sample_recorder.h +++ b/include/audio_sample_recorder.h @@ -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 > bufferList; + typedef vlist > bufferList; bufferList m_buffers; } ; diff --git a/include/automation_track.h b/include/automation_track.h index 1101abdd76..d5c421da72 100644 --- a/include/automation_track.h +++ b/include/automation_track.h @@ -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 ); diff --git a/include/bb_editor.h b/include/bb_editor.h index 3543933af0..66e2eb0ff4 100644 --- a/include/bb_editor.h +++ b/include/bb_editor.h @@ -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 ); diff --git a/include/bb_track.h b/include/bb_track.h index 5afea00843..9b69491db7 100644 --- a/include/bb_track.h +++ b/include/bb_track.h @@ -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 & diff --git a/include/effect.h b/include/effect.h index 53236d695f..11fcb44b33 100644 --- a/include/effect.h +++ b/include/effect.h @@ -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 ) { diff --git a/include/effect_chain.h b/include/effect_chain.h index 25d8a29d18..5eb1594bdc 100644 --- a/include/effect_chain.h +++ b/include/effect_chain.h @@ -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 ); diff --git a/include/envelope_and_lfo_widget.h b/include/envelope_and_lfo_widget.h index 7eb3843744..e053d4c5fb 100644 --- a/include/envelope_and_lfo_widget.h +++ b/include/envelope_and_lfo_widget.h @@ -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 ); diff --git a/include/envelope_tab_widget.h b/include/envelope_tab_widget.h index 9c8da86e15..6a11b8638e 100644 --- a/include/envelope_tab_widget.h +++ b/include/envelope_tab_widget.h @@ -64,7 +64,7 @@ public: virtual ~envelopeTabWidget(); void FASTCALL processAudioBuffer( sampleFrame * _ab, - const fpab_t _frames, + const fpp_t _frames, notePlayHandle * _n ); enum targets diff --git a/include/instrument_track.h b/include/instrument_track.h index 385082871c..df47fb530d 100644 --- a/include/instrument_track.h +++ b/include/instrument_track.h @@ -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 diff --git a/include/mixer.h b/include/mixer.h index 843c042862..53fba8fd6f 100644 --- a/include/mixer.h +++ b/include/mixer.h @@ -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 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]; diff --git a/include/oscillator.h b/include/oscillator.h index 41707ab98a..092838766e 100644 --- a/include/oscillator.h +++ b/include/oscillator.h @@ -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 - void updateNoSub( sampleFrame * _ab, const fpab_t _frames, + void updateNoSub( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ); template - void updatePM( sampleFrame * _ab, const fpab_t _frames, + void updatePM( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ); template - void updateAM( sampleFrame * _ab, const fpab_t _frames, + void updateAM( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ); template - void updateMix( sampleFrame * _ab, const fpab_t _frames, + void updateMix( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ); template - void updateSync( sampleFrame * _ab, const fpab_t _frames, + void updateSync( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ); template - void updateFM( sampleFrame * _ab, const fpab_t _frames, + void updateFM( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ); template diff --git a/include/sample_buffer.h b/include/sample_buffer.h index b6744af397..dd033abaae 100644 --- a/include/sample_buffer.h +++ b/include/sample_buffer.h @@ -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 ); diff --git a/include/sample_play_handle.h b/include/sample_play_handle.h index b25b18e136..eb409ad1da 100644 --- a/include/sample_play_handle.h +++ b/include/sample_play_handle.h @@ -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; diff --git a/include/sample_track.h b/include/sample_track.h index dc2a6071af..bc64f14e22 100644 --- a/include/sample_track.h +++ b/include/sample_track.h @@ -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 & diff --git a/include/sweep_oscillator.h b/include/sweep_oscillator.h index db128bbce9..5adb2f47fa 100644 --- a/include/sweep_oscillator.h +++ b/include/sweep_oscillator.h @@ -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 ) diff --git a/include/track.h b/include/track.h index e2552a8a65..4ffcdc3aed 100644 --- a/include/track.h +++ b/include/track.h @@ -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; diff --git a/include/types.h b/include/types.h index 66479cf240..e689adacc2 100644 --- a/include/types.h +++ b/include/types.h @@ -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) diff --git a/plugins/bass_booster/bass_booster.cpp b/plugins/bass_booster/bass_booster.cpp index e9ae7458e5..59cbf04723 100644 --- a/plugins/bass_booster/bass_booster.cpp +++ b/plugins/bass_booster/bass_booster.cpp @@ -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] ); diff --git a/plugins/bass_booster/bass_booster.h b/plugins/bass_booster/bass_booster.h index 7f3ecadf31..7f506fbc81 100644 --- a/plugins/bass_booster/bass_booster.h +++ b/plugins/bass_booster/bass_booster.h @@ -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" ); diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index cd56df2cfd..a181e18789 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -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( _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 ) diff --git a/plugins/kicker/kicker.cpp b/plugins/kicker/kicker.cpp index 84ebe5f1a3..2b21c0a3e8 100644 --- a/plugins/kicker/kicker.cpp +++ b/plugins/kicker/kicker.cpp @@ -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( 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 ) / diff --git a/plugins/ladspa_effect/ladspa_effect.cpp b/plugins/ladspa_effect/ladspa_effect.cpp index 6265f3fde1..9f16eef2ad 100644 --- a/plugins/ladspa_effect/ladspa_effect.cpp +++ b/plugins/ladspa_effect/ladspa_effect.cpp @@ -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] = diff --git a/plugins/ladspa_effect/ladspa_effect.h b/plugins/ladspa_effect/ladspa_effect.h index 18641e0824..3faccfadae 100644 --- a/plugins/ladspa_effect/ladspa_effect.h +++ b/plugins/ladspa_effect/ladspa_effect.h @@ -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 m_handles; diff --git a/plugins/lb302/lb302.cpp b/plugins/lb302/lb302.cpp index 51a376d986..1e4a5e09c3 100644 --- a/plugins/lb302/lb302.cpp +++ b/plugins/lb302/lb302.cpp @@ -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); diff --git a/plugins/organic/organic.cpp b/plugins/organic/organic.cpp index fa0224b9ec..2451622211 100644 --- a/plugins/organic/organic.cpp +++ b/plugins/organic/organic.cpp @@ -359,7 +359,7 @@ void organicInstrument::playNote( notePlayHandle * _n, bool ) oscillator * osc_r = static_cast( _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 ); diff --git a/plugins/patman/patman.cpp b/plugins/patman/patman.cpp index 1b9da5d448..3081b1219f 100644 --- a/plugins/patman/patman.cpp +++ b/plugins/patman/patman.cpp @@ -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 ) diff --git a/plugins/plucked_string_synth/plucked_string_synth.cpp b/plugins/plucked_string_synth/plucked_string_synth.cpp index 939d564846..0e18c4a7c6 100644 --- a/plugins/plucked_string_synth/plucked_string_synth.cpp +++ b/plugins/plucked_string_synth/plucked_string_synth.cpp @@ -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( _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 ) diff --git a/plugins/polyb302/polyb302.cpp b/plugins/polyb302/polyb302.cpp index bce2f1e5ee..6c0cc09960 100644 --- a/plugins/polyb302/polyb302.cpp +++ b/plugins/polyb302/polyb302.cpp @@ -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() ); diff --git a/plugins/singerbot/singerbot.cpp b/plugins/singerbot/singerbot.cpp index 16cfb1a44a..d7a6fdf73f 100644 --- a/plugins/singerbot/singerbot.cpp +++ b/plugins/singerbot/singerbot.cpp @@ -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; diff --git a/plugins/singerbot/singerbot.h b/plugins/singerbot/singerbot.h index 58760ad6dc..bb4e878ce1 100644 --- a/plugins/singerbot/singerbot.h +++ b/plugins/singerbot/singerbot.h @@ -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 ); } ; diff --git a/plugins/stk/mallets/mallets.cpp b/plugins/stk/mallets/mallets.cpp index e34af0ce91..f2ef32b56b 100644 --- a/plugins/stk/mallets/mallets.cpp +++ b/plugins/stk/mallets/mallets.cpp @@ -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( _n->m_pluginData ); sample_t add_scale = 0.0f; @@ -450,7 +450,7 @@ void mallets::playNote( notePlayHandle * _n, bool ) add_scale = static_cast( 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 ); diff --git a/plugins/triple_oscillator/triple_oscillator.cpp b/plugins/triple_oscillator/triple_oscillator.cpp index 22965523ec..8e3dfc316b 100644 --- a/plugins/triple_oscillator/triple_oscillator.cpp +++ b/plugins/triple_oscillator/triple_oscillator.cpp @@ -686,7 +686,7 @@ void tripleOscillator::playNote( notePlayHandle * _n, bool ) oscillator * osc_r = static_cast( _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 ); diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 7054c88780..15eabdb859 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -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; } diff --git a/plugins/vibed/vibed.cpp b/plugins/vibed/vibed.cpp index f824690e66..3a0cb6494b 100644 --- a/plugins/vibed/vibed.cpp +++ b/plugins/vibed/vibed.cpp @@ -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( _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; diff --git a/plugins/vst_base/lvsl_client.cpp b/plugins/vst_base/lvsl_client.cpp index 68accffcbc..3954c944df 100644 --- a/plugins/vst_base/lvsl_client.cpp +++ b/plugins/vst_base/lvsl_client.cpp @@ -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( 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( VST_BUFFER_SIZE ); // handle is the same - writeValueS( - engine::getMixer()->framesPerAudioBuffer() ); + writeValueS( + engine::getMixer()->framesPerPeriod() ); break; case VST_SHM_KEY_AND_SIZE: diff --git a/plugins/vst_base/lvsl_server.c b/plugins/vst_base/lvsl_server.c index ed0a9f5872..db9a7a91d4 100644 --- a/plugins/vst_base/lvsl_server.c +++ b/plugins/vst_base/lvsl_server.c @@ -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() ); + plugin->setBlockSize( readValue() ); break; case VST_BPM: diff --git a/plugins/vst_effect/vst_effect.cpp b/plugins/vst_effect/vst_effect.cpp index b27800776f..ad936c3532 100644 --- a/plugins/vst_effect/vst_effect.cpp +++ b/plugins/vst_effect/vst_effect.cpp @@ -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 ) { diff --git a/plugins/vst_effect/vst_effect.h b/plugins/vst_effect/vst_effect.h index 1620ae7e87..1b27bd4f50 100644 --- a/plugins/vst_effect/vst_effect.h +++ b/plugins/vst_effect/vst_effect.h @@ -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 { diff --git a/src/audio/audio_alsa.cpp b/src/audio/audio_alsa.cpp index 052c658779..41a69874b4 100644 --- a/src/audio/audio_alsa.cpp +++ b/src/audio/audio_alsa.cpp @@ -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, diff --git a/src/audio/audio_device.cpp b/src/audio/audio_device.cpp index e0b1f68627..100a54a2aa 100644 --- a/src/audio/audio_device.cpp +++ b/src/audio/audio_device.cpp @@ -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 ); diff --git a/src/audio/audio_file_ogg.cpp b/src/audio/audio_file_ogg.cpp index 97e500384a..e4900ce499 100644 --- a/src/audio/audio_file_ogg.cpp +++ b/src/audio/audio_file_ogg.cpp @@ -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 ) { diff --git a/src/audio/audio_file_wave.cpp b/src/audio/audio_file_wave.cpp index cf324cb96b..1830b52293 100644 --- a/src/audio/audio_file_wave.cpp +++ b/src/audio/audio_file_wave.cpp @@ -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()]; diff --git a/src/audio/audio_jack.cpp b/src/audio/audio_jack.cpp index 55708eec45..1f65dc8b29 100644 --- a/src/audio/audio_jack.cpp +++ b/src/audio/audio_jack.cpp @@ -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( _nframes, - getMixer()->framesPerAudioBuffer() ); + getMixer()->framesPerPeriod() ); for( jackPortMap::iterator it = _this->m_portMap.begin(); it != _this->m_portMap.end(); ++it ) { diff --git a/src/audio/audio_oss.cpp b/src/audio/audio_oss.cpp index 2da17b9a0b..7ae9c12a3e 100644 --- a/src/audio/audio_oss.cpp +++ b/src/audio/audio_oss.cpp @@ -127,7 +127,7 @@ audioOSS::audioOSS( const sample_rate_t _sample_rate, bool & _success_ful, int frag_spec; for( frag_spec = 0; static_cast( 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; diff --git a/src/audio/audio_port.cpp b/src/audio/audio_port.cpp index 05a4af00f3..faa1b31f62 100644 --- a/src/audio/audio_port.cpp +++ b/src/audio/audio_port.cpp @@ -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 ) ? diff --git a/src/audio/audio_sample_recorder.cpp b/src/audio/audio_sample_recorder.cpp index 9d7d6f9517..cc2131988f 100644 --- a/src/audio/audio_sample_recorder.cpp +++ b/src/audio/audio_sample_recorder.cpp @@ -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 ) { diff --git a/src/audio/audio_sdl.cpp b/src/audio/audio_sdl.cpp index 209481fa36..ab58b342cb 100644 --- a/src/audio/audio_sdl.cpp +++ b/src/audio/audio_sdl.cpp @@ -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; diff --git a/src/core/arp_and_chords_tab_widget.cpp b/src/core/arp_and_chords_tab_widget.cpp index 04c2bdd44b..31edfff34b 100644 --- a/src/core/arp_and_chords_tab_widget.cpp +++ b/src/core/arp_and_chords_tab_widget.cpp @@ -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, diff --git a/src/core/bb_editor.cpp b/src/core/bb_editor.cpp index ce4d01cb42..eb7c512493 100644 --- a/src/core/bb_editor.cpp +++ b/src/core/bb_editor.cpp @@ -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; diff --git a/src/core/effect.cpp b/src/core/effect.cpp index 37b9ac3f90..75ed1244fc 100644 --- a/src/core/effect.cpp +++ b/src/core/effect.cpp @@ -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(); } diff --git a/src/core/effect_chain.cpp b/src/core/effect_chain.cpp index daead98556..f7b0311c1b 100644 --- a/src/core/effect_chain.cpp +++ b/src/core/effect_chain.cpp @@ -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 ) { diff --git a/src/core/envelope_and_lfo_widget.cpp b/src/core/envelope_and_lfo_widget.cpp index 5732af03a4..6525c3af4f 100644 --- a/src/core/envelope_and_lfo_widget.cpp +++ b/src/core/envelope_and_lfo_widget.cpp @@ -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( @@ -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 ) diff --git a/src/core/envelope_tab_widget.cpp b/src/core/envelope_tab_widget.cpp index 6776aaf400..2c1834c023 100644 --- a/src/core/envelope_tab_widget.cpp +++ b/src/core/envelope_tab_widget.cpp @@ -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; diff --git a/src/core/sample_play_handle.cpp b/src/core/sample_play_handle.cpp index aa7c65c845..fa1a4eb8db 100644 --- a/src/core/sample_play_handle.cpp +++ b/src/core/sample_play_handle.cpp @@ -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; diff --git a/src/core/song_editor.cpp b/src/core/song_editor.cpp index 414b806c1f..027d75148f 100644 --- a/src/core/song_editor.cpp +++ b/src/core/song_editor.cpp @@ -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? diff --git a/src/lib/oscillator.cpp b/src/lib/oscillator.cpp index 40a35ca0d6..9e4a284653 100644 --- a/src/lib/oscillator.cpp +++ b/src/lib/oscillator.cpp @@ -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 -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( 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 -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( 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 -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( 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 -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( 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 -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 -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( m_phase ) * m_volume; diff --git a/src/lib/sample_buffer.cpp b/src/lib/sample_buffer.cpp index ee05b427c2..a33c52f6e1 100644 --- a/src/lib/sample_buffer.cpp +++ b/src/lib/sample_buffer.cpp @@ -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 ) { diff --git a/src/tracks/automation_track.cpp b/src/tracks/automation_track.cpp index 014000f9a2..66099f1bb4 100644 --- a/src/tracks/automation_track.cpp +++ b/src/tracks/automation_track.cpp @@ -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 ) { diff --git a/src/tracks/bb_track.cpp b/src/tracks/bb_track.cpp index dba98ceb8d..27266f9ed4 100644 --- a/src/tracks/bb_track.cpp +++ b/src/tracks/bb_track.cpp @@ -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 ); diff --git a/src/widgets/rack_plugin.cpp b/src/widgets/rack_plugin.cpp index 6b7bab1378..a18bc4b98e 100644 --- a/src/widgets/rack_plugin.cpp +++ b/src/widgets/rack_plugin.cpp @@ -279,7 +279,7 @@ void rackPlugin::setAutoQuit( float _value ) { float samples = engine::getMixer()->sampleRate() * _value / 1000.0f; Uint32 buffers = 1 + ( static_cast( samples ) / - engine::getMixer()->framesPerAudioBuffer() ); + engine::getMixer()->framesPerPeriod() ); m_effect->setTimeout( buffers ); } diff --git a/src/widgets/visualization_widget.cpp b/src/widgets/visualization_widget.cpp index dc4d806e1b..283d4d1df5 100644 --- a/src/widgets/visualization_widget.cpp +++ b/src/widgets/visualization_widget.cpp @@ -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 ) {