[general] "poor programming style" fix
[libxmms2client-qt.git] / playlist.h
blob7a711edd1f8e26247ac33a71a2d2db0c1a1e3b49
1 //
2 // C++ Interface: playlist
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_PLAYLIST_H
9 #define XMMSQT_PLAYLIST_H
11 #include <QObject>
12 #include <QStringList>
13 #include <xmmsclient/xmmsclient.h>
15 namespace XmmsQt {
16 class QClient;
17 class QMedialib;
19 class QPlaylist : public QObject {
20 Q_OBJECT
21 friend class QMedialib;
22 private:
23 QString m_Identifier;
24 xmmsc_connection_t * m_Connection;
25 QList<quint32> m_IDList;
26 quint32 m_Position;
28 static void fillIDListCallback(xmmsc_result_t * result, void * instance);
29 static void changedCallback(xmmsc_result_t * result, void * instance);
30 static void currentPosCallback(xmmsc_result_t * result, void * instance);
32 inline const char * identifierToCString();
33 private slots:
34 void setConnection(xmmsc_connection_t * connection);
35 public:
36 QPlaylist(QClient * parent, QString identifier = QString());
37 ~QPlaylist();
39 xmmsc_connection_t * connection() const { return m_Connection; }
40 QList<quint32> & idList() { return m_IDList; }
41 quint32 position() const { return m_Position; }
42 QString identifier() const { return m_Identifier; }
44 void reset();
45 public slots:
46 void append(quint32 id);
47 void append(QString url);
48 void append(QList<quint32> ids);
49 void append(QStringList urls);
50 void appendRecursive(QString directory);
51 void insert(quint32 id, quint32 position);
52 void insert(QString url, quint32 position);
53 void insert(QList<quint32> ids, quint32 position);
54 void insert(QStringList urls, quint32 position);
55 void remove(quint32 position);
56 void move(quint32 from, quint32 to);
57 void clear();
58 void sort(QStringList properties);
59 void randomize();
60 signals:
61 void entryAboutToBeInserted(quint32 position, quint32 id);
62 void entryAboutToBeRemoved(quint32 position, quint32 id);
63 void entryInserted(quint32 position);
64 void entryRemoved(quint32 position);
65 void entryMoved(quint32 from, quint32 to);
66 void entryUpdated(quint32 position, quint32 oldid);
67 void reseted();
68 void positionChanged(quint32 position);
72 #endif