CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamPath);
if (device)
{
- for (unsigned int iPtr = 0; iPtr < 16; iPtr++)
- m_busDevices[iPtr]->m_bActiveSource = false;
-
- device->m_bActiveSource = true;
- device->m_powerStatus = CEC_POWER_STATUS_ON;
-
+ device->SetActiveDevice();
bReturn = true;
}
return m_powerStatus;
}
-const cec_vendor_id CCECBusDevice::GetVendorId(void)
+cec_vendor_id CCECBusDevice::GetVendorId(void)
{
if (m_vendor == CEC_VENDOR_UNKNOWN)
{
}
}
+void CCECBusDevice::SetInactiveDevice(void)
+{
+ CLockObject lock(&m_mutex);
+ m_bActiveSource = false;
+}
+
+void CCECBusDevice::SetActiveDevice(void)
+{
+ CLockObject lock(&m_mutex);
+
+ for (int iPtr = 0; iPtr < 16; iPtr++)
+ if (iPtr != m_iLogicalAddress)
+ m_processor->m_busDevices[iPtr]->SetInactiveDevice();
+
+ m_bActiveSource = true;
+ m_powerStatus = CEC_POWER_STATUS_ON;
+}
+
void CCECBusDevice::SetPhysicalAddress(uint16_t iNewAddress)
{
if (iNewAddress > 0)
virtual cec_power_status GetPowerStatus(void);
virtual CCECProcessor * GetProcessor(void) const { return m_processor; }
virtual cec_device_type GetType(void) const { return m_type; }
- virtual const cec_vendor_id GetVendorId(void);
+ virtual cec_vendor_id GetVendorId(void);
virtual const char * GetVendorName(void);
virtual bool MyLogicalAddressContains(cec_logical_address address) const;
+ virtual void SetInactiveDevice(void);
+ virtual void SetActiveDevice(void);
+
virtual void SetPhysicalAddress(uint16_t iNewAddress);
virtual void SetStreamPath(uint16_t iNewAddress, uint16_t iOldAddress = 0);
virtual void SetCecVersion(const cec_version newVersion);