MythTV  master
lcdserver.h
Go to the documentation of this file.
1 #ifndef LCDSERVER_H_
2 #define LCDSERVER_H_
3 /*
4  lcdserver.h
5 
6  Headers for the core lcdserver object
7 
8 */
9 
10 #include <QStringList>
11 #include <QObject>
12 #include <QTcpSocket>
13 
14 #include "serverpool.h"
15 #include "lcdprocclient.h"
16 
17 /*
18  control how much debug info we get
19  0 = none
20  1 = LCDServer info & LCDd info
21  2 = screen switch info
22  10 = every command sent and error received
23 */
24 
25 extern int debug_level;
26 
27 class LCDServer : public QObject
28 {
29 
30  Q_OBJECT
31 
32  public:
33 
34  LCDServer(int port, QString message, int messageTime);
35 
36  void sendKeyPress(const QString& key_pressed);
37 
38  signals:
39 
40  private slots:
41 
42  void newConnection(QTcpSocket *socket);
43  void endConnection(void);
44  void readSocket();
45  static QStringList parseCommand(QString &command);
46  void parseTokens(const QStringList &tokens, QTcpSocket *socket);
47  void shutDown();
48  static void sendMessage(QTcpSocket *where, const QString &what);
49  void sendConnected(QTcpSocket *socket);
50  void switchToTime(QTcpSocket *socket);
51  void switchToMusic(const QStringList &tokens, QTcpSocket *socket);
52  void switchToGeneric(const QStringList &tokens, QTcpSocket *socket);
53  void switchToChannel(const QStringList &tokens, QTcpSocket *socket);
54  void switchToVolume(const QStringList &tokens, QTcpSocket *socket);
55  void switchToNothing(QTcpSocket *socket);
56  void switchToMenu(const QStringList &tokens, QTcpSocket *socket);
57  void setChannelProgress(const QStringList &tokens, QTcpSocket *socket);
58  void setMusicProgress(const QStringList &tokens, QTcpSocket *socket);
59  void setMusicProp(const QStringList &tokens, QTcpSocket *socket);
60  void setGenericProgress(const QStringList &tokens, QTcpSocket *socket);
61  void setVolumeLevel(const QStringList &tokens, QTcpSocket *socket);
62  void updateLEDs(const QStringList &tokens, QTcpSocket *socket);
63 
64  private:
65 
68  QTcpSocket *m_lastSocket; // last socket we received data from
69 
70 };
71 
72 #endif
73 
static void sendMessage(QTcpSocket *where, const QString &what)
Definition: lcdserver.cpp:286
unsigned int slots[4]
Definition: element.c:38
QTcpSocket * m_lastSocket
Definition: lcdserver.h:68
void switchToTime(QTcpSocket *socket)
Definition: lcdserver.cpp:323
void switchToChannel(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:426
LCDServer(int port, QString message, int messageTime)
Definition: lcdserver.cpp:79
void newConnection(QTcpSocket *socket)
Definition: lcdserver.cpp:106
static QStringList parseCommand(QString &command)
Definition: lcdserver.cpp:154
void setChannelProgress(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:581
void setMusicProp(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:686
void readSocket()
Definition: lcdserver.cpp:135
void switchToMusic(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:334
ServerPool * m_serverPool
Definition: lcdserver.h:67
void switchToNothing(QTcpSocket *socket)
Definition: lcdserver.cpp:468
void switchToMenu(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:479
void setGenericProgress(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:613
LCDProcClient * m_lcd
Definition: lcdserver.h:66
Manages a collection of sockets listening on different ports.
Definition: serverpool.h:59
void setMusicProgress(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:654
void switchToVolume(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:447
void switchToGeneric(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:355
void sendConnected(QTcpSocket *socket)
Definition: lcdserver.cpp:304
void endConnection(void)
Definition: lcdserver.cpp:120
void updateLEDs(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:790
void shutDown()
Definition: lcdserver.cpp:273
void setVolumeLevel(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:758
void parseTokens(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:182
void sendKeyPress(const QString &key_pressed)
Definition: lcdserver.cpp:294
int debug_level
Definition: lcdserver.cpp:73