diff --git a/include/pattern.h b/include/pattern.h index 53aafa0ae..4f8b9953f 100644 --- a/include/pattern.h +++ b/include/pattern.h @@ -2,7 +2,7 @@ * pattern.h - declaration of class pattern, which contains all informations * about a pattern * - * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2004-2011 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -94,17 +94,17 @@ public: // functions which are part of freezing-feature - inline bool freezing() const + inline bool isFreezing() const { return m_freezing; } - inline bool frozen() const + inline bool isFrozen() const { return m_frozenPattern != NULL; } - sampleBuffer * frozenPattern() + sampleBuffer *frozenPattern() { return m_frozenPattern; } diff --git a/include/song.h b/include/song.h index 2624783c1..3b129714e 100644 --- a/include/song.h +++ b/include/song.h @@ -104,6 +104,8 @@ public: return m_playing && m_exporting == false; } + bool isFreezingPattern() const; + inline bool isExporting() const { return m_exporting; diff --git a/src/core/FxMixer.cpp b/src/core/FxMixer.cpp index 435991ba9..cedf2ff8f 100644 --- a/src/core/FxMixer.cpp +++ b/src/core/FxMixer.cpp @@ -3,7 +3,7 @@ /* * FxMixer.cpp - effect mixer for LMMS * - * Copyright (c) 2008 Tobias Doerffel + * Copyright (c) 2008-2011 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -119,16 +119,15 @@ void FxMixer::processChannel( fx_ch_t _ch, sampleFrame * _buf ) _buf = m_fxChannels[_ch]->m_buffer; } const fpp_t f = engine::getMixer()->framesPerPeriod(); - m_fxChannels[_ch]->m_fxChain.startRunning(); - m_fxChannels[_ch]->m_stillRunning = - m_fxChannels[_ch]->m_fxChain.processAudioBuffer( - _buf, f ); - m_fxChannels[_ch]->m_peakLeft = - engine::getMixer()->peakValueLeft( _buf, f ) * - m_fxChannels[_ch]->m_volumeModel.value(); - m_fxChannels[_ch]->m_peakRight = - engine::getMixer()->peakValueRight( _buf, f ) * - m_fxChannels[_ch]->m_volumeModel.value(); + if( !engine::getSong()->isFreezingPattern() ) + { + m_fxChannels[_ch]->m_fxChain.startRunning(); + m_fxChannels[_ch]->m_stillRunning = m_fxChannels[_ch]->m_fxChain.processAudioBuffer( _buf, f ); + m_fxChannels[_ch]->m_peakLeft = engine::getMixer()->peakValueLeft( _buf, f ) * + m_fxChannels[_ch]->m_volumeModel.value(); + m_fxChannels[_ch]->m_peakRight = engine::getMixer()->peakValueRight( _buf, f ) * + m_fxChannels[_ch]->m_volumeModel.value(); + } m_fxChannels[_ch]->m_used = true; } else diff --git a/src/core/song.cpp b/src/core/song.cpp index 4a05a49bb..8962e73e7 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -343,7 +343,7 @@ void song::processNextBuffer() bool check_loop = tl != NULL && m_exporting == false && tl->loopPointsEnabled() && !( m_playMode == Mode_PlayPattern && - m_patternToPlay->freezing() == true ); + m_patternToPlay->isFreezing() == true ); if( check_loop ) { if( m_playPos[m_playMode] < tl->loopBegin() || @@ -467,11 +467,22 @@ void song::processNextBuffer() +bool song::isFreezingPattern() const +{ + return isPlaying() && + m_playMode == Mode_PlayPattern && + m_patternToPlay != NULL && + m_patternToPlay->isFreezing(); +} + + + + bool song::realTimeTask() const { return !( m_exporting == true || ( m_playMode == Mode_PlayPattern && m_patternToPlay != NULL && - m_patternToPlay->freezing() == true ) ); + m_patternToPlay->isFreezing() == true ) ); } diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 95c925c16..f7dd7852c 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -613,7 +613,7 @@ bool InstrumentTrack::play( const midiTime & _start, { cur_start -= p->startPosition(); } - if( p->frozen() && !engine::getSong()->isExporting() ) + if( p->isFrozen() && !engine::getSong()->isExporting() ) { if( cur_start > 0 ) {