X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FLibCEC.cpp;h=95e2a2e42e72d1a5cadb37f2be924c207a19a322;hb=e3ac04dc6ac683aec74bd756002371c46cc9285f;hp=eecde162bcd0080970536edd48871b2bf5443cee;hpb=6a1c0009842a1857b863655813595292422a512b;p=deb_libcec.git diff --git a/src/lib/LibCEC.cpp b/src/lib/LibCEC.cpp index eecde16..95e2a2e 100644 --- a/src/lib/LibCEC.cpp +++ b/src/lib/LibCEC.cpp @@ -55,14 +55,7 @@ CLibCEC::~CLibCEC(void) { Close(); delete m_cec; - m_cec = NULL; - delete m_comm; - m_comm = NULL; - - m_logBuffer.Clear(); - m_keyBuffer.Clear(); - m_commandBuffer.Clear(); } bool CLibCEC::Open(const char *strPort, uint32_t iTimeoutMs /* = 10000 */) @@ -134,16 +127,6 @@ bool CLibCEC::StartBootloader(void) return m_comm ? m_comm->StartBootloader() : false; } -int8_t CLibCEC::GetMinVersion(void) -{ - return CEC_MIN_VERSION; -} - -int8_t CLibCEC::GetLibVersion(void) -{ - return CEC_LIB_VERSION; -} - bool CLibCEC::GetNextLogMessage(cec_log_message *message) { return (m_logBuffer.Pop(*message)); @@ -211,6 +194,27 @@ cec_version CLibCEC::GetDeviceCecVersion(cec_logical_address iAddress) return CEC_VERSION_UNKNOWN; } +bool CLibCEC::GetDeviceMenuLanguage(cec_logical_address iAddress, cec_menu_language *language) +{ + if (m_cec && iAddress >= CECDEVICE_TV && iAddress < CECDEVICE_BROADCAST) + return m_cec->GetDeviceMenuLanguage(iAddress, language); + return false; +} + +uint64_t CLibCEC::GetDeviceVendorId(cec_logical_address iAddress) +{ + if (m_cec && iAddress >= CECDEVICE_TV && iAddress < CECDEVICE_BROADCAST) + return m_cec->GetDeviceVendorId(iAddress); + return 0; +} + +cec_power_status CLibCEC::GetDevicePowerStatus(cec_logical_address iAddress) +{ + if (m_cec && iAddress >= CECDEVICE_TV && iAddress < CECDEVICE_BROADCAST) + return m_cec->GetDevicePowerStatus(iAddress); + return CEC_POWER_STATUS_UNKNOWN; +} + void CLibCEC::AddLog(cec_log_level level, const string &strMessage) { if (m_cec) @@ -223,6 +227,13 @@ void CLibCEC::AddLog(cec_log_level level, const string &strMessage) } } +void CLibCEC::AddKey(cec_keypress &key) +{ + m_keyBuffer.Push(key); + m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; + m_buttontime = 0; +} + void CLibCEC::AddKey(void) { if (m_iCurrentButton != CEC_USER_CONTROL_CODE_UNKNOWN) @@ -233,8 +244,8 @@ void CLibCEC::AddKey(void) key.keycode = m_iCurrentButton; m_keyBuffer.Push(key); m_iCurrentButton = CEC_USER_CONTROL_CODE_UNKNOWN; - m_buttontime = 0; } + m_buttontime = 0; } void CLibCEC::AddCommand(const cec_command &command)