X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FVLCommandHandler.cpp;h=ad4cf1717fb68a7f0bd0186e5caa54c99ee1f12d;hb=e69d8f191784c77c156ffec90db50767f91421e3;hp=e3d570bf6f1e0dd51ec2965c354f4eaaec2f3738;hpb=8ac9c610be214885ff040d23acb707eeaba1276c;p=deb_libcec.git diff --git a/src/lib/implementations/VLCommandHandler.cpp b/src/lib/implementations/VLCommandHandler.cpp index e3d570b..ad4cf17 100644 --- a/src/lib/implementations/VLCommandHandler.cpp +++ b/src/lib/implementations/VLCommandHandler.cpp @@ -1,7 +1,7 @@ /* * This file is part of the libCEC(R) library. * - * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited. All rights reserved. + * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved. * libCEC(R) is an original work, containing original code. * * libCEC(R) is a trademark of Pulse-Eight Limited. @@ -32,33 +32,22 @@ #include "VLCommandHandler.h" #include "../devices/CECBusDevice.h" -#include "../util/StdString.h" +#include "../CECProcessor.h" using namespace CEC; CVLCommandHandler::CVLCommandHandler(CCECBusDevice *busDevice) : CCECCommandHandler(busDevice) { + m_vendorId = CEC_VENDOR_PANASONIC; } -bool CVLCommandHandler::HandleSetStreamPath(const cec_command &command) +bool CVLCommandHandler::InitHandler(void) { - if (command.parameters.size >= 2) + CCECBusDevice *primary = m_processor->GetPrimaryDevice(); + if (primary->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE) { - int streamaddr = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]); - CStdString strLog; - strLog.Format(">> %i requests stream path from physical address %04x", command.initiator, streamaddr); - m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str()); - if (streamaddr == m_busDevice->GetMyPhysicalAddress()) - { - CCECBusDevice *device = GetDevice(command.destination); - if (device) - { - return device->TransmitActiveSource() && - device->TransmitMenuState(command.initiator); - } - return false; - } + return m_processor->ChangeDeviceType(CEC_DEVICE_TYPE_RECORDING_DEVICE, CEC_DEVICE_TYPE_PLAYBACK_DEVICE); } - return true; + return CCECCommandHandler::InitHandler(); }