cec: a recording device is both a playback device and a tuner
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 22 Nov 2011 18:58:51 +0000 (19:58 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Tue, 22 Nov 2011 18:58:51 +0000 (19:58 +0100)
src/lib/devices/CECRecordingDevice.cpp
src/lib/devices/CECRecordingDevice.h

index cda372dd5192c3ba442eec1836a117d0306803f5..54a203c42e92717685e866fade3ac711294dc9fd 100644 (file)
 using namespace CEC;
 
 CCECRecordingDevice::CCECRecordingDevice(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress /* = 0 */) :
-    CCECPlaybackDevice(processor, address, iPhysicalAddress)
+    CCECBusDevice(processor, address, iPhysicalAddress),
+    m_playbackDevice(processor, address, iPhysicalAddress),
+    m_tuner(processor, address, iPhysicalAddress)
 {
-  m_type          = CEC_DEVICE_TYPE_RECORDING_DEVICE;
+  m_type = CEC_DEVICE_TYPE_RECORDING_DEVICE;
+}
+
+cec_deck_info CCECRecordingDevice::GetDeckStatus(void) const
+{
+  return m_playbackDevice.GetDeckStatus();
+}
+
+cec_deck_control_mode CCECRecordingDevice::GetDeckControlMode(void) const
+{
+  return m_playbackDevice.GetDeckControlMode();
+}
+
+void CCECRecordingDevice::SetDeckStatus(cec_deck_info deckStatus)
+{
+  m_playbackDevice.SetDeckStatus(deckStatus);
+}
+
+void CCECRecordingDevice::SetDeckControlMode(cec_deck_control_mode mode)
+{
+  m_playbackDevice.SetDeckControlMode(mode);
+}
+
+bool CCECRecordingDevice::TransmitDeckStatus(cec_logical_address dest)
+{
+  return m_playbackDevice.TransmitDeckStatus(dest);
 }
index 86bd80a84c3ceca8c2917bc4c2ea538e44c2f6a4..f2c282c2d722f4c624ce1eea2675b646cda84eeb 100644 (file)
  *     http://www.pulse-eight.net/
  */
 
+#include "CECBusDevice.h"
 #include "CECPlaybackDevice.h"
+#include "CECTuner.h"
 
 namespace CEC
 {
-  class CCECRecordingDevice : public CCECPlaybackDevice
+  class CCECRecordingDevice : public CCECBusDevice
   {
   public:
     CCECRecordingDevice(CCECProcessor *processor, cec_logical_address address, uint16_t iPhysicalAddress = 0);
     virtual ~CCECRecordingDevice(void) {};
+
+    /* playback device methods */
+    virtual cec_deck_info GetDeckStatus(void) const;
+    virtual cec_deck_control_mode GetDeckControlMode(void) const;
+
+    virtual void SetDeckStatus(cec_deck_info deckStatus);
+    virtual void SetDeckControlMode(cec_deck_control_mode mode);
+
+    virtual bool TransmitDeckStatus(cec_logical_address dest);
+
+    /* tuner methods */
+    //TODO
+
+  protected:
+    CCECPlaybackDevice m_playbackDevice;
+    CCECTuner          m_tuner;
   };
 }