MythTV
master
|
Handles incoming MythSystemEvent messages. More...
#include <mythsystemevent.h>
Public Member Functions | |
MythSystemEventHandler () | |
Null Constructor. More... | |
~MythSystemEventHandler () override | |
Destructor. More... | |
Private Member Functions | |
void | customEvent (QEvent *e) override |
Custom Event handler for receiving and processing System Events. More... | |
Static Private Member Functions | |
static void | SubstituteMatches (const QStringList &tokens, QString &command) |
Substitutes MATCH% variables in given command line. More... | |
static QString | EventNameToSetting (const QString &name) |
Convert an MythSystemEvent name to a database setting name. More... | |
Handles incoming MythSystemEvent messages.
MythSystemEventHandler handles incoming MythSystemEvent messages and runs the appropriate event handler command on the local system if one is configured.
Definition at line 24 of file mythsystemevent.h.
MythSystemEventHandler::MythSystemEventHandler | ( | ) |
Null Constructor.
Adds this object as a gContext event listener.
Definition at line 77 of file mythsystemevent.cpp.
|
override |
Destructor.
Removes this object as a gContext event listener.
Definition at line 88 of file mythsystemevent.cpp.
|
staticprivate |
Substitutes MATCH% variables in given command line.
Subsitutes values for MATCH% type variables in given command string. Some of these matches come from the tokens list passed in and some may come from a ProgramInfo if a chanid and starttime are specified in the tokens list.
tokens | Const QStringList containing token list passed with event. |
command | Command line containing MATCH% variables to be substituted. |
Definition at line 106 of file mythsystemevent.cpp.
Referenced by customEvent().
|
staticprivate |
Convert an MythSystemEvent name to a database setting name.
Converts an underscored, all-capital-letters system event name of the form NET_CTRL_CONNECTED to the corresponding CamelCase database setting name EventCmdNetCtrlConnected.
name | Const QString containing System Event name to convert |
Definition at line 226 of file mythsystemevent.cpp.
Referenced by customEvent().
|
overrideprivate |
Custom Event handler for receiving and processing System Events.
This function listens for SYSTEM_EVENT messages and fires off any necessary event handler commands. In addition to SYSTEM_EVENT messages, this code also forwards GLOBAL_SYSTEM_EVENT which may have been sent by the local system via code that does not have access to the master backend connection to send events on its own. One example is the code that sends KEY_xx system events.
e | Pointer to QEvent containing event to handle |
Definition at line 259 of file mythsystemevent.cpp.