Qmmp
qmmpevents_p.h
1 /***************************************************************************
2  * Copyright (C) 2011-2012 by Ilya Kotov *
3  * forkotov02@ya.ru *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 
21 #ifndef QMMPEVENTS_P_H
22 #define QMMPEVENTS_P_H
23 
24 #include <QMap>
25 #include <QHash>
26 #include <QEvent>
27 #include "qmmp.h"
28 
29 #define EVENT_STATE_CHANGED (QEvent::Type(QEvent::User))
30 #define EVENT_NEXT_TRACK_REQUEST (QEvent::Type(QEvent::User + 1))
31 #define EVENT_FINISHED (QEvent::Type(QEvent::User + 2))
32 #define EVENT_METADATA_CHANGED (QEvent::Type(QEvent::User + 3))
33 #define EVENT_STREAM_INFO_CHANGED (QEvent::Type(QEvent::User + 4))
38 class StateChangedEvent : public QEvent
39 {
40 public:
41  StateChangedEvent(Qmmp::State currentState, Qmmp::State previousState);
42  virtual ~StateChangedEvent();
43 
44  Qmmp::State currentState() const;
45  Qmmp::State previousState() const;
46 
47 private:
48  Qmmp::State m_state;
49  Qmmp::State m_prevState;
50 
51 };
52 
56 class MetaDataChangedEvent : public QEvent
57 {
58 public:
59  MetaDataChangedEvent(const QMap<Qmmp::MetaData, QString> &metaData);
60  virtual ~MetaDataChangedEvent();
64  QMap <Qmmp::MetaData, QString> metaData() const;
68  QString metaData(Qmmp::MetaData key) const;
69 
70 private:
71  QMap<Qmmp::MetaData, QString> m_metaData;
72 };
73 
77 class StreamInfoChangedEvent : public QEvent
78 {
79 public:
80  StreamInfoChangedEvent(const QHash<QString, QString> &info);
81  virtual ~StreamInfoChangedEvent();
85  QHash <QString, QString> streamInfo() const;
86 
87 private:
88  QHash<QString, QString> m_streamInfo;
89 };
90 
91 #endif // QMMPEVENTS_P_H
State
Definition: qmmp.h:51
MetaData
Definition: qmmp.h:63