本文整理汇总了C++中CECDEVICEVEC类的典型用法代码示例。如果您正苦于以下问题:C++ CECDEVICEVEC类的具体用法?C++ CECDEVICEVEC怎么用?C++ CECDEVICEVEC使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CECDEVICEVEC类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsPresentDeviceType
bool CCECProcessor::IsPresentDeviceType(cec_device_type type)
{
CECDEVICEVEC devices;
m_busDevices->GetByType(type, devices);
CCECDeviceMap::FilterActive(devices);
return !devices.empty();
}
示例2: bReturn
bool CCECProcessor::PowerOnDevices(const cec_logical_address initiator, const CECDEVICEVEC &devices)
{
bool bReturn(true);
for (CECDEVICEVEC::const_iterator it = devices.begin(); it != devices.end(); it++)
bReturn &= (*it)->PowerOn(initiator);
return bReturn;
}
示例3: ToString
std::string CCECClient::GetConnectionInfo(void)
{
CStdString strLog;
strLog.Format("libCEC version = %s, client version = %s, firmware version = %d", ToString((cec_server_version)m_configuration.serverVersion), ToString((cec_client_version)m_configuration.clientVersion), m_configuration.iFirmwareVersion);
if (m_configuration.iFirmwareBuildDate != CEC_FW_BUILD_UNKNOWN)
{
time_t buildTime = (time_t)m_configuration.iFirmwareBuildDate;
strLog.AppendFormat(", firmware build date: %s", asctime(gmtime(&buildTime)));
strLog = strLog.Left((int)strLog.length() - 1); // strip \n added by asctime
strLog.append(" +0000");
}
// log the addresses that are being used
if (!m_configuration.logicalAddresses.IsEmpty())
{
strLog.append(", logical address(es) = ");
CECDEVICEVEC devices;
m_processor->GetDevices()->GetByLogicalAddresses(devices, m_configuration.logicalAddresses);
for (CECDEVICEVEC::iterator it = devices.begin(); it != devices.end(); it++)
strLog.AppendFormat("%s (%X) ", (*it)->GetLogicalAddressName(), (*it)->GetLogicalAddress());
}
if (!CLibCEC::IsValidPhysicalAddress(m_configuration.iPhysicalAddress))
strLog.AppendFormat(", base device: %s (%X), HDMI port number: %d", ToString(m_configuration.baseDevice), m_configuration.baseDevice, m_configuration.iHDMIPort);
else
strLog.AppendFormat(", physical address: %04x", m_configuration.iPhysicalAddress);
strLog.AppendFormat(", %s", LIB_CEC->GetLibInfo());
std::string strReturn(strLog.c_str());
return strReturn;
}
示例4: 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;
}
示例5: ToLogicalAddresses
cec_logical_addresses CCECDeviceMap::ToLogicalAddresses(const CECDEVICEVEC &devices)
{
cec_logical_addresses addresses;
addresses.Clear();
for (CECDEVICEVEC::const_iterator it = devices.begin(); it != devices.end(); it++)
addresses.Set((*it)->GetLogicalAddress());
return addresses;
}
示例6: 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();
}
示例7: FilterType
void CCECDeviceMap::FilterType(const cec_device_type type, CECDEVICEVEC &devices)
{
CECDEVICEVEC newDevices;
for (CECDEVICEVEC::const_iterator it = devices.begin(); it != devices.end(); it++)
{
if ((*it)->GetType() == type)
newDevices.push_back(*it);
}
devices = newDevices;
}
示例8: FilterLibCECControlled
void CCECDeviceMap::FilterLibCECControlled(CECDEVICEVEC &devices)
{
CECDEVICEVEC newDevices;
for (CECDEVICEVEC::const_iterator it = devices.begin(); it != devices.end(); it++)
{
if ((*it)->IsHandledByLibCEC())
newDevices.push_back(*it);
}
devices = newDevices;
}
示例9: t
void CCECDeviceMap::FilterTypes(const cec_device_type_list &types, CECDEVICEVEC &devices)
{
cec_device_type_list t(types);//silly, but needed to retain abi
CECDEVICEVEC newDevices;
for (CECDEVICEVEC::const_iterator it = devices.begin(); it != devices.end(); it++)
{
if (t.IsSet((*it)->GetType()))
newDevices.push_back(*it);
}
devices = newDevices;
}
示例10: FilterActive
void CCECDeviceMap::FilterActive(CECDEVICEVEC &devices)
{
CECDEVICEVEC newDevices;
for (CECDEVICEVEC::const_iterator it = devices.begin(); it != devices.end(); it++)
{
cec_bus_device_status status = (*it)->GetCurrentStatus();
if (status == CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC ||
status == CEC_DEVICE_STATUS_PRESENT)
newDevices.push_back(*it);
}
devices = newDevices;
}
示例11:
CCECBusDevice *CCECClient::GetDeviceByType(const cec_device_type type) const
{
// get all devices that match our logical addresses
CECDEVICEVEC devices;
m_processor->GetDevices()->GetByLogicalAddresses(devices, m_configuration.logicalAddresses);
// filter the type we need
CCECDeviceMap::FilterType(type, devices);
return devices.empty() ?
NULL :
*devices.begin();
}
示例12: SendSetMenuState
bool CCECClient::SendSetMenuState(const cec_menu_state state, bool bSendUpdate /* = true */)
{
CECDEVICEVEC devices;
// set the menu state for all devices that are controlled by us
m_processor->GetDevices()->GetByLogicalAddresses(devices, m_configuration.logicalAddresses);
for (CECDEVICEVEC::iterator it = devices.begin(); it != devices.end(); it++)
{
(*it)->SetMenuState(state);
if (bSendUpdate)
(*it)->TransmitMenuState(CECDEVICE_TV, false);
}
return true;
}
示例13: GetChildrenOf
void CCECDeviceMap::GetChildrenOf(CECDEVICEVEC& devices, CCECBusDevice* device) const
{
devices.clear();
if (!device)
return;
uint16_t iPA = device->GetCurrentPhysicalAddress();
for (CECDEVICEMAP::const_iterator it = m_busDevices.begin(); it != m_busDevices.end(); it++)
{
uint16_t iCurrentPA = it->second->GetCurrentPhysicalAddress();
if (CCECTypeUtils::PhysicalAddressIsIncluded(iPA, iCurrentPA))
devices.push_back(it->second);
}
}
示例14: GetWakeDevices
void CCECDeviceMap::GetWakeDevices(const libcec_configuration &configuration, CECDEVICEVEC &devices) const
{
for (CECDEVICEMAP::const_iterator it = m_busDevices.begin(); it != m_busDevices.end(); it++)
{
if (configuration.wakeDevices[(uint8_t)it->first])
devices.push_back(it->second);
}
}
示例15: SendSetInactiveView
bool CCECClient::SendSetInactiveView(void)
{
CECDEVICEVEC devices;
// mark all devices that are controlled by us as inactive source
m_processor->GetDevices()->GetByLogicalAddresses(devices, m_configuration.logicalAddresses);
for (CECDEVICEVEC::iterator it = devices.begin(); it != devices.end(); it++)
{
if ((*it)->IsActiveSource())
{
(*it)->MarkAsInactiveSource();
return (*it)->TransmitInactiveSource();
}
}
return true;
}