cec: added HandleGiveSystemAudioModeStatus()
[deb_libcec.git] / src / lib / implementations / CECCommandHandler.cpp
index a424bca3414d2ea38ccedac4a5dc9cfde91e9893..d2c6020dd12361f97f3352c4b668202432acfefb 100644 (file)
@@ -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)