[general] "poor programming style" fix
[libxmms2client-qt.git] / client.h
blobe35fe96958eb70e06147ff03d60e7f94f4653c54
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 static void outputCheck(int i, void * instance);
33 private slots:
34 void handleIn(int socket);
35 void handleOut(int socket);
36 public:
37 QClient(QString name, QObject * parent = 0);
38 ~QClient();
40 /* QPlayback * playback() { return &m_Playback; }
41 QPlaylist * playlist() { return &m_Playlist; }*/
43 void connectToServer(QString ipcPath = QString());
44 bool isConnectedToServer() const;
46 void quitServer();
48 QString lastError() const;
49 inline xmmsc_connection_t * connection() const { return m_Connection; }
51 // friend void disconnectCallbackHelper(void *);
52 signals:
53 void connectionChanged(xmmsc_connection_t * connection);
57 #endif