diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2007-07-08 07:52:39 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2007-07-08 07:52:39 +0000 |
| commit | e25633e957fd32bce67bcf589a5657eeaf6ad3ca (patch) | |
| tree | c96d90d0372c6fe6700be90f4e4bf3d4ddc74bb2 /lib/soundcore.cpp | |
| parent | 296db6bd740c8aa0a2c4536449589c1019bca5db (diff) | |
| download | qmmp-e25633e957fd32bce67bcf589a5657eeaf6ad3ca.tar.gz qmmp-e25633e957fd32bce67bcf589a5657eeaf6ad3ca.tar.bz2 qmmp-e25633e957fd32bce67bcf589a5657eeaf6ad3ca.zip | |
added stream reading support (for testing only)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@23 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'lib/soundcore.cpp')
| -rw-r--r-- | lib/soundcore.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/soundcore.cpp b/lib/soundcore.cpp index a0716afe8..4f295d133 100644 --- a/lib/soundcore.cpp +++ b/lib/soundcore.cpp @@ -24,6 +24,7 @@ #include "decoderfactory.h" #include "constants.h" +#include "streamreader.h" #include "soundcore.h" @@ -71,7 +72,13 @@ bool SoundCore::play(const QString &source) m_error = DecoderError; return FALSE; } - m_input = new QFile(source); + if(source.left(4) == "http") + { + m_input = new StreamReader(source, this); + //m_input->open(QIODevice::ReadOnly); + } + else + m_input = new QFile(source); m_error = OutputError; if (!m_output) @@ -96,10 +103,6 @@ bool SoundCore::play(const QString &source) m_output->addVisual(m_vis); } - //if (m_decoder && ! m_decoder->factory()->supports(source)) - // m_decoder = 0; - - if (! m_decoder) { qDebug ("SoundCore: creating decoder"); @@ -119,14 +122,17 @@ bool SoundCore::play(const QString &source) setEQ(m_bands, m_preamp); setEQEnabled(m_useEQ); } + qDebug("Decoder create OK"); if (m_decoder->initialize()) { m_output->start(); m_decoder->start(); m_error = NoError; + return TRUE; } + qDebug("12345678"); stop(); return FALSE; } @@ -178,17 +184,18 @@ void SoundCore::stop() { m_output->uninitialize(); } - if (m_input) - { - delete m_input; - m_input = 0; - } + //display->setTime(0); if (m_decoder) { delete m_decoder; m_decoder = 0; } + if (m_input) + { + delete m_input; + m_input = 0; + } // recreate output if (m_update && m_output) { |
