From: Lars Op den Kamp Date: Sun, 6 Nov 2011 15:29:31 +0000 (+0100) Subject: cec: added HandleGiveSystemAudioModeStatus() X-Git-Tag: upstream/2.2.0~1^2~96 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=cf0ecd850f25db418c1127bab8927f0021abb017;p=deb_libcec.git cec: added HandleGiveSystemAudioModeStatus() --- diff --git a/src/lib/devices/CECAudioSystem.cpp b/src/lib/devices/CECAudioSystem.cpp index 3ed22e9..a6d000f 100644 --- a/src/lib/devices/CECAudioSystem.cpp +++ b/src/lib/devices/CECAudioSystem.cpp @@ -52,3 +52,14 @@ bool CCECAudioSystem::TransmitAudioStatus(cec_logical_address dest) m_processor->TransmitAbort(dest, CEC_OPCODE_GIVE_AUDIO_STATUS); return false; } + +bool CCECAudioSystem::TransmitSystemAudioModeStatus(cec_logical_address dest) +{ + // TODO + CStdString strLog; + strLog.Format("<< %x -> %x: system audio mode status feature abort", m_iLogicalAddress, dest); + AddLog(CEC_LOG_NOTICE, strLog); + + m_processor->TransmitAbort(dest, CEC_OPCODE_GIVE_SYSTEM_AUDIO_MODE_STATUS); + return false; +} diff --git a/src/lib/devices/CECAudioSystem.h b/src/lib/devices/CECAudioSystem.h index 5690eda..e65d134 100644 --- a/src/lib/devices/CECAudioSystem.h +++ b/src/lib/devices/CECAudioSystem.h @@ -42,5 +42,6 @@ namespace CEC virtual ~CCECAudioSystem(void) {}; virtual bool TransmitAudioStatus(cec_logical_address dest); + virtual bool TransmitSystemAudioModeStatus(cec_logical_address dest); }; } diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index a424bca..d2c6020 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -96,6 +96,9 @@ bool CCECCommandHandler::HandleCommand(const cec_command &command) case CEC_OPCODE_GIVE_AUDIO_STATUS: HandleGiveAudioStatus(command); break; + case CEC_OPCODE_GIVE_SYSTEM_AUDIO_MODE_STATUS: + HandleGiveSystemAudioModeStatus(command); + break; default: UnhandledCommand(command); m_busDevice->GetProcessor()->AddCommand(command); @@ -320,6 +323,15 @@ bool CCECCommandHandler::HandleSetStreamPath(const cec_command &command) return true; } +bool CCECCommandHandler::HandleGiveSystemAudioModeStatus(const cec_command &command) +{ + CCECBusDevice *device = GetDevice(command.destination); + if (device && device->GetType() == CEC_DEVICE_TYPE_AUDIO_SYSTEM) + return ((CCECAudioSystem *) device)->TransmitSystemAudioModeStatus(command.initiator); + + return false; +} + bool CCECCommandHandler::HandleUserControlPressed(const cec_command &command) { if (command.parameters.size > 0) diff --git a/src/lib/implementations/CECCommandHandler.h b/src/lib/implementations/CECCommandHandler.h index 96f6db5..c578119 100644 --- a/src/lib/implementations/CECCommandHandler.h +++ b/src/lib/implementations/CECCommandHandler.h @@ -63,6 +63,7 @@ namespace CEC virtual bool HandleRoutingChange(const cec_command &command); virtual bool HandleSetMenuLanguage(const cec_command &command); virtual bool HandleSetStreamPath(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); virtual void UnhandledCommand(const cec_command &command);