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 
LCDServer::shutDown
void shutDown()
Definition: lcdserver.cpp:273
LCDServer::setMusicProp
void setMusicProp(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:686
LCDServer::m_lastSocket
QTcpSocket * m_lastSocket
Definition: lcdserver.h:68
LCDServer::sendKeyPress
void sendKeyPress(const QString &key_pressed)
Definition: lcdserver.cpp:294
ServerPool
Manages a collection of sockets listening on different ports.
Definition: serverpool.h:59
LCDServer::updateLEDs
void updateLEDs(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:790
LCDServer::setChannelProgress
void setChannelProgress(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:581
LCDServer::parseCommand
static QStringList parseCommand(QString &command)
Definition: lcdserver.cpp:154
slots
unsigned int slots[4]
Definition: element.cpp:38
LCDServer::parseTokens
void parseTokens(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:182
LCDServer::sendConnected
void sendConnected(QTcpSocket *socket)
Definition: lcdserver.cpp:304
LCDServer::switchToNothing
void switchToNothing(QTcpSocket *socket)
Definition: lcdserver.cpp:468
LCDServer::readSocket
void readSocket()
Definition: lcdserver.cpp:135
LCDServer::setVolumeLevel
void setVolumeLevel(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:758
LCDServer::switchToGeneric
void switchToGeneric(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:355
LCDServer::switchToChannel
void switchToChannel(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:426
LCDServer::switchToMusic
void switchToMusic(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:334
LCDServer::m_serverPool
ServerPool * m_serverPool
Definition: lcdserver.h:67
debug_level
int debug_level
Definition: lcdserver.cpp:73
LCDServer::LCDServer
LCDServer(int port, QString message, int messageTime)
Definition: lcdserver.cpp:79
lcdprocclient.h
LCDServer::setMusicProgress
void setMusicProgress(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:654
LCDServer
Definition: lcdserver.h:27
LCDProcClient
Definition: lcdprocclient.h:18
LCDServer::endConnection
void endConnection(void)
Definition: lcdserver.cpp:120
LCDServer::switchToMenu
void switchToMenu(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:479
serverpool.h
LCDServer::switchToVolume
void switchToVolume(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:447
LCDServer::switchToTime
void switchToTime(QTcpSocket *socket)
Definition: lcdserver.cpp:323
LCDServer::setGenericProgress
void setGenericProgress(const QStringList &tokens, QTcpSocket *socket)
Definition: lcdserver.cpp:613
LCDServer::sendMessage
static void sendMessage(QTcpSocket *where, const QString &what)
Definition: lcdserver.cpp:286
LCDServer::m_lcd
LCDProcClient * m_lcd
Definition: lcdserver.h:66
LCDServer::newConnection
void newConnection(QTcpSocket *socket)
Definition: lcdserver.cpp:106