当前位置: 首页>>代码示例>>C++>>正文


C++ CCECBusDevice::MarkAsInactiveSource方法代码示例

本文整理汇总了C++中CCECBusDevice::MarkAsInactiveSource方法的典型用法代码示例。如果您正苦于以下问题:C++ CCECBusDevice::MarkAsInactiveSource方法的具体用法?C++ CCECBusDevice::MarkAsInactiveSource怎么用?C++ CCECBusDevice::MarkAsInactiveSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCECBusDevice的用法示例。


在下文中一共展示了CCECBusDevice::MarkAsInactiveSource方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetStreamPath

void CCECBusDevice::SetStreamPath(uint16_t iNewAddress, uint16_t iOldAddress /* = CEC_INVALID_PHYSICAL_ADDRESS */)
{
  if (iNewAddress != CEC_INVALID_PHYSICAL_ADDRESS)
    SetPowerStatus(CEC_POWER_STATUS_ON);

  CLockObject lock(m_mutex);
  if (iNewAddress != m_iStreamPath)
  {
    LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s (%X): stream path changed from %04x to %04x", GetLogicalAddressName(), m_iLogicalAddress, iOldAddress == 0 ? m_iStreamPath : iOldAddress, iNewAddress);
    m_iStreamPath = iNewAddress;
  }

  if (!LIB_CEC->IsValidPhysicalAddress(iNewAddress))
    return;

  CCECBusDevice *device = m_processor->GetDeviceByPhysicalAddress(iNewAddress);
  if (device)
  {
    // if a device is found with the new physical address, mark it as active, which will automatically mark all other devices as inactive
    device->MarkAsActiveSource();

    // respond with an active source message if this device is handled by libCEC
    if (device->IsHandledByLibCEC())
      device->TransmitActiveSource(true);
  }
  else
  {
    // try to find the device with the old address, and mark it as inactive when found
    device = m_processor->GetDeviceByPhysicalAddress(iOldAddress);
    if (device)
      device->MarkAsInactiveSource();
  }
}
开发者ID:,项目名称:,代码行数:33,代码来源:


注:本文中的CCECBusDevice::MarkAsInactiveSource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。