X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FCECCommandHandler.cpp;h=fee99806079f8aae569b87ad20ac7d82aebaf96a;hb=c7903c025a521e18ce9e33b17679d14640365eaa;hp=1c0f8d95ed81ce53184a1efd0f717996cf79fd86;hpb=c409848208093a15758c91e3fab9fbe806a62e12;p=deb_libcec.git diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 1c0f8d9..fee9980 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -356,12 +356,21 @@ bool CCECCommandHandler::HandleSetStreamPath(const cec_command &command) { if (command.parameters.size >= 2) { - uint16_t streamaddr = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]); + uint16_t iStreamAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]); CStdString strLog; - strLog.Format(">> %i sets stream path to physical address %04x", command.initiator, streamaddr); + strLog.Format(">> %i sets stream path to physical address %04x", command.initiator, iStreamAddress); m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str()); - return m_busDevice->GetProcessor()->SetStreamPath(streamaddr); + if (m_busDevice->GetProcessor()->SetStreamPath(iStreamAddress)) + { + CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamAddress); + if (device) + { + return device->TransmitActiveSource() && + device->TransmitMenuState(command.initiator); + } + } + return false; } return true; } @@ -487,6 +496,19 @@ void CCECCommandHandler::SetVendorId(const cec_command &command) device->SetVendorId(iVendorId); } +const char *CCECCommandHandler::ToString(const cec_menu_state state) +{ + switch (state) + { + case CEC_MENU_STATE_ACTIVATED: + return "activated"; + case CEC_MENU_STATE_DEACTIVATED: + return "deactivated"; + default: + return "unknown"; + } +} + const char *CCECCommandHandler::ToString(const cec_version version) { switch (version)