MythTV  master
Public Member Functions | Private Member Functions | Static Private Member Functions | List of all members
MythSystemEventHandler Class Reference

Handles incoming MythSystemEvent messages. More...

#include <mythsystemevent.h>

Inheritance diagram for MythSystemEventHandler:
Inheritance graph
[legend]
Collaboration diagram for MythSystemEventHandler:
Collaboration graph
[legend]

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...
 

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

◆ MythSystemEventHandler()

MythSystemEventHandler::MythSystemEventHandler ( )

Null Constructor.

Adds this object as a gContext event listener.

Definition at line 77 of file mythsystemevent.cpp.

◆ ~MythSystemEventHandler()

MythSystemEventHandler::~MythSystemEventHandler ( )
override

Destructor.

Removes this object as a gContext event listener.

Definition at line 88 of file mythsystemevent.cpp.

Member Function Documentation

◆ SubstituteMatches()

void MythSystemEventHandler::SubstituteMatches ( const QStringList &  tokens,
QString &  command 
)
staticprivate

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 106 of file mythsystemevent.cpp.

Referenced by customEvent().

◆ EventNameToSetting()

QString MythSystemEventHandler::EventNameToSetting ( const QString &  name)
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.

Parameters
nameConst QString containing System Event name to convert

Definition at line 226 of file mythsystemevent.cpp.

Referenced by customEvent().

◆ customEvent()

void MythSystemEventHandler::customEvent ( QEvent *  e)
overrideprivate

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 259 of file mythsystemevent.cpp.


The documentation for this class was generated from the following files: