From: Lars Op den Kamp Date: Fri, 25 Nov 2011 10:19:05 +0000 (+0100) Subject: cec: added HandleSystemAudioStatus() X-Git-Tag: upstream/2.2.0~1^2~44^2~106 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=868dc71fc0084c08a6f3d19888a7f4f855add3f4;p=deb_libcec.git cec: added HandleSystemAudioStatus() --- diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 037825a..333b71b 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -132,6 +132,9 @@ bool CCECCommandHandler::HandleCommand(const cec_command &command) case CEC_OPCODE_REPORT_AUDIO_STATUS: HandleReportAudioStatus(command); break; + case CEC_OPCODE_SYSTEM_AUDIO_MODE_STATUS: + HandleSystemAudioStatus(command); + break; case CEC_OPCODE_SET_OSD_NAME: HandleSetOSDName(command); break; @@ -460,6 +463,18 @@ bool CCECCommandHandler::HandleStandby(const cec_command &command) return true; } +bool CCECCommandHandler::HandleSystemAudioStatus(const cec_command &command) +{ + CCECBusDevice *device = GetDevice(command.initiator); + if (device && device->GetType() == CEC_DEVICE_TYPE_AUDIO_SYSTEM) + { + ((CCECAudioSystem *)device)->SetSystemAudioMode(command); + return true; + } + + return false; +} + bool CCECCommandHandler::HandleGiveSystemAudioModeStatus(const cec_command &command) { if (m_busDevice->MyLogicalAddressContains(command.destination)) diff --git a/src/lib/implementations/CECCommandHandler.h b/src/lib/implementations/CECCommandHandler.h index 8b31d2c..7dea0c0 100644 --- a/src/lib/implementations/CECCommandHandler.h +++ b/src/lib/implementations/CECCommandHandler.h @@ -83,6 +83,7 @@ namespace CEC virtual bool HandleSetStreamPath(const cec_command &command); virtual bool HandleSetSystemAudioModeRequest(const cec_command &command); virtual bool HandleStandby(const cec_command &command); + virtual bool HandleSystemAudioStatus(const cec_command &command); virtual bool HandleGiveSystemAudioModeStatus(const cec_command &command); virtual bool HandleUserControlPressed(const cec_command &command); virtual bool HandleUserControlRelease(const cec_command &command);