From 88e5de6f3e5f0f0ff13f47490c364aa68b5e773c Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Tue, 22 Nov 2011 01:28:55 +0100 Subject: [PATCH] cec: a recording device inherits all the features of a playback device. changed default type to 'recording device'. this means tv channel related keypresses will be sent now --- src/lib/devices/CECRecordingDevice.cpp | 2 +- src/lib/devices/CECRecordingDevice.h | 4 ++-- src/lib/implementations/CECCommandHandler.cpp | 4 ++-- src/testclient/main.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/devices/CECRecordingDevice.cpp b/src/lib/devices/CECRecordingDevice.cpp index a5fd567..cda372d 100644 --- a/src/lib/devices/CECRecordingDevice.cpp +++ b/src/lib/devices/CECRecordingDevice.cpp @@ -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; } diff --git a/src/lib/devices/CECRecordingDevice.h b/src/lib/devices/CECRecordingDevice.h index 45c0407..86bd80a 100644 --- a/src/lib/devices/CECRecordingDevice.h +++ b/src/lib/devices/CECRecordingDevice.h @@ -31,11 +31,11 @@ * 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); diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 7e5c872..4446c9d 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -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; diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index aae5c00..73d6990 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -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); -- 2.34.1