[general] "poor programming style" fix
[libxmms2client-qt.git] / playback.h
blob427eb20718622fcda1e86c539773ab85a0891f83
1 //
2 // C++ Interface: playback
3 //
4 // Author: Oliver Groß <z.o.gross@gmx.de>, (C) 2008
5 //
6 // Copyright: See COPYING file that comes with this distribution
7 //
8 #ifndef XMMSQT_PLAYBACK_H
9 #define XMMSQT_PLAYBACK_H
11 #include <QObject>
12 #include <QHash>
13 #include <xmmsclient/xmmsclient.h>
15 namespace XmmsQt {
16 class QClient;
18 class QPlayback : public QObject {
19 Q_OBJECT
20 private:
21 xmmsc_connection_t * m_Connection;
22 QHash<QString, quint8> m_Volume;
23 xmms_playback_status_t m_Status;
24 quint32 m_CurrentID;
26 static void setVolumeChannel(const void * key, xmmsc_result_value_type_t, const void * value, void * instance);
28 static void volumeCallback(xmmsc_result_t * result, void * instance);
29 static void statusCallback(xmmsc_result_t * result, void * instance);
30 static void idCallback(xmmsc_result_t * result, void * instance);
31 static void playTimeCallback(xmmsc_result_t * result, void * instance);
32 public:
33 QPlayback(QClient * parent);
34 ~QPlayback();
36 xmms_playback_status_t status() { return m_Status; }
37 quint32 currentID() const { return m_CurrentID; }
38 const QHash<QString, quint8> & volume() { return m_Volume; }
40 void reset();
41 public slots:
42 void setConnection(xmmsc_connection_t * connection);
43 void start();
44 void pause();
45 void stop();
46 void tickle();
47 void setVolume(int volume, QString channel = QString());
48 void setNext(quint32 position);
49 void setPlayTime(int time);
50 signals:
51 void playTimeChanged(quint32 time);
52 void volumeChanged();
53 void statusChanged(xmms_playback_status_t status);
54 void idChanged(quint32 id);
58 #endif