X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fimplementations%2FCECCommandHandler.cpp;h=b43d2b0ed87262f9723ad1b349319f07f7b910a1;hb=4bec9d79a5b66d6fe14b19c4e66509b03cc53e90;hp=c7b030543ca044a137b78e8947009e98fabb39c7;hpb=37b0c5724f06a98e14686695b5089f66ac657f11;p=deb_libcec.git diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index c7b0305..b43d2b0 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -464,12 +464,12 @@ bool CCECCommandHandler::HandleSetStreamPath(const cec_command &command) strLog.Format(">> %i sets stream path to physical address %04x", command.initiator, iStreamAddress); m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str()); + /* one of the device handled by libCEC has been made active */ CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamAddress); - if (device) + if (device && m_busDevice->MyLogicalAddressContains(device->GetLogicalAddress())) { device->SetActiveSource(); - return device->TransmitActiveSource() && - device->TransmitMenuState(command.initiator); + device->TransmitActiveSource(); } } return false; @@ -564,9 +564,19 @@ bool CCECCommandHandler::HandleUserControlPressed(const cec_command &command) { CCECBusDevice *device = GetDevice(command.destination); if (device) + { device->SetPowerStatus(CEC_POWER_STATUS_ON); + if (device->MyLogicalAddressContains(device->GetLogicalAddress())) + { + device->SetActiveSource(); + device->TransmitActiveSource(); + + if (device->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE || + device->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE) + ((CCECPlaybackDevice *)device)->TransmitDeckStatus(command.initiator); + } + } } - m_processor->SetCurrentButton((cec_user_control_code) command.parameters[0]); return true; } @@ -877,21 +887,21 @@ bool CCECCommandHandler::TransmitDeckStatus(const cec_logical_address iInitiator return Transmit(command); } -bool CCECCommandHandler::TransmitKeypress(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_user_control_code key) +bool CCECCommandHandler::TransmitKeypress(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_user_control_code key, bool bWait /* = true */) { cec_command command; cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_USER_CONTROL_PRESSED); command.parameters.PushBack((uint8_t)key); - return Transmit(command); + return Transmit(command, bWait); } -bool CCECCommandHandler::TransmitKeyRelease(const cec_logical_address iInitiator, const cec_logical_address iDestination) +bool CCECCommandHandler::TransmitKeyRelease(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWait /* = true */) { cec_command command; cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_USER_CONTROL_RELEASE); - return Transmit(command); + return Transmit(command, bWait); } bool CCECCommandHandler::Transmit(cec_command &command, bool bExpectResponse /* = true */)