Do not apply FX mixer effects twice when playing frozen pattern

We must not process the FX mixer if we notice that currently a pattern
is frozen. Furthermore renamed some state-reading messages of the
pattern class.

Closes #3316495.
This commit is contained in:
Tobias Doerffel
2011-06-27 20:23:01 +02:00
parent d4684f3ab1
commit 1cc77b72e3
5 changed files with 30 additions and 18 deletions

View File

@@ -2,7 +2,7 @@
* pattern.h - declaration of class pattern, which contains all informations
* about a pattern
*
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2011 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* 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;
}

View File

@@ -104,6 +104,8 @@ public:
return m_playing && m_exporting == false;
}
bool isFreezingPattern() const;
inline bool isExporting() const
{
return m_exporting;

View File

@@ -3,7 +3,7 @@
/*
* FxMixer.cpp - effect mixer for LMMS
*
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2008-2011 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* 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

View File

@@ -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 ) );
}

View File

@@ -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 )
{