aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Effect
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/Effect')
-rw-r--r--src/plugins/Effect/crossfade/crossfadeplugin.cpp10
-rw-r--r--src/plugins/Effect/crossfade/crossfadeplugin.h1
2 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/Effect/crossfade/crossfadeplugin.cpp b/src/plugins/Effect/crossfade/crossfadeplugin.cpp
index b937dd51b..a50df9b2b 100644
--- a/src/plugins/Effect/crossfade/crossfadeplugin.cpp
+++ b/src/plugins/Effect/crossfade/crossfadeplugin.cpp
@@ -50,9 +50,15 @@ void CrossfadePlugin::applyEffect(Buffer *b)
if(m_core->totalTime() - m_handler->elapsed() < m_overlap + 2000)
{
StateHandler::instance()->sendNextTrackRequest();
- m_state = PREPARING;
+ m_state = CHECKING;
}
return;
+ case CHECKING:
+ //next source has been received and current engine will be used to play it
+ if(m_handler->nextEngine() == m_handler->currentEngine())
+ m_state = PREPARING;
+ else
+ return;
case PREPARING:
if(m_core->totalTime() - m_handler->elapsed() < m_overlap)
{
@@ -92,7 +98,5 @@ void CrossfadePlugin::applyEffect(Buffer *b)
void CrossfadePlugin::configure(quint32 freq, int chan, Qmmp::AudioFormat format)
{
- //m_buffer_size = m_overlap * freq * chan * AudioParameters::sampleSize(format) / 1000;
- //m_buffer =(uchar *) malloc(m_buffer_size);
Effect::configure(freq, chan, format);
}
diff --git a/src/plugins/Effect/crossfade/crossfadeplugin.h b/src/plugins/Effect/crossfade/crossfadeplugin.h
index ec025aded..968405923 100644
--- a/src/plugins/Effect/crossfade/crossfadeplugin.h
+++ b/src/plugins/Effect/crossfade/crossfadeplugin.h
@@ -44,6 +44,7 @@ private:
enum State
{
WAITING = 0,
+ CHECKING,
PREPARING,
PROCESSING,
};