From: Lars Op den Kamp Date: Tue, 22 Nov 2011 18:58:51 +0000 (+0100) Subject: cec: a recording device is both a playback device and a tuner X-Git-Tag: upstream/2.2.0~1^2~44^2~118 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=1a7f0a57653192ae7aae6e834574334169c13d2d;p=deb_libcec.git cec: a recording device is both a playback device and a tuner --- diff --git a/src/lib/devices/CECRecordingDevice.cpp b/src/lib/devices/CECRecordingDevice.cpp index cda372d..54a203c 100644 --- a/src/lib/devices/CECRecordingDevice.cpp +++ b/src/lib/devices/CECRecordingDevice.cpp @@ -35,7 +35,34 @@ 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); } diff --git a/src/lib/devices/CECRecordingDevice.h b/src/lib/devices/CECRecordingDevice.h index 86bd80a..f2c282c 100644 --- a/src/lib/devices/CECRecordingDevice.h +++ b/src/lib/devices/CECRecordingDevice.h @@ -31,14 +31,32 @@ * 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; }; }