From e2e34b6ffa05ca837174b0c32e17acc264dc3f10 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 7 Apr 2008 22:55:08 +0000 Subject: [PATCH] process FX-channels until effects signal that there's nothing more to process - closes #1935872 git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@899 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 4 ++++ src/core/fx_mixer.cpp | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ef1bc1bb6..1586559a2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-04-07 Tobias Doerffel + * src/core/fx_mixer.cpp: + process FX-channels until effects signal that there's nothing more to + process - closes #1935872 + * configure.in: integrated changes from libsamplerate-0.1.3/configure.ac diff --git a/src/core/fx_mixer.cpp b/src/core/fx_mixer.cpp index becef2eb26..2fc7e85aad 100644 --- a/src/core/fx_mixer.cpp +++ b/src/core/fx_mixer.cpp @@ -48,6 +48,7 @@ struct fxChannel fxChannel( model * _parent ) : m_fxChain( NULL ), m_used( FALSE ), + m_stillRunning( FALSE ), m_peakLeft( 0.0f ), m_peakRight( 0.0f ), m_buffer( new sampleFrame[ @@ -68,6 +69,7 @@ struct fxChannel effectChain m_fxChain; bool m_used; + bool m_stillRunning; float m_peakLeft; float m_peakRight; sampleFrame * m_buffer; @@ -124,11 +126,13 @@ void fxMixer::mixToChannel( const sampleFrame * _buf, fx_ch_t _ch ) void fxMixer::processChannel( fx_ch_t _ch ) { - if( m_fxChannels[_ch]->m_used || _ch == 0 ) + if( m_fxChannels[_ch]->m_used || m_fxChannels[_ch]->m_stillRunning || + _ch == 0 ) { const fpp_t f = engine::getMixer()->framesPerPeriod(); m_fxChannels[_ch]->m_fxChain.startRunning(); - m_fxChannels[_ch]->m_fxChain.processAudioBuffer( + m_fxChannels[_ch]->m_stillRunning = + m_fxChannels[_ch]->m_fxChain.processAudioBuffer( m_fxChannels[_ch]->m_buffer, f ); m_fxChannels[_ch]->m_peakLeft = engine::getMixer()->peakValueLeft( @@ -138,6 +142,7 @@ void fxMixer::processChannel( fx_ch_t _ch ) engine::getMixer()->peakValueRight( m_fxChannels[_ch]->m_buffer, f ) * m_fxChannels[_ch]->m_volumeModel.value(); + m_fxChannels[_ch]->m_used = TRUE; } else {