aboutsummaryrefslogtreecommitdiff
path: root/lib/decoder.h
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2007-08-20 12:23:35 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2007-08-20 12:23:35 +0000
commitbc2f300631757a3eaf637203ee3f85d804ea1628 (patch)
tree701e22ba98da72f75a6bcacfe101b51ed2b10734 /lib/decoder.h
parent3df482395b31866da7b91a25360ef952ec0a90aa (diff)
downloadqmmp-bc2f300631757a3eaf637203ee3f85d804ea1628.tar.gz
qmmp-bc2f300631757a3eaf637203ee3f85d804ea1628.tar.bz2
qmmp-bc2f300631757a3eaf637203ee3f85d804ea1628.zip
added metadata update support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@103 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'lib/decoder.h')
-rw-r--r--lib/decoder.h46
1 files changed, 37 insertions, 9 deletions
diff --git a/lib/decoder.h b/lib/decoder.h
index 2246b706f..0aa1f7a5d 100644
--- a/lib/decoder.h
+++ b/lib/decoder.h
@@ -32,26 +32,45 @@ class Visualization;
class DecoderState
{
public:
- enum Type { Decoding, Stopped, Finished, Error };
+ enum Type { Decoding, Stopped, Finished, Info, Error };
+
+ DecoderState(const DecoderState &st)
+ : m_error_msg(0), m_tag(0)
+ {
+ m_type = st.type();
+ if (m_type == Info)
+ m_tag = new FileTag(*st.tag());
+ if (m_type == Error)
+ m_error_msg = new QString(*st.errorMessage());
+ }
+
DecoderState(Type t)
- : m_type(t), m_error_msg(0)
+ : m_type(t), m_error_msg(0), m_tag(0)
{}
DecoderState(const QString &e)
- : m_type(Error)
+ : m_type(Error), m_tag(0)
{
m_error_msg = new QString(e);
}
DecoderState()
- : m_type(Stopped), m_error_msg(0)
+ : m_type(Stopped), m_error_msg(0), m_tag(0)
{}
+ DecoderState(const FileTag &tag)
+ : m_type(Info), m_error_msg(0), m_tag(0)
+ {
+ m_tag = new FileTag(tag);
+ }
+
~DecoderState()
{
if (m_error_msg)
- delete m_error_msg;
+ delete m_error_msg;
+ if (m_tag)
+ delete m_tag;
}
const QString *errorMessage() const
@@ -62,20 +81,25 @@ public:
{
return m_type;
}
+ const FileTag *tag() const
+ {
+ return m_tag;
+ }
private:
Type m_type;
const QString *m_error_msg;
+ FileTag *m_tag;
};
class Decoder : public QThread
{
-Q_OBJECT
+ Q_OBJECT
public:
- Decoder(QObject *parent, DecoderFactory *d,
- QIODevice *i, Output *o);
+ Decoder(QObject *parent, DecoderFactory *d,
+ QIODevice *i, Output *o);
virtual ~Decoder();
// Standard Decoder API
@@ -118,7 +142,10 @@ public:
}
ulong produceSound(char *data, ulong output_bytes, ulong bitrate, int nch);
void setEQ(int bands[10], int preamp);
- void setEQEnabled(bool on) { m_useEQ = on; };
+ void setEQEnabled(bool on)
+ {
+ m_useEQ = on;
+ };
// static methods
static QStringList all();
@@ -140,6 +167,7 @@ signals:
protected:
void dispatch(DecoderState::Type);
void dispatch(const DecoderState&);
+ void dispatch(const FileTag&);
void error(const QString&);
private: