Example #1
0
bool CPVRChannel::UpdateFromClient(const CPVRChannelPtr &channel)
{
  assert(channel.get());

  SetClientID(channel->ClientID());
  SetStreamURL(channel->StreamURL());

  CSingleLock lock(m_critSection);

  if (m_iClientChannelNumber.channel    != channel->ClientChannelNumber() ||
      m_iClientChannelNumber.subchannel != channel->ClientSubChannelNumber() ||
      m_strInputFormat                  != channel->InputFormat() ||
      m_iClientEncryptionSystem         != channel->EncryptionSystem() ||
      m_strClientChannelName            != channel->ClientChannelName())
  {
    m_iClientChannelNumber.channel    = channel->ClientChannelNumber();
    m_iClientChannelNumber.subchannel = channel->ClientSubChannelNumber();
    m_strInputFormat                  = channel->InputFormat();
    m_iClientEncryptionSystem         = channel->EncryptionSystem();
    m_strClientChannelName            = channel->ClientChannelName();

    UpdateEncryptionName();
    SetChanged();
  }

  // only update the channel name and icon if the user hasn't changed them manually
  if (m_strChannelName.empty() || !IsUserSetName())
    SetChannelName(channel->ClientChannelName());
  if (m_strIconPath.empty() || !IsUserSetIcon())
    SetIconPath(channel->IconPath());

  return m_bChanged;
}
Example #2
0
CStdString CPVRClients::GetCurrentInputFormat(void) const
{
  CStdString strReturn;
  CPVRChannelPtr currentChannel;
  if (GetPlayingChannel(currentChannel))
    strReturn = currentChannel->InputFormat();

  return strReturn;
}
Example #3
0
/*!
 * @brief Copy over channel info from xbmcChannel to addonClient.
 * @param xbmcChannel The channel on XBMC's side.
 * @param addonChannel The channel on the addon's side.
 */
void CPVRClient::WriteClientChannelInfo(const CPVRChannelPtr &xbmcChannel, PVR_CHANNEL &addonChannel)
{
  assert(xbmcChannel.get());

  memset(&addonChannel, 0, sizeof(addonChannel));

  addonChannel.iUniqueId         = xbmcChannel->UniqueID();
  addonChannel.iChannelNumber    = xbmcChannel->ClientChannelNumber();
  addonChannel.iSubChannelNumber = xbmcChannel->ClientSubChannelNumber();
  strncpy(addonChannel.strChannelName, xbmcChannel->ClientChannelName().c_str(), sizeof(addonChannel.strChannelName) - 1);
  strncpy(addonChannel.strIconPath, xbmcChannel->IconPath().c_str(), sizeof(addonChannel.strIconPath) - 1);
  addonChannel.iEncryptionSystem = xbmcChannel->EncryptionSystem();
  addonChannel.bIsRadio          = xbmcChannel->IsRadio();
  addonChannel.bIsHidden         = xbmcChannel->IsHidden();
  strncpy(addonChannel.strInputFormat, xbmcChannel->InputFormat().c_str(), sizeof(addonChannel.strInputFormat) - 1);
  strncpy(addonChannel.strStreamURL, xbmcChannel->StreamURL().c_str(), sizeof(addonChannel.strStreamURL) - 1);
}