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/>.
23 #include <libcec/cec.h>
27 class InputCEC : public Input
33 bool handlesVolume() { return cechandlesvolume; };
37 void changePowerState(bool poweron);
39 bool loadOptionsFromServer(VDR* vdr);
40 bool saveOptionstoServer();
41 bool addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane);
42 bool handleOptionChanges(Option* option);
44 std::string getHardwareKeyName(int hardwareKey);
45 const char* getHardCodedHardwareKeyNamesForVompKey(UCHAR vompKey);
48 static constexpr const char* myModName = "InputCEC";
49 const char* modName() { return myModName; }
51 void InitHWCListwithDefaults();
52 UCHAR TranslateHWCFixed(int code);
54 bool cechandlesvolume{};
56 CEC::ICECAdapter* cec_adap{};
57 CEC::libcec_configuration cec_config;
58 CEC::ICECCallbacks cec_callbacks;
60 void incomingCECkey(int keys);
61 void incomingPowerkey(UCHAR key);
63 static InputCEC* instance;
64 static void cecLogMessage(void *param, const CEC::cec_log_message* message);
65 static void cecKeyPress(void*param, const CEC::cec_keypress* key);
66 static void cecCommand(void *param, const CEC::cec_command* command);
67 static void cecConfigurationChanged(void *param, const CEC::libcec_configuration* config);
68 static void cecSourceActivated(void*param, const CEC::cec_logical_address address, const uint8_t activated);