X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FLibCEC.cpp;h=cdac0d0425bd120b3688c5173e89e79b4b15227b;hb=46fb055c33e86ddc180af3374c28008bfc0c567b;hp=ca83d5fc570ec0e8bef0e39a74af20a4cbb32152;hpb=4f362964f02515f4011eb5db6b4f2f989fc6d0a5;p=deb_libcec.git diff --git a/src/lib/LibCEC.cpp b/src/lib/LibCEC.cpp index ca83d5f..cdac0d0 100644 --- a/src/lib/LibCEC.cpp +++ b/src/lib/LibCEC.cpp @@ -49,7 +49,17 @@ CLibCEC::CLibCEC(const char *strDeviceName, cec_device_type_list types, uint16_t m_callbacks(NULL), m_cbParam(NULL) { - m_cec = new CCECProcessor(this, strDeviceName, types, iPhysicalAddress); + m_cec = new CCECProcessor(this, strDeviceName, types, iPhysicalAddress, CEC_CLIENT_VERSION_PRE_1_5); +} + +CLibCEC::CLibCEC(const libcec_configuration *configuration) : + m_iStartTime(GetTimeMs()), + m_iCurrentButton(CEC_USER_CONTROL_CODE_UNKNOWN), + m_buttontime(0), + m_callbacks(configuration->callbacks), + m_cbParam(configuration->callbackParam) +{ + m_cec = new CCECProcessor(this, configuration); } CLibCEC::~CLibCEC(void) @@ -464,6 +474,13 @@ void * CECInit(const char *strDeviceName, CEC::cec_device_type_list types, uint1 return static_cast< void* > (lib); } +void * CECInitialise(const libcec_configuration *configuration) +{ + CLibCEC *lib = new CLibCEC(configuration); + CLibCEC::SetInstance(lib); + return static_cast< void* > (lib); +} + void CECDestroy(CEC::ICECAdapter *UNUSED(instance)) { CLibCEC::SetInstance(NULL); @@ -518,3 +535,23 @@ const char *CLibCEC::ToString(const cec_vendor_id vendor) { return m_cec->ToString(vendor); } + +const char *CLibCEC::ToString(const cec_client_version version) +{ + return m_cec->ToString(version); +} + +bool CLibCEC::GetCurrentConfiguration(libcec_configuration *configuration) +{ + return m_cec->GetCurrentConfiguration(configuration); +} + +bool CLibCEC::CanPersistConfiguration(void) +{ + return m_cec->CanPersistConfiguration(); +} + +bool CLibCEC::PersistConfiguration(libcec_configuration *configuration) +{ + return m_cec->PersistConfiguration(configuration); +}