From: Lars Op den Kamp Date: Tue, 22 Nov 2011 00:28:55 +0000 (+0100) Subject: cec: a recording device inherits all the features of a playback device. changed defau... X-Git-Tag: upstream/2.2.0~1^2~44^2~119 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=88e5de6f3e5f0f0ff13f47490c364aa68b5e773c;p=deb_libcec.git 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 --- 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);