7 #define LIBCEC_ENABLED QString("libCECEnabled")
8 #define LIBCEC_DEVICE QString("libCECDevice")
9 #define LIBCEC_BASE QString("libCECBase")
10 #define LIBCEC_PORT QString("libCECPort")
11 #define POWEROFFTV_ALLOWED QString("PowerOffTVAllowed")
12 #define POWEROFFTV_ONEXIT QString("PowerOffTVOnExit")
13 #define POWERONTV_ALLOWED QString("PowerOnTVAllowed")
14 #define POWERONTV_ONSTART QString("PowerOnTVOnStart")
17 #include <libcec/cec.h>
34 Q_DECLARE_FLAGS(MythCECActions, MythCECAction)
36 #if CEC_LIB_VERSION_MAJOR <= 3
37 static int LogMessageCallback(
void* ,
const cec_log_message Message);
38 static int KeyPressCallback (
void* Adapter,
const cec_keypress Keypress);
39 static int CommandCallback (
void* Adapter,
const cec_command
Command);
40 static int AlertCallback (
void* ,
const libcec_alert Alert,
const libcec_parameter Data);
42 static void LogMessageCallback(
void* ,
const cec_log_message* Message);
43 static void KeyPressCallback (
void* Adapter,
const cec_keypress* Keypress);
44 static void CommandCallback (
void* Adapter,
const cec_command*
Command);
45 static void AlertCallback (
void* , libcec_alert Alert, libcec_parameter Data);
47 static void SourceCallback (
void* , cec_logical_address Address, uint8_t Activated);
48 static QString AddressToString(
int Address);
55 void IgnoreKeys (
bool Ignore);
58 void HandleActions (MythCECActions Actions);
59 int HandleCommand (
const cec_command &
Command);
60 int HandleKeyPress(cec_keypress Key)
const;
61 static void HandleSource (cec_logical_address Address, uint8_t Activated);
62 static int LogMessage (
const cec_log_message &Message);
63 static int HandleAlert (libcec_alert Alert, libcec_parameter Data);
66 ICECAdapter *m_adapter {
nullptr };
68 bool m_valid {
false };
69 bool m_ignoreKeys {
false };
70 bool m_powerOffTVAllowed {
false };
71 bool m_powerOffTVOnExit {
false };
72 bool m_powerOnTVAllowed {
false };
73 bool m_powerOnTVOnStart {
false };
74 bool m_switchInputAllowed {
true };