for (uint8_t iPtr = 0; iPtr < 15; iPtr++)
if (m_logicalAddresses[iPtr])
{
- m_busDevices[iPtr]->SetInactiveDevice();
+ m_busDevices[iPtr]->SetInactiveSource();
m_busDevices[iPtr]->SetPhysicalAddress(iPhysicalAddress);
m_busDevices[iPtr]->TransmitPhysicalAddress();
}
}
}
-void CCECBusDevice::SetInactiveDevice(void)
+void CCECBusDevice::SetInactiveSource(void)
{
- CLockObject lock(&m_writeMutex);
- m_bActiveSource = false;
+ {
+ CLockObject lock(&m_writeMutex);
+ m_bActiveSource = false;
+ }
+
+ if (MyLogicalAddressContains(m_iLogicalAddress))
+ SetPowerStatus(CEC_POWER_STATUS_STANDBY);
}
void CCECBusDevice::SetActiveSource(void)
for (int iPtr = 0; iPtr < 16; iPtr++)
if (iPtr != m_iLogicalAddress)
- m_processor->m_busDevices[iPtr]->SetInactiveDevice();
+ m_processor->m_busDevices[iPtr]->SetInactiveSource();
m_bActiveSource = true;
m_powerStatus = CEC_POWER_STATUS_ON;
virtual bool IsActiveSource(void) const { return m_bActiveSource; }
- virtual void SetInactiveDevice(void);
+ virtual void SetInactiveSource(void);
virtual void SetActiveSource(void);
virtual bool TryLogicalAddress(void);
{
CCECBusDevice *device = GetDevice(command.destination);
if (device)
+ {
device->SetPowerStatus(CEC_POWER_STATUS_ON);
+ if (device->MyLogicalAddressContains(device->GetLogicalAddress()))
+ {
+ device->SetActiveSource();
+ device->TransmitActiveSource();
+
+ if (device->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE ||
+ device->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE)
+ ((CCECPlaybackDevice *)device)->TransmitDeckStatus(command.initiator);
+ }
+ }
}
m_processor->SetCurrentButton((cec_user_control_code) command.parameters[0]);