MCPcopy Create free account
hub / github.com/Pulse-Eight/libcec / GetPlaybackDevice

Method GetPlaybackDevice

src/libcec/CECClient.cpp:569–590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

567}
568
569CCECPlaybackDevice *CCECClient::GetPlaybackDevice(void)
570{
571 CCECPlaybackDevice *device(NULL);
572 CECDEVICEVEC devices;
573
574 // get the playback devices
575 m_processor->GetDevices()->GetByLogicalAddresses(devices, m_configuration.logicalAddresses);
576 CCECDeviceMap::FilterType(CEC_DEVICE_TYPE_PLAYBACK_DEVICE, devices);
577
578 // no matches, get the recording devices
579 if (devices.empty())
580 {
581 m_processor->GetDevices()->GetByLogicalAddresses(devices, m_configuration.logicalAddresses);
582 CCECDeviceMap::FilterType(CEC_DEVICE_TYPE_RECORDING_DEVICE, devices);
583 }
584
585 // get the first device that matches, and cast it to CCECPlaybackDevice
586 if (!devices.empty())
587 device = (*devices.begin())->AsPlaybackDevice();
588
589 return device;
590}
591
592cec_logical_address CCECClient::GetPrimaryLogicalAddress(void)
593{

Callers

nothing calls this directly

Calls 3

GetByLogicalAddressesMethod · 0.80
GetDevicesMethod · 0.80
AsPlaybackDeviceMethod · 0.80

Tested by

no test coverage detected