2 Copyright 2004-2020 Chris Tallon; 2012 Marten Richter
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP. If not, see <https://www.gnu.org/licenses/>.
24 #include <libcec/cec.h>
31 class InputLinux : public Input
35 virtual ~InputLinux();
37 int init(const char *devName);
40 UCHAR getButtonPress(int) { return NA_UNKNOWN; } // DEPRECATED
44 void InitHWCListwithDefaults();
45 const char*HardcodedTranslateStr(UCHAR command);
46 char* HCWDesc(ULLONG hcw);
48 void changePowerState(bool poweron);
50 bool loadOptionsfromServer(VDR* vdr);
51 bool saveOptionstoServer();
52 bool addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane);
53 bool handleOptionChanges(Option* option);
55 bool mayHaveFewButtons() {return true;};
57 virtual bool handlesVolume() { return cechandlesvolume; };
58 virtual void volumeUp();
59 virtual void volumeDown();
60 virtual void volumeMute();
68 bool cechandlesvolume{};
70 UCHAR TranslateHWCFixed(ULLONG code);
72 std::vector<int> devices;
75 CEC::ICECAdapter* cec_adap{};
76 CEC::libcec_configuration cec_config;
77 CEC::ICECCallbacks cec_callbacks;
79 void incomingCECkey(int keys);
80 void incomingPowerkey(UCHAR key);
82 #if CEC_LIB_VERSION_MAJOR >= 4
83 static void cecLogMessage(void *param, const CEC::cec_log_message* message);
84 static void cecKeyPress(void*param, const CEC::cec_keypress* key);
85 static void cecCommand(void *param, const CEC::cec_command* command);
86 static void cecConfigurationChanged(void *param, const CEC::libcec_configuration* config);
88 static int cecLogMessage(void *param, const CEC::cec_log_message message);
89 static int cecKeyPress(void*param, const CEC::cec_keypress key);
90 static int cecCommand(void *param, const CEC::cec_command command);
91 static int cecConfigurationChanged(void *param, const CEC::libcec_configuration config);
93 static void cecSourceActivated(void*param, const CEC::cec_logical_address address, const uint8_t activated);
96 void informStopEventLoop();