Qmmp
Loading...
Searching...
No Matches
qmmpevents_p.h
1/***************************************************************************
2 * Copyright (C) 2011-2022 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#include "qmmp.h"
29
30#define EVENT_STATE_CHANGED (QEvent::Type(QEvent::User))
31#define EVENT_NEXT_TRACK_REQUEST (QEvent::Type(QEvent::User + 1))
32#define EVENT_FINISHED (QEvent::Type(QEvent::User + 2))
33#define EVENT_TRACK_INFO_CHANGED (QEvent::Type(QEvent::User + 3))
34#define EVENT_STREAM_INFO_CHANGED (QEvent::Type(QEvent::User + 4))
39class StateChangedEvent : public QEvent
40{
41public:
42 StateChangedEvent(Qmmp::State currentState, Qmmp::State previousState);
43 virtual ~StateChangedEvent();
44
45 Qmmp::State currentState() const;
46 Qmmp::State previousState() const;
47
48private:
49 Qmmp::State m_state;
50 Qmmp::State m_prevState;
51
52};
53
57class StreamInfoChangedEvent : public QEvent
58{
59public:
60 StreamInfoChangedEvent(const QHash<QString, QString> &info);
61 virtual ~StreamInfoChangedEvent();
65 const QHash <QString, QString> &streamInfo() const;
66
67private:
68 QHash<QString, QString> m_streamInfo;
69};
70
74class TrackInfoEvent : public QEvent
75{
76public:
77 TrackInfoEvent(const TrackInfo &info);
78 virtual ~TrackInfoEvent();
79
80 const TrackInfo &trackInfo() const;
81
82private:
83 TrackInfo m_info;
84};
85
86#endif // QMMPEVENTS_P_H
State
Definition qmmp.h:62
The TrackInfo class stores metadata and other information about track.
Definition trackinfo.h:32