cec: added HandleSystemAudioStatus()
[deb_libcec.git] / src / lib / implementations / CECCommandHandler.cpp
index 037825acb1d4078c6369efcf2c04295841be6471..333b71b1ab12817d6927ff1ffbc4eae252717fd2 100644 (file)
@@ -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))