diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2007-08-13 15:37:23 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2007-08-13 15:37:23 +0000 |
| commit | 09955287c7d444e00b9aa0948abee58560b3d1a6 (patch) | |
| tree | 880a9c087367829976bfee03da3885c8503c76b4 | |
| parent | e211db2f8333d3ae6bf8a239ef3b3fd6802a3205 (diff) | |
| download | qmmp-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
| -rw-r--r-- | lib/soundcore.cpp | 7 | ||||
| -rw-r--r-- | lib/soundcore.h | 1 |
2 files changed, 8 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()) { diff --git a/lib/soundcore.h b/lib/soundcore.h index 1f88fe691..7e9d7369f 100644 --- a/lib/soundcore.h +++ b/lib/soundcore.h @@ -158,6 +158,7 @@ private: bool m_paused; bool m_useEQ; bool m_update; + bool m_block; int m_preamp; int m_bands[10]; Visualization *m_vis; |
