repositories
/
deb_libcec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f6562fa
)
cosmetics
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Wed, 21 Dec 2011 22:49:03 +0000
(23:49 +0100)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Wed, 21 Dec 2011 23:56:29 +0000
(
00:56
+0100)
src/lib/CECProcessor.cpp
patch
|
blob
|
blame
|
history
src/lib/CECProcessor.h
patch
|
blob
|
blame
|
history
src/lib/implementations/CECCommandHandler.cpp
patch
|
blob
|
blame
|
history
src/lib/implementations/SLCommandHandler.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/lib/CECProcessor.cpp
b/src/lib/CECProcessor.cpp
index cb6729c7ede4599d8208dcfd8ea972f40bcdeb83..ec0eb554d62a3e23ab1723bc2604f8c93693f59a 100644
(file)
--- a/
src/lib/CECProcessor.cpp
+++ b/
src/lib/CECProcessor.cpp
@@
-653,6
+653,15
@@
CCECBusDevice *CCECProcessor::GetDeviceByType(cec_device_type type) const
return device;
}
return device;
}
+CCECBusDevice *CCECProcessor::GetPrimaryDevice(void) const
+{
+ CCECBusDevice *device(NULL);
+ cec_logical_address primary = m_logicalAddresses.primary;
+ if (primary != CECDEVICE_UNKNOWN)
+ device = m_busDevices[primary];
+ return device;
+}
+
cec_version CCECProcessor::GetDeviceCecVersion(cec_logical_address iAddress)
{
return m_busDevices[iAddress]->GetCecVersion();
cec_version CCECProcessor::GetDeviceCecVersion(cec_logical_address iAddress)
{
return m_busDevices[iAddress]->GetCecVersion();
diff --git
a/src/lib/CECProcessor.h
b/src/lib/CECProcessor.h
index 657aa4784fe3706ee0c171e11e5e9fd69e2cbcfd..e2705fd007c1853aa6e31a12789cf25983157f48 100644
(file)
--- a/
src/lib/CECProcessor.h
+++ b/
src/lib/CECProcessor.h
@@
-59,6
+59,7
@@
namespace CEC
virtual bool IsMonitoring(void) const { return m_bMonitor; }
virtual CCECBusDevice * GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress, bool bRefresh = false) const;
virtual CCECBusDevice * GetDeviceByType(cec_device_type type) const;
virtual bool IsMonitoring(void) const { return m_bMonitor; }
virtual CCECBusDevice * GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress, bool bRefresh = false) const;
virtual CCECBusDevice * GetDeviceByType(cec_device_type type) const;
+ virtual CCECBusDevice * GetPrimaryDevice(void) const;
virtual cec_version GetDeviceCecVersion(cec_logical_address iAddress);
virtual bool GetDeviceMenuLanguage(cec_logical_address iAddress, cec_menu_language *language);
virtual const std::string & GetDeviceName(void) { return m_strDeviceName; }
virtual cec_version GetDeviceCecVersion(cec_logical_address iAddress);
virtual bool GetDeviceMenuLanguage(cec_logical_address iAddress, cec_menu_language *language);
virtual const std::string & GetDeviceName(void) { return m_strDeviceName; }
diff --git
a/src/lib/implementations/CECCommandHandler.cpp
b/src/lib/implementations/CECCommandHandler.cpp
index c78f6438f6f9c7b6d31e72d0ebe7df03de20cecd..3906060691712eb822137a5c0dc2978b7e433351 100644
(file)
--- a/
src/lib/implementations/CECCommandHandler.cpp
+++ b/
src/lib/implementations/CECCommandHandler.cpp
@@
-931,7
+931,7
@@
bool CCECCommandHandler::InitHandler(void)
{
if (m_busDevice->GetLogicalAddress() == CECDEVICE_TV)
{
{
if (m_busDevice->GetLogicalAddress() == CECDEVICE_TV)
{
- CCECBusDevice *primary = m_processor->
m_busDevices[m_processor->GetLogicalAddresses().primary]
;
+ CCECBusDevice *primary = m_processor->
GetPrimaryDevice()
;
primary->SetPowerStatus(CEC_POWER_STATUS_ON);
primary->SetMenuState(CEC_MENU_STATE_ACTIVATED);
primary->SetPowerStatus(CEC_POWER_STATUS_ON);
primary->SetMenuState(CEC_MENU_STATE_ACTIVATED);
diff --git
a/src/lib/implementations/SLCommandHandler.cpp
b/src/lib/implementations/SLCommandHandler.cpp
index 0f007176d623f9e83732abbef114790b97446d28..e63f1bb08a2df0db064fdb151ec1e71c4a138c98 100644
(file)
--- a/
src/lib/implementations/SLCommandHandler.cpp
+++ b/
src/lib/implementations/SLCommandHandler.cpp
@@
-54,7
+54,7
@@
CSLCommandHandler::CSLCommandHandler(CCECBusDevice *busDevice) :
m_bVendorIdSent(false)
{
/* TODO set to powered off until we fixed the connect on start loop issue */
m_bVendorIdSent(false)
{
/* TODO set to powered off until we fixed the connect on start loop issue */
- m_processor->
m_busDevices[m_processor->GetLogicalAddresses().primary]
->m_powerStatus = CEC_POWER_STATUS_STANDBY;
+ m_processor->
GetPrimaryDevice()
->m_powerStatus = CEC_POWER_STATUS_STANDBY;
}
bool CSLCommandHandler::HandleVendorCommand(const cec_command &command)
}
bool CSLCommandHandler::HandleVendorCommand(const cec_command &command)
@@
-131,7
+131,7
@@
void CSLCommandHandler::TransmitVendorCommand05(const cec_logical_address iSourc
void CSLCommandHandler::HandleVendorCommandPowerOn(const cec_command &command)
{
void CSLCommandHandler::HandleVendorCommandPowerOn(const cec_command &command)
{
- CCECBusDevice *device = m_processor->
m_busDevices[m_processor->GetLogicalAddresses().primary]
;
+ CCECBusDevice *device = m_processor->
GetPrimaryDevice()
;
if (device)
{
m_bSLEnabled = true;
if (device)
{
m_bSLEnabled = true;
@@
-165,7
+165,7
@@
void CSLCommandHandler::HandleVendorCommandPowerOnStatus(const cec_command &comm
void CSLCommandHandler::TransmitDeckStatus(const cec_logical_address iDestination)
{
/* set deck status for the playback device */
void CSLCommandHandler::TransmitDeckStatus(const cec_logical_address iDestination)
{
/* set deck status for the playback device */
- CCECBusDevice *primary = m_processor->
m_busDevices[m_processor->GetLogicalAddresses().primary]
;
+ CCECBusDevice *primary = m_processor->
GetPrimaryDevice()
;
if (primary->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE || primary->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE)
{
((CCECPlaybackDevice *)primary)->SetDeckStatus(CEC_DECK_INFO_OTHER_STATUS_LG);
if (primary->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE || primary->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE)
{
((CCECPlaybackDevice *)primary)->SetDeckStatus(CEC_DECK_INFO_OTHER_STATUS_LG);
@@
-254,7
+254,7
@@
bool CSLCommandHandler::InitHandler(void)
m_iTransmitRetries = 4;
m_iTransmitTimeout = 500;
m_iTransmitRetries = 4;
m_iTransmitTimeout = 500;
- CCECBusDevice *primary = m_processor->
m_busDevices[m_processor->GetLogicalAddresses().primary]
;
+ CCECBusDevice *primary = m_processor->
GetPrimaryDevice()
;
if (m_busDevice->GetLogicalAddress() != primary->GetLogicalAddress())
{
primary->SetVendorId(CEC_VENDOR_LG, false);
if (m_busDevice->GetLogicalAddress() != primary->GetLogicalAddress())
{
primary->SetVendorId(CEC_VENDOR_LG, false);