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


C++ AEDeviceList::end方法代码示例

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


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

示例1: SettingOptionsAudioDevicesFillerGeneral

void CAEFactory::SettingOptionsAudioDevicesFillerGeneral(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string &current, bool passthrough)
{
  current = ((const CSettingString*)setting)->GetValue();
  std::string firstDevice;

  bool foundValue = false;
  AEDeviceList sinkList;
  EnumerateOutputDevices(sinkList, passthrough);
#if !defined(TARGET_DARWIN)
  if (sinkList.size() == 0)
    list.push_back(std::make_pair("Error - no devices found", "error"));
  else
  {
#endif
    for (AEDeviceList::const_iterator sink = sinkList.begin(); sink != sinkList.end(); sink++)
    {
      if (sink == sinkList.begin())
        firstDevice = sink->second;

#if defined(TARGET_DARWIN)
      list.push_back(std::make_pair(sink->first, sink->first));
#else
      list.push_back(std::make_pair(sink->first, sink->second));
#endif

      if (StringUtils::EqualsNoCase(current, sink->second))
        foundValue = true;
    }
#if !defined(TARGET_DARWIN)
  }
#endif

  if (!foundValue)
    current = firstDevice;
}
开发者ID:nremenda,项目名称:xbmc,代码行数:35,代码来源:AEFactory.cpp

示例2: SettingOptionsAudioDevicesFillerGeneral

void CActiveAESettings::SettingOptionsAudioDevicesFillerGeneral(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string &current, bool passthrough)
{
  current = ((const CSettingString*)setting)->GetValue();
  std::string firstDevice;

  bool foundValue = false;
  AEDeviceList sinkList;
  CServiceBroker::GetActiveAE().EnumerateOutputDevices(sinkList, passthrough);
  if (sinkList.empty())
    list.push_back(std::make_pair("Error - no devices found", "error"));
  else
  {
    for (AEDeviceList::const_iterator sink = sinkList.begin(); sink != sinkList.end(); ++sink)
    {
      if (sink == sinkList.begin())
        firstDevice = sink->second;

      list.push_back(std::make_pair(sink->first, sink->second));

      if (StringUtils::EqualsNoCase(current, sink->second))
        foundValue = true;
    }
  }

  if (!foundValue)
    current = firstDevice;
}
开发者ID:TodPheonix,项目名称:xbmc,代码行数:27,代码来源:ActiveAESettings.cpp

示例3: VerifyOutputDevice

void CAEFactory::VerifyOutputDevice(std::string &device, bool passthrough)
{
  AEDeviceList devices;
  EnumerateOutputDevices(devices, passthrough);
  std::string firstDevice;

  for (AEDeviceList::const_iterator deviceIt = devices.begin(); deviceIt != devices.end(); deviceIt++)
  {
    std::string currentDevice = deviceIt->second;
    /* remember the first device so we can default to it if required */
    if (firstDevice.empty())
      firstDevice = deviceIt->second;

    if (deviceIt->second == device)
      return;
    else if (deviceIt->first == device)
    {
      device = deviceIt->second;
      return;
    }
  }

  /* if the device wasnt found, set it to the first viable output */
  device = firstDevice;
}
开发者ID:AFFLUENTSOCIETY,项目名称:SPMC,代码行数:25,代码来源:AEFactory.cpp


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