initted = 0;
curcec=0;
hascurcec=false;
+ haspower=false;
+ powerkey=0;
signal=false;
cec_adap=NULL;
num_loop=0;
cec_callbacks.CBCecKeyPress = cecKeyPress;
cec_callbacks.CBCecCommand = cecCommand;
cec_callbacks.CBCecConfigurationChanged = cecConfigurationChanged;
+ cec_callbacks.CBCecSourceActivated = cecSourceActivated;
cec_config.clientVersion=LIBCEC_VERSION_CURRENT;
cec_config.bActivateSource=1;
cec_config.bUseTVMenuLanguage=1;
hascurcec = false;
return (UCHAR) TranslateHWC(W_G_HCW(W_HCW_CEC,curcec));
}
+ if (haspower) {
+ haspower =false;
+ return powerkey;
+ }
ret = NA_NONE;
} else {
if (retval == -1) {
int RemoteLinux::cecCommand(void *param, const cec_command &command)
{
Log::getInstance()->log("Remote", Log::DEBUG, "CECCommand: %d",command.opcode);
+ switch (command.opcode) {
+ case CEC_OPCODE_STANDBY: {
+ if (command.initiator==CECDEVICE_TV) {
+ ((RemoteLinux*)Remote::getInstance())->incomingPowerkey(POWEROFF);
+ }
+ } break;
+ case CEC_OPCODE_DECK_CONTROL: {
+ if (command.initiator==CECDEVICE_TV && command.parameters.size == 1
+ && command.parameters[0]==CEC_DECK_CONTROL_MODE_STOP) {
+ ((RemoteLinux*)Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_STOP);
+
+ }
+
+ } break;
+ case CEC_OPCODE_PLAY: {
+ if (command.initiator==CECDEVICE_TV && command.parameters.size == 1) {
+ if (command.parameters[0]==CEC_PLAY_MODE_PLAY_FORWARD) {
+ ((RemoteLinux*)Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PLAY);
+ } else if (command.parameters[0]==CEC_PLAY_MODE_PLAY_STILL) {
+ ((RemoteLinux*)Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PAUSE);
+ }
+ }
+
+
+ } break;
+ default:
+ break;
+ };
return 1;
}
}
+void RemoteLinux::cecSourceActivated(void*param, const cec_logical_address address, const uint8_t activated)
+{
+ Log::getInstance()->log("Remote", Log::DEBUG, "CECSourceActivated: %d %d", address, activated);
+ if (activated==1) {
+ ((RemoteLinux*)Remote::getInstance())->incomingPowerkey(POWERON);
+ }
+}
+
void RemoteLinux::incomingCECkey(int keys)
{
curcec=keys;
}
+void RemoteLinux::incomingPowerkey(UCHAR key){
+ haspower=true;
+ powerkey=key;
+}
+
bool RemoteLinux::loadOptionsfromServer(VDR* vdr)
{
int curcec;
bool hascurcec;
bool cechandlesvolume;
+ bool haspower;
+ UCHAR powerkey;
UCHAR TranslateHWCFixed(ULLONG code);
void InitKeymap();
CEC::ICECCallbacks cec_callbacks;
void incomingCECkey(int keys);
+ void incomingPowerkey(UCHAR key);
static int cecLogMessage(void *param, const CEC::cec_log_message &message);
static int cecKeyPress(void*param, const CEC::cec_keypress &key);
static int cecCommand(void *param, const CEC::cec_command &command);
static int cecConfigurationChanged(void *param, const CEC::libcec_configuration &config);
+ static void cecSourceActivated(void*param, const CEC::cec_logical_address address, const uint8_t activated);
};