Example #1
0
bool CPVRChannelGroup::ToggleChannelLocked(const CFileItem &item)
{
  if (!item.HasPVRChannelInfoTag())
    return false;

  CSingleLock lock(m_critSection);

  /* get the real channel from the group */
  CPVRChannel *channel = GetByUniqueID(item.GetPVRChannelInfoTag()->UniqueID());
  if (!channel)
    return false;

  channel->SetLocked(!channel->IsLocked());

  return true;
}
Example #2
0
bool CPVRChannelGroup::UpdateChannel(const CFileItem &item, bool bHidden, bool bVirtual, bool bEPGEnabled, bool bParentalLocked, int iEPGSource, int iChannelNumber, const CStdString &strChannelName, const CStdString &strIconPath, const CStdString &strStreamURL)
{
  if (!item.HasPVRChannelInfoTag())
    return false;

  CSingleLock lock(m_critSection);

  /* get the real channel from the group */
  CPVRChannel *channel = GetByUniqueID(item.GetPVRChannelInfoTag()->UniqueID());
  if (!channel)
    return false;

  channel->SetChannelName(strChannelName);
  channel->SetHidden(bHidden);
  channel->SetLocked(bParentalLocked);
  channel->SetIconPath(strIconPath);

  if (bVirtual)
    channel->SetStreamURL(strStreamURL);
  if (iEPGSource == 0)
    channel->SetEPGScraper("client");

  // TODO add other scrapers
  channel->SetEPGEnabled(bEPGEnabled);

  /* set new values in the channel tag */
  if (bHidden)
  {
    SortByChannelNumber(); // or previous changes will be overwritten
    RemoveFromGroup(*channel);
  }
  else
  {
    SetChannelNumber(*channel, iChannelNumber);
  }

  return true;
}