X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FANCommandHandler.cpp;h=f8a8ade3c421aa12d00f781b03978eb1706dc9ba;hb=69a1a673f55d177a83f8c45f10c82787d6d763aa;hp=3da959eb5939f61c2e1189cddac4abbe1d297bfc;hpb=f8513317a5f4bb2d9d0843193c3c98eca19f8e8a;p=deb_libcec.git diff --git a/src/lib/implementations/ANCommandHandler.cpp b/src/lib/implementations/ANCommandHandler.cpp index 3da959e..f8a8ade 100644 --- a/src/lib/implementations/ANCommandHandler.cpp +++ b/src/lib/implementations/ANCommandHandler.cpp @@ -1,7 +1,7 @@ /* * This file is part of the libCEC(R) library. * - * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited. All rights reserved. + * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved. * libCEC(R) is an original work, containing original code. * * libCEC(R) is a trademark of Pulse-Eight Limited. @@ -33,18 +33,20 @@ #include "ANCommandHandler.h" #include "../devices/CECBusDevice.h" #include "../CECProcessor.h" -#include "../util/StdString.h" +#include "../LibCEC.h" using namespace CEC; CANCommandHandler::CANCommandHandler(CCECBusDevice *busDevice) : CCECCommandHandler(busDevice) { + m_vendorId = CEC_VENDOR_SAMSUNG; + m_bOPTSendDeckStatusUpdateOnActiveSource = false; } bool CANCommandHandler::HandleVendorRemoteButtonDown(const cec_command &command) { - if (command.parameters.size > 0) + if (m_processor->IsRunning() && command.parameters.size > 0) { cec_keypress key; key.duration = CEC_BUTTON_TIMEOUT; @@ -52,21 +54,17 @@ bool CANCommandHandler::HandleVendorRemoteButtonDown(const cec_command &command) switch (command.parameters[0]) { - case CEC_AN_USER_CONTROL_CODE_RETURN: - key.keycode = CEC_USER_CONTROL_CODE_EXIT; + case CEC_USER_CONTROL_CODE_AN_RETURN: + key.keycode = m_processor->GetClientVersion() >= CEC_CLIENT_VERSION_1_5_0 ? + CEC_USER_CONTROL_CODE_AN_RETURN : + CEC_USER_CONTROL_CODE_EXIT; break; default: break; } if (key.keycode != CEC_USER_CONTROL_CODE_UNKNOWN) - { - CStdString strLog; - strLog.Format("key pressed: %1x", key.keycode); - m_busDevice->AddLog(CEC_LOG_DEBUG, strLog); - - m_busDevice->GetProcessor()->AddKey(key); - } + CLibCEC::AddKey(key); } return true;