X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECProcessor.cpp;h=d094be1341b943d967fd7d598191b5247407642a;hb=a9232a79cfb71be51caea8aae6c8ea63ae3884ad;hp=dce52acdde66b35c7df84bd7407b570980960e81;hpb=f958766e4dae1cf246ef76160eefb27d73110161;p=deb_libcec.git diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index dce52ac..d094be1 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -319,6 +319,34 @@ bool CCECProcessor::SetActiveView(void) return SetActiveSource(); } +bool CCECProcessor::SetDeckControlMode(cec_deck_control_mode mode) +{ + bool bReturn(false); + + CCECBusDevice *device = GetDeviceByType(CEC_DEVICE_TYPE_PLAYBACK_DEVICE); + if (device) + { + ((CCECPlaybackDevice *) device)->SetDeckControlMode(mode); + bReturn = true; + } + + return bReturn; +} + +bool CCECProcessor::SetDeckInfo(cec_deck_info info) +{ + bool bReturn(false); + + CCECBusDevice *device = GetDeviceByType(CEC_DEVICE_TYPE_PLAYBACK_DEVICE); + if (device) + { + ((CCECPlaybackDevice *) device)->SetDeckStatus(info); + bReturn = true; + } + + return bReturn; +} + bool CCECProcessor::SetStreamPath(uint16_t iStreamPath) { bool bReturn(false); @@ -408,7 +436,6 @@ bool CCECProcessor::PollDevice(cec_logical_address iAddress) return false; } - CCECBusDevice *CCECProcessor::GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress) const { CCECBusDevice *device = NULL; @@ -425,6 +452,22 @@ CCECBusDevice *CCECProcessor::GetDeviceByPhysicalAddress(uint16_t iPhysicalAddre return device; } +CCECBusDevice *CCECProcessor::GetDeviceByType(cec_device_type type) const +{ + CCECBusDevice *device = NULL; + + for (unsigned int iPtr = 0; iPtr < 16; iPtr++) + { + if (m_busDevices[iPtr]->m_type == type) + { + device = m_busDevices[iPtr]; + break; + } + } + + return device; +} + cec_version CCECProcessor::GetDeviceCecVersion(cec_logical_address iAddress) { return m_busDevices[iAddress]->GetCecVersion();