diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-10-25 13:14:34 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-10-25 13:14:34 +0000 |
| commit | 7d6dc0517fe4979c59116d9a4956b18223437316 (patch) | |
| tree | d64b1b945551fba3b958517c148a32d4fc2634c0 | |
| parent | 06693a671878f53a61a3216eae0dbbd62224ebff (diff) | |
| download | qmmp-7d6dc0517fe4979c59116d9a4956b18223437316.tar.gz qmmp-7d6dc0517fe4979c59116d9a4956b18223437316.tar.bz2 qmmp-7d6dc0517fe4979c59116d9a4956b18223437316.zip | |
cue plugin: equalizer support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@598 90c681e8-e032-0410-971d-27865f9a5e38
| -rw-r--r-- | src/plugins/Input/cue/decoder_cue.cpp | 32 | ||||
| -rw-r--r-- | src/plugins/Input/cue/decoder_cue.h | 8 | ||||
| -rw-r--r-- | src/qmmp/decoder.h | 4 |
3 files changed, 41 insertions, 3 deletions
diff --git a/src/plugins/Input/cue/decoder_cue.cpp b/src/plugins/Input/cue/decoder_cue.cpp index 8e570e478..70bd81e48 100644 --- a/src/plugins/Input/cue/decoder_cue.cpp +++ b/src/plugins/Input/cue/decoder_cue.cpp @@ -39,6 +39,10 @@ DecoderCUE::DecoderCUE(QObject *parent, DecoderFactory *d, const QString &url) m_decoder = 0; m_output2 = 0; m_input2 = 0; + for (int i = 1; i < 10; ++i) + m_bands2[i] = 0; + m_preamp2 = 0; + m_useEQ2 = FALSE; } DecoderCUE::~DecoderCUE() @@ -98,6 +102,8 @@ bool DecoderCUE::initialize() m_length = parser.length(track); m_offset = parser.offset(track); m_decoder = df->create(this, m_input2, m_output2, path); + m_decoder->setEQ(m_bands2, m_preamp2); + m_decoder->setEQEnabled(m_useEQ2); CUEStateHandler *csh = new CUEStateHandler(this, m_offset, m_length); m_decoder->setStateHandler(csh); connect(csh, SIGNAL(finished()), SLOT(finish())); @@ -214,6 +220,32 @@ void DecoderCUE::pause() } } +void DecoderCUE::setEQ(int bands[10], int preamp) +{ + for (int i = 0; i < 10; ++i) + m_bands2[i] = bands[i]; + m_preamp2 = preamp; + if (m_decoder) + { + m_decoder->mutex()->lock (); + m_decoder->setEQ(m_bands2, m_preamp2); + m_decoder->setEQEnabled(m_useEQ2); + m_decoder->mutex()->unlock(); + } +} + +void DecoderCUE::setEQEnabled(bool on) +{ + m_useEQ2 = on; + if (m_decoder) + { + m_decoder->mutex()->lock (); + m_decoder->setEQ(m_bands2, m_preamp2); + m_decoder->setEQEnabled(on); + m_decoder->mutex()->unlock(); + } +} + void DecoderCUE::run() { m_decoder->start(); diff --git a/src/plugins/Input/cue/decoder_cue.h b/src/plugins/Input/cue/decoder_cue.h index d69e838a5..2b1904f4a 100644 --- a/src/plugins/Input/cue/decoder_cue.h +++ b/src/plugins/Input/cue/decoder_cue.h @@ -42,6 +42,10 @@ public: void stop(); void pause(); + // Equalizer + void setEQ(int bands[10], int preamp); + void setEQEnabled(bool on); + private: // thread run function void run(); @@ -51,6 +55,9 @@ private: QIODevice *m_input2; qint64 m_length; qint64 m_offset; + int m_preamp2; + int m_bands2[10]; + bool m_useEQ2; }; class CUEStateHandler : public StateHandler @@ -77,7 +84,6 @@ signals: private: qint64 m_length2; qint64 m_offset; - }; #endif // DECODER_CUE_H diff --git a/src/qmmp/decoder.h b/src/qmmp/decoder.h index 027d4f1d4..479b87ef6 100644 --- a/src/qmmp/decoder.h +++ b/src/qmmp/decoder.h @@ -55,8 +55,8 @@ public: StateHandler *stateHandler(); void setStateHandler(StateHandler *handler); - void setEQ(int bands[10], int preamp); - void setEQEnabled(bool on); + virtual void setEQ(int bands[10], int preamp); + virtual void setEQEnabled(bool on); // static methods static QStringList all(); |
