#include "CECClient.h"
#include "CECProcessor.h"
#include "LibCEC.h"
+#include "CECTypeUtils.h"
#include "devices/CECPlaybackDevice.h"
#include "devices/CECAudioSystem.h"
#include "devices/CECTV.h"
using namespace PLATFORM;
#define LIB_CEC m_processor->GetLib()
-#define ToString(x) LIB_CEC->ToString(x)
+#define ToString(x) CCECTypeUtils::ToString(x)
CCECClient::CCECClient(CCECProcessor *processor, const libcec_configuration &configuration) :
m_processor(processor),
bool CCECClient::SendKeypress(const cec_logical_address iDestination, const cec_user_control_code key, bool bWait /* = true */)
{
- CCECBusDevice *device = GetPrimaryDevice();
CCECBusDevice *dest = m_processor->GetDevice(iDestination);
- return device && dest ?
- device->TransmitKeypress(GetPrimaryLogicalAdddress(), key, bWait) :
+ return dest ?
+ dest->TransmitKeypress(GetPrimaryLogicalAdddress(), key, bWait) :
false;
}
bool CCECClient::SendKeyRelease(const cec_logical_address iDestination, bool bWait /* = true */)
{
- CCECBusDevice *device = GetPrimaryDevice();
CCECBusDevice *dest = m_processor->GetDevice(iDestination);
- return device && dest ?
- device->TransmitKeyRelease(GetPrimaryLogicalAdddress(), bWait) :
+ return dest ?
+ dest->TransmitKeyRelease(GetPrimaryLogicalAdddress(), bWait) :
false;
}