aboutsummaryrefslogtreecommitdiff
path: root/lib/soundcore.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2007-08-13 15:37:23 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2007-08-13 15:37:23 +0000
commit09955287c7d444e00b9aa0948abee58560b3d1a6 (patch)
tree880a9c087367829976bfee03da3885c8503c76b4 /lib/soundcore.cpp
parente211db2f8333d3ae6bf8a239ef3b3fd6802a3205 (diff)
downloadqmmp-09955287c7d444e00b9aa0948abee58560b3d1a6.tar.gz
qmmp-09955287c7d444e00b9aa0948abee58560b3d1a6.tar.bz2
qmmp-09955287c7d444e00b9aa0948abee58560b3d1a6.zip
added stop function blocking while connecting
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@85 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'lib/soundcore.cpp')
-rw-r--r--lib/soundcore.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/soundcore.cpp b/lib/soundcore.cpp
index 69424bb70..2ccef2ed7 100644
--- a/lib/soundcore.cpp
+++ b/lib/soundcore.cpp
@@ -37,6 +37,7 @@ SoundCore::SoundCore(QObject *parent)
m_paused = FALSE;
m_useEQ = FALSE;
m_update = FALSE;
+ m_block = FALSE;
m_preamp = 0;
m_vis = 0;
for (int i = 1; i < 10; ++i)
@@ -104,12 +105,14 @@ bool SoundCore::play(const QString &source)
if (! m_decoder)
{
+ m_block = TRUE;
qDebug ("SoundCore: creating decoder");
m_decoder = Decoder::create(this, source, m_input, m_output);
if (! m_decoder)
{
qWarning("SoundCore: unsupported fileformat");
+ m_block = FALSE;
stop();
emit decoderStateChanged(DecoderState(DecoderState::Error));
return FALSE;
@@ -128,9 +131,11 @@ bool SoundCore::play(const QString &source)
m_output->start();
m_decoder->start();
m_error = NoError;
+ m_block = FALSE;
return TRUE;
}
stop();
+ m_block = FALSE;
return FALSE;
}
@@ -141,6 +146,8 @@ uint SoundCore::error()
void SoundCore::stop()
{
+ if(m_block)
+ return;
m_paused = FALSE;
if (m_decoder && m_decoder->isRunning())
{