00001 #ifndef LCDSERVER_H_
00002 #define LCDSERVER_H_
00003
00004
00005
00006
00007
00008
00009
00010 #include <QStringList>
00011 #include <QObject>
00012 #include <QTcpSocket>
00013
00014 #include "serverpool.h"
00015 #include "lcdprocclient.h"
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 extern int debug_level;
00026
00027 class LCDServer : public QObject
00028 {
00029
00030 Q_OBJECT
00031
00032 public:
00033
00034 LCDServer(int port, QString message, int messageTime);
00035
00036 void sendKeyPress(QString key_pressed);
00037
00038 signals:
00039
00040 private slots:
00041
00042 void newConnection(QTcpSocket *socket);
00043 void endConnection(void);
00044 void readSocket();
00045 QStringList parseCommand(QString &command);
00046 void parseTokens(const QStringList &tokens, QTcpSocket *socket);
00047 void shutDown();
00048 void sendMessage(QTcpSocket *where, const QString &what);
00049 void sendConnected(QTcpSocket *socket);
00050 void switchToTime(QTcpSocket *socket);
00051 void switchToMusic(const QStringList &tokens, QTcpSocket *socket);
00052 void switchToGeneric(const QStringList &tokens, QTcpSocket *socket);
00053 void switchToChannel(const QStringList &tokens, QTcpSocket *socket);
00054 void switchToVolume(const QStringList &tokens, QTcpSocket *socket);
00055 void switchToNothing(QTcpSocket *socket);
00056 void switchToMenu(const QStringList &tokens, QTcpSocket *socket);
00057 void setChannelProgress(const QStringList &tokens, QTcpSocket *socket);
00058 void setMusicProgress(const QStringList &tokens, QTcpSocket *socket);
00059 void setMusicProp(const QStringList &tokens, QTcpSocket *socket);
00060 void setGenericProgress(const QStringList &tokens, QTcpSocket *socket);
00061 void setVolumeLevel(const QStringList &tokens, QTcpSocket *socket);
00062 void updateLEDs(const QStringList &tokens, QTcpSocket *socket);
00063
00064 private:
00065
00066 LCDProcClient *m_lcd;
00067 ServerPool *m_serverPool;
00068 QTcpSocket *m_lastSocket;
00069
00070 };
00071
00072 #endif
00073