本文整理汇总了C++中CECDEVICEVEC::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ CECDEVICEVEC::empty方法的具体用法?C++ CECDEVICEVEC::empty怎么用?C++ CECDEVICEVEC::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CECDEVICEVEC
的用法示例。
在下文中一共展示了CECDEVICEVEC::empty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendSetActiveSource
bool CCECClient::SendSetActiveSource(const cec_device_type type /* = CEC_DEVICE_TYPE_RESERVED */)
{
// get the devices that are controlled by us
CECDEVICEVEC devices;
m_processor->GetDevices()->GetByLogicalAddresses(devices, m_configuration.logicalAddresses);
// filter out the device that matches the given type
if (type != CEC_DEVICE_TYPE_RESERVED)
CCECDeviceMap::FilterType(type, devices);
// no devices left, re-fetch the list of devices that are controlled by us
if (devices.empty())
m_processor->GetDevices()->GetByLogicalAddresses(devices, m_configuration.logicalAddresses);
if (!devices.empty())
{
// get the first device from the list
CCECBusDevice *device = *devices.begin();
// and activate it
if (!m_processor->CECInitialised())
device->MarkAsActiveSource();
else if (device->HasValidPhysicalAddress())
return device->ActivateSource();
}
return false;
}
示例2: IsPresentDeviceType
bool CCECProcessor::IsPresentDeviceType(cec_device_type type)
{
CECDEVICEVEC devices;
m_busDevices->GetByType(type, devices);
CCECDeviceMap::FilterActive(devices);
return !devices.empty();
}
示例3: IsActiveDeviceType
bool CCECClient::IsActiveDeviceType(const cec_device_type type)
{
CECDEVICEVEC activeDevices;
if (m_processor)
m_processor->GetDevices()->GetActive(activeDevices);
CCECDeviceMap::FilterType(type, activeDevices);
return !activeDevices.empty();
}
示例4:
CCECPlaybackDevice *CCECClient::GetPlaybackDevice(void)
{
CCECPlaybackDevice *device(NULL);
CECDEVICEVEC devices;
// get the playback devices
m_processor->GetDevices()->GetByLogicalAddresses(devices, m_configuration.logicalAddresses);
CCECDeviceMap::FilterType(CEC_DEVICE_TYPE_PLAYBACK_DEVICE, devices);
// no matches, get the recording devices
if (devices.empty())
{
m_processor->GetDevices()->GetByLogicalAddresses(devices, m_configuration.logicalAddresses);
CCECDeviceMap::FilterType(CEC_DEVICE_TYPE_RECORDING_DEVICE, devices);
}
// get the first device that matches, and cast it to CCECPlaybackDevice
if (!devices.empty())
device = (*devices.begin())->AsPlaybackDevice();
return device;
}
示例5: OnRegister
bool CCECClient::OnRegister(void)
{
// return false if already initialised
if (IsInitialised())
return true;
// get all device we control
CECDEVICEVEC devices;
m_processor->GetDevices()->GetByLogicalAddresses(devices, m_configuration.logicalAddresses);
// return false when no devices were found
if (devices.empty())
{
LIB_CEC->AddLog(CEC_LOG_WARNING, "cannot find the primary device (logical address %x)", GetPrimaryLogicalAdddress());
return false;
}
// mark as initialised
SetInitialised(true);
// configure all devices
for (CECDEVICEVEC::iterator it = devices.begin(); it != devices.end(); it++)
{
// only set our OSD name for the primary device
if ((*it)->GetLogicalAddress() == GetPrimaryLogicalAdddress())
(*it)->SetOSDName(m_configuration.strDeviceName);
// set the default menu language for devices we control
(*it)->SetMenuLanguage(m_configuration.strDeviceLanguage);
}
// set the physical address
SetPhysicalAddress(m_configuration);
// make the primary device the active source if the option is set
if (m_configuration.bActivateSource == 1)
GetPrimaryDevice()->ActivateSource(500);
return true;
}