Initial commit with basic xmms2 support (untested)
[libxmms2client-qt.git] / client.h
blob194281876f3c3c686119c1b3ee12af5220388fed
1 //
2 // C++ Interface: client
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_CLIENT_H
9 #define XMMSQT_CLIENT_H
11 #include <QObject>
12 #include <QSocketNotifier>
13 #include <xmmsclient/xmmsclient.h>
14 #include "playback.h"
15 #include "playlist.h"
17 namespace XmmsQt {
18 class QClient : public QObject {
19 Q_OBJECT
20 private:
21 QString m_Name;
22 bool m_Connected;
23 xmmsc_connection_t * m_Connection;
25 QSocketNotifier * m_ReadNotifier;
26 QSocketNotifier * m_WriteNotifier;
28 QPlayback m_Playback;
29 QPlaylist m_Playlist;
31 static void disconnectCallbackHandler(void * instance);
32 private slots:
33 void handleIn(int socket);
34 void handleOut(int socket);
35 public:
36 QClient(QString name, QObject * parent = 0);
37 ~QClient();
39 QPlayback & playback() { return m_Playback; }
40 QPlaylist & playlist() { return m_Playlist; }
42 void connectToServer(QString ipcPath = QString());
43 bool isConnectedToServer() const;
45 void quitServer();
47 QString lastError() const;
48 inline xmmsc_connection_t * connection() const { return m_Connection; }
50 // friend void disconnectCallbackHelper(void *);
51 signals:
52 void connectionChanged(xmmsc_connection_t * connection);
56 #endif