X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FCECCommandHandler.cpp;h=eefc0e3c5b2914c63f854e6c00c18788b139cc6a;hb=fbdea54c9e414a98d3ff8ef4a4d03e7ff3568427;hp=0668ee793bd16e3e6c1b47c58b3f8b76df251302;hpb=340ce76c689f0e52439556edfb49da07e3171114;p=deb_libcec.git diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 0668ee7..eefc0e3 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -83,6 +83,10 @@ bool CCECCommandHandler::HandleCommand(const cec_command &command) if (m_processor->IsInitialised()) HandleGivePhysicalAddress(command); break; + case CEC_OPCODE_GET_MENU_LANGUAGE: + if (m_processor->IsInitialised()) + HandleGiveMenuLanguage(command); + break; case CEC_OPCODE_GIVE_OSD_NAME: if (m_processor->IsInitialised()) HandleGiveOSDName(command); @@ -341,6 +345,18 @@ bool CCECCommandHandler::HandleGivePhysicalAddress(const cec_command &command) return false; } +bool CCECCommandHandler::HandleGiveMenuLanguage(const cec_command &command) +{ + if (m_processor->IsRunning() && m_busDevice->MyLogicalAddressContains(command.destination)) + { + CCECBusDevice *device = GetDevice(command.destination); + if (device) + return device->TransmitSetMenuLanguage(command.initiator); + } + + return false; +} + bool CCECCommandHandler::HandleGiveSystemAudioModeStatus(const cec_command &command) { if (m_processor->IsRunning() && m_busDevice->MyLogicalAddressContains(command.destination)) @@ -875,6 +891,17 @@ bool CCECCommandHandler::TransmitPhysicalAddress(const cec_logical_address iInit return Transmit(command, false); } +bool CCECCommandHandler::TransmitSetMenuLanguage(const cec_logical_address iInitiator, const char lang[3]) +{ + cec_command command; + command.Format(command, iInitiator, CECDEVICE_BROADCAST, CEC_OPCODE_SET_MENU_LANGUAGE); + command.parameters.PushBack((uint8_t) lang[0]); + command.parameters.PushBack((uint8_t) lang[1]); + command.parameters.PushBack((uint8_t) lang[2]); + + return Transmit(command, false); +} + bool CCECCommandHandler::TransmitPoll(const cec_logical_address iInitiator, const cec_logical_address iDestination) { cec_command command;