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


C++ SChannels类代码示例

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


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

示例1: GetChannels

PVR_ERROR CHTSPData::GetChannelGroupMembers(PVR_HANDLE handle, const PVR_CHANNEL_GROUP &group)
{
  XBMC->Log(LOG_DEBUG, "%s - group '%s'", __FUNCTION__, group.strGroupName);

  for(unsigned int iTagPtr = 0; iTagPtr < m_tags.size(); iTagPtr++)
  {
    if (m_tags[iTagPtr].name != group.strGroupName)
      continue;

    SChannels channels = GetChannels(m_tags[iTagPtr].id);

    for(SChannels::iterator it = channels.begin(); it != channels.end(); ++it)
    {
      SChannel& channel = it->second;
      if (channel.radio != group.bIsRadio)
        continue;

      PVR_CHANNEL_GROUP_MEMBER tag;
      memset(&tag,0 , sizeof(PVR_CHANNEL_GROUP_MEMBER));

      tag.strGroupName     = group.strGroupName;
      tag.iChannelUniqueId = channel.id;
      tag.iChannelNumber   = channel.num;

      XBMC->Log(LOG_DEBUG, "%s - add channel %s (%d) to group '%s' channel number %d",
          __FUNCTION__, channel.name.c_str(), tag.iChannelUniqueId, group.strGroupName, channel.num);

      PVR->TransferChannelGroupMember(handle, &tag);
    }
  }

  return PVR_ERROR_NO_ERROR;
}
开发者ID:herrJones,项目名称:xbmc,代码行数:33,代码来源:HTSPData.cpp

示例2: url

bool CHTSPDirectory::GetChannels( const CURL &base
                                , CFileItemList &items
                                , SChannels channels
                                , int tag)
{
  CURL url(base);

  SEvent event;

  for(SChannels::iterator it = channels.begin(); it != channels.end(); it++)
  {
    if(!m_session->GetEvent(event, it->second.event))
      event.Clear();

    CFileItemPtr item(new CFileItem("", true));

    url.SetFileName("");
    item->SetPath(url.Get());
    CHTSPSession::ParseItem(it->second, tag, event, *item);
    item->m_bIsFolder = false;
    item->SetLabel(item->m_strTitle);
    item->m_strTitle = StringUtils::Format("%d", it->second.num);

    items.Add(item);
  }

  items.AddSortMethod(SortByTrackNumber,   554, LABEL_MASKS("%K[ - %B]", "%Z", "%L", ""));
  items.AddSortMethod(SortByAlbum,         558, LABEL_MASKS("%B", "%Z", "%L", ""), CSettings::Get().GetBool("filelists.ignorethewhensorting") ? SortAttributeIgnoreArticle : SortAttributeNone);
  items.AddSortMethod(SortByLabel,         551, LABEL_MASKS("%Z", "%B", "%L", ""), CSettings::Get().GetBool("filelists.ignorethewhensorting") ? SortAttributeIgnoreArticle : SortAttributeNone);

  items.SetContent("livetv");

  return !channels.empty();

}
开发者ID:deed02392,项目名称:xbmc,代码行数:35,代码来源:HTSPDirectory.cpp

示例3: GetChannels

PVR_ERROR CHTSPData::GetEpg(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd)
{
  PVR_ERROR retVal = PVR_ERROR_NO_ERROR;
  SChannels channels = GetChannels();

  if (channels.find(channel.iUniqueId) != channels.end())
  {

    /* Full channel update */
    if (GetProtocol() >= 6)
    {
      retVal = GetEvents(handle, channel.iUniqueId, iEnd);
    }
    /* Event at a time */
    else
    {
      uint32_t eventId = channels[channel.iUniqueId].event;
      if (eventId != 0)
      {
        do
        {
          retVal = GetEvent(handle, &eventId, iEnd);
        } while(eventId && retVal == PVR_ERROR_NO_ERROR);
      }
    }
  }

  return retVal;
}
开发者ID:MirceaA0,项目名称:xbmc-pvr-addons,代码行数:29,代码来源:HTSPData.cpp

示例4: url

bool CHTSPDirectory::GetChannels( const CURL &base
                                , CFileItemList &items
                                , SChannels channels
                                , int tag)
{
  CURL url(base);

  SEvent event;

  for(SChannels::iterator it = channels.begin(); it != channels.end(); it++)
  {
    if(!m_session->GetEvent(event, it->second.event))
      event.Clear();

    CFileItemPtr item(new CFileItem("", true));

    url.SetFileName("");
    item->SetPath(url.Get());
    CHTSPSession::ParseItem(it->second, tag, event, *item);
    item->m_bIsFolder = false;
    item->SetLabel(item->m_strTitle);
    item->m_strTitle.Format("%d", it->second.num);

    items.Add(item);
  }

  items.AddSortMethod(SORT_METHOD_TRACKNUM, 554, LABEL_MASKS("%K[ - %B]", "%Z", "%L", ""));

  if (g_guiSettings.GetBool("filelists.ignorethewhensorting"))
    items.AddSortMethod(SORT_METHOD_ALBUM_IGNORE_THE, 558,   LABEL_MASKS("%B", "%Z", "%L", ""));
  else
    items.AddSortMethod(SORT_METHOD_ALBUM,            558,   LABEL_MASKS("%B", "%Z", "%L", ""));

  if (g_guiSettings.GetBool("filelists.ignorethewhensorting"))
    items.AddSortMethod(SORT_METHOD_LABEL_IGNORE_THE, 551, LABEL_MASKS("%Z", "%B", "%L", ""));
  else
    items.AddSortMethod(SORT_METHOD_LABEL,            551, LABEL_MASKS("%Z", "%B", "%L", ""));

  items.SetContent("livetv");

  return !channels.empty();

}
开发者ID:Jdad,项目名称:xbmc,代码行数:43,代码来源:HTSPDirectory.cpp


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