MythTV  0.26-pre
Public Member Functions | Private Member Functions
MythSystemEventHandler Class Reference

Handles incoming MythSystemEvent messages. More...

#include <mythsystemevent.h>

List of all members.

Public Member Functions

 MythSystemEventHandler ()
 Null Constructor.
 ~MythSystemEventHandler ()
 Destructor.

Private Member Functions

void SubstituteMatches (const QStringList &tokens, QString &command)
 Substitutes MATCH% variables in given command line.
QString EventNameToSetting (const QString &name)
 Convert an MythSystemEvent name to a database setting name.
void customEvent (QEvent *e)
 Custom Event handler for receiving and processing System Events.

Detailed Description

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.


Constructor & Destructor Documentation

Null Constructor.

Adds this object as a gContext event listener.

Definition at line 77 of file mythsystemevent.cpp.

Destructor.

Removes this object as a gContext event listener.

Definition at line 87 of file mythsystemevent.cpp.


Member Function Documentation

void MythSystemEventHandler::SubstituteMatches ( const QStringList &  tokens,
QString &  command 
) [private]

Substitutes MATCH% variables in given command line.

See also:
ProgramInfo::SubstituteMatches(QString &str)

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.

Parameters:
tokensConst QStringList containing token list passed with event.
commandCommand line containing MATCH% variables to be substituted.

Definition at line 105 of file mythsystemevent.cpp.

Referenced by customEvent().

QString MythSystemEventHandler::EventNameToSetting ( const QString &  name) [private]

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.

Parameters:
nameConst QString containing System Event name to convert

Definition at line 223 of file mythsystemevent.cpp.

Referenced by customEvent().

void MythSystemEventHandler::customEvent ( QEvent *  e) [private]

Custom Event handler for receiving and processing System Events.

See also:
MythSystemEventHandler::SubstituteMatches(const QStringList &tokens, QString &command) MythSystemEventHandler::EventNameToSetting(const QString &name)

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.

Parameters:
ePointer to QEvent containing event to handle

Definition at line 255 of file mythsystemevent.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends