cec: a recording device inherits all the features of a playback device. changed defau...
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 22 Nov 2011 00:28:55 +0000 (01:28 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Tue, 22 Nov 2011 00:28:55 +0000 (01:28 +0100)
src/lib/devices/CECRecordingDevice.cpp
src/lib/devices/CECRecordingDevice.h
src/lib/implementations/CECCommandHandler.cpp
src/testclient/main.cpp

index a5fd567b5e67c6c110346a32ff107cdd297ab9d6..cda372dd5192c3ba442eec1836a117d0306803f5 100644 (file)
@@ -35,7 +35,7 @@
 using namespace CEC;
 
 CCECRecordingDevice::CCECRecordingDevice(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress /* = 0 */) :
-    CCECBusDevice(processor, address, iPhysicalAddress)
+    CCECPlaybackDevice(processor, address, iPhysicalAddress)
 {
   m_type          = CEC_DEVICE_TYPE_RECORDING_DEVICE;
 }
index 45c0407cd8341b6d9dc878ae3973cd13bf4a2d50..86bd80a84c3ceca8c2917bc4c2ea538e44c2f6a4 100644 (file)
  *     http://www.pulse-eight.net/
  */
 
-#include "CECBusDevice.h"
+#include "CECPlaybackDevice.h"
 
 namespace CEC
 {
-  class CCECRecordingDevice : public CCECBusDevice
+  class CCECRecordingDevice : public CCECPlaybackDevice
   {
   public:
     CCECRecordingDevice(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress = 0);
index 7e5c87224e8541e45e40305a0abdaafe0e849a34..4446c9d3ed9b4de4ce04f1b2dcbbf6fbb38f944c 100644 (file)
@@ -194,7 +194,7 @@ bool CCECCommandHandler::HandleActiveSource(const cec_command &command)
 bool CCECCommandHandler::HandleDeckControl(const cec_command &command)
 {
   CCECBusDevice *device = GetDevice(command.destination);
-  if (device && device->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE && command.parameters.size > 0)
+  if (device && (device->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE || device->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE) && command.parameters.size > 0)
   {
     ((CCECPlaybackDevice *) device)->SetDeckControlMode((cec_deck_control_mode) command.parameters[0]);
     return true;
@@ -249,7 +249,7 @@ bool CCECCommandHandler::HandleGiveAudioStatus(const cec_command &command)
 bool CCECCommandHandler::HandleGiveDeckStatus(const cec_command &command)
 {
   CCECBusDevice *device = GetDevice(command.destination);
-  if (device && device->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE)
+  if (device && (device->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE || device->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE))
     return ((CCECPlaybackDevice *) device)->TransmitDeckStatus(command.initiator);
 
   return false;
index aae5c007d9598ec2aba48420976df17e26a7bd54..73d69905186d177d6193b0d6c98f280ad6634aa5 100644 (file)
@@ -403,8 +403,8 @@ int main (int argc, char *argv[])
   if (typeList.IsEmpty())
   {
     if (!bSingleCommand)
-      cout << "No device type given. Using 'playback device'" << endl;
-    typeList.add(CEC_DEVICE_TYPE_PLAYBACK_DEVICE);
+      cout << "No device type given. Using 'recording device'" << endl;
+    typeList.add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
   }
 
   ICECAdapter *parser = LibCecInit("CECTester", typeList);