示例#1
0
文件: PVRChannel.cpp 项目: Gujs/xbmc
int CPVRChannel::GetEPG(CFileItemList &results) const
{
    CEpg *epg = GetEPG();
    if (!epg)
    {
        CLog::Log(LOGDEBUG, "PVR - %s - cannot get EPG for channel '%s'",
                  __FUNCTION__, m_strChannelName.c_str());
        return -1;
    }

    return epg->Get(results);
}
示例#2
0
int CPVRChannelGroup::GetEPGAll(CFileItemList &results) const
{
  int iInitialSize = results.Size();
  CEpg* epg;
  CPVRChannelPtr channel;
  CSingleLock lock(m_critSection);

  for (PVR_CHANNEL_GROUP_SORTED_MEMBERS::const_iterator it = m_sortedMembers.begin(); it != m_sortedMembers.end(); ++it)
  {
    channel = (*it).channel;
    if (!channel->IsHidden() && (epg = channel->GetEPG()) != NULL)
    {
      // XXX channel pointers aren't set in some occasions. this works around the issue, but is not very nice
      epg->SetChannel(channel);
      epg->Get(results);
    }
  }

  return results.Size() - iInitialSize;
}
示例#3
0
int CPVRChannelGroup::GetEPGAll(CFileItemList &results)
{
  int iInitialSize = results.Size();
  CSingleLock lock(m_critSection);

  for (unsigned int iChannelPtr = 0; iChannelPtr < m_members.size(); iChannelPtr++)
  {
    if (m_members.at(iChannelPtr).channel && !m_members.at(iChannelPtr).channel->IsHidden())
    {
      CEpg* epg = m_members.at(iChannelPtr).channel->GetEPG();
      if (epg)
      {
        // XXX channel pointers aren't set in some occasions. this works around the issue, but is not very nice
        epg->SetChannel(m_members.at(iChannelPtr).channel);
        epg->Get(results);
      }
    }
  }

  return results.Size() - iInitialSize;
}
示例#4
0
int CPVRChannelGroup::GetEPGAll(CFileItemList &results) const
{
  int iInitialSize = results.Size();
  CEpg* epg;
  CSingleLock lock(m_critSection);

  for (std::vector<PVRChannelGroupMember>::const_iterator it = m_members.begin(); it != m_members.end(); ++it)
  {
    if ((*it).channel && !(*it).channel->IsHidden())
    {
      epg = (*it).channel->GetEPG();
      if (epg)
      {
        // XXX channel pointers aren't set in some occasions. this works around the issue, but is not very nice
        epg->SetChannel((*it).channel);
        epg->Get(results);
      }
    }
  }

  return results.Size() - iInitialSize;
}
示例#5
0
JSONRPC_STATUS CPVROperations::GetBroadcasts(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
  if (!g_PVRManager.IsStarted())
    return FailedToExecute;

  CPVRChannelGroupsContainer *channelGroupContainer = g_PVRManager.ChannelGroups();
  if (channelGroupContainer == NULL)
    return FailedToExecute;

  CPVRChannelPtr channel = channelGroupContainer->GetChannelById((int)parameterObject["channelid"].asInteger());
  if (channel == NULL)
    return InvalidParams;

  CEpg *channelEpg = channel->GetEPG();
  if (channelEpg == NULL)
    return InternalError;

  CFileItemList programFull;
  channelEpg->Get(programFull);

  HandleFileItemList("broadcastid", false, "broadcasts", programFull, parameterObject, result, programFull.Size(), true);

  return OK;
}