TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
qmmpevents_p.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2011-2024 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 "trackinfo.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_TRACK_INFO_CHANGED (QEvent::Type(QEvent::User + 3))
33 #define EVENT_STREAM_INFO_CHANGED (QEvent::Type(QEvent::User + 4))
38 class QMMP_EXPORT StateChangedEvent : public QEvent
39 {
40 public:
41  StateChangedEvent(Qmmp::State currentState, Qmmp::State previousState);
42  virtual ~StateChangedEvent() = default;
43 
44  Qmmp::State currentState() const;
45  Qmmp::State previousState() const;
46 
47 private:
50 
51 };
52 
56 class QMMP_EXPORT StreamInfoChangedEvent : public QEvent
57 {
58 public:
59  explicit StreamInfoChangedEvent(const QHash<QString, QString> &info);
60  virtual ~StreamInfoChangedEvent() = default;
61 
65  QHash<QString, QString> streamInfo() const;
66 
67 private:
68  QHash<QString, QString> m_streamInfo;
69 
70 };
71 
75 class QMMP_EXPORT TrackInfoEvent : public QEvent
76 {
77 public:
78  explicit TrackInfoEvent(const TrackInfo &info);
79  virtual ~TrackInfoEvent() = default;
80 
81  const TrackInfo &trackInfo() const;
82 
83 private:
85 
86 };
87 
88 #endif
The TrackInfo class stores metadata and other information about track.
Definition: trackinfo.h:32
QHash< QString, QString > m_streamInfo
Definition: qmmpevents_p.h:68
State
Definition: qmmp.h:76
Qmmp::State m_prevState
Definition: qmmpevents_p.h:49
#define QMMP_EXPORT
Definition: qmmp_export.h:29
Qmmp::State m_state
Definition: qmmpevents_p.h:48
TrackInfo m_info
Definition: qmmpevents_p.h:84