Example #1
0
void CPVRGUIInfo::UpdateTimersToggle(void)
{
  if (!TimerInfoToggle())
    return;

  CStdString strActiveTimerTitle;
  CStdString strActiveTimerChannelName;
  CStdString strActiveTimerChannelIcon;
  CStdString strActiveTimerTime;

  /* safe to fetch these unlocked, since they're updated from the same thread as this one */
  if (m_iRecordingTimerAmount > 0)
  {
    vector<CFileItemPtr> activeTags = g_PVRTimers->GetActiveRecordings();
    if (m_iTimerInfoToggleCurrent < activeTags.size() && activeTags.at(m_iTimerInfoToggleCurrent)->HasPVRTimerInfoTag())
    {
      CPVRTimerInfoTag *tag = activeTags.at(m_iTimerInfoToggleCurrent)->GetPVRTimerInfoTag();
      strActiveTimerTitle.Format("%s",       tag->Title());
      strActiveTimerChannelName.Format("%s", tag->ChannelName());
      strActiveTimerChannelIcon.Format("%s", tag->ChannelIcon());
      strActiveTimerTime.Format("%s",        tag->StartAsLocalTime().GetAsLocalizedDateTime(false, false));
    }
  }

  CSingleLock lock(m_critSection);
  m_strActiveTimerTitle         = strActiveTimerTitle;
  m_strActiveTimerChannelName   = strActiveTimerChannelName;
  m_strActiveTimerChannelIcon   = strActiveTimerChannelIcon;
  m_strActiveTimerTime          = strActiveTimerTime;
}
Example #2
0
void CPVRGUIInfo::UpdateNextTimer(void)
{
  CStdString strNextRecordingTitle;
  CStdString strNextRecordingChannelName;
  CStdString strNextRecordingChannelIcon;
  CStdString strNextRecordingTime;
  CStdString strNextTimerInfo;

  CPVRTimerInfoTag tag;
  if (g_PVRTimers->GetNextActiveTimer(&tag))
  {
    strNextRecordingTitle.Format("%s",       tag.m_strTitle);
    strNextRecordingChannelName.Format("%s", tag.ChannelName());
    strNextRecordingChannelIcon.Format("%s", tag.ChannelIcon());
    strNextRecordingTime.Format("%s",        tag.StartAsLocalTime().GetAsLocalizedDateTime(false, false));

    strNextTimerInfo.Format("%s %s %s %s",
        g_localizeStrings.Get(19106),
        tag.StartAsLocalTime().GetAsLocalizedDate(true),
        g_localizeStrings.Get(19107),
        tag.StartAsLocalTime().GetAsLocalizedTime("HH:mm", false));
  }

  CSingleLock lock(m_critSection);
  m_strNextRecordingTitle       = strNextRecordingTitle;
  m_strNextRecordingChannelName = strNextRecordingChannelName;
  m_strNextRecordingChannelIcon = strNextRecordingChannelIcon;
  m_strNextRecordingTime        = strNextRecordingTime;
  m_strNextTimerInfo            = strNextTimerInfo;
}
Example #3
0
void CPVRGUIInfo::UpdateNextTimer(void)
{
  CStdString strNextRecordingTitle;
  CStdString strNextRecordingChannelName;
  CStdString strNextRecordingChannelIcon;
  CStdString strNextRecordingTime;
  CStdString strNextTimerInfo;

  CFileItemPtr tag = g_PVRTimers->GetNextActiveTimer();
  if (tag && tag->HasPVRTimerInfoTag())
  {
    CPVRTimerInfoTag *timer = tag->GetPVRTimerInfoTag();
    strNextRecordingTitle.Format("%s",       timer->Title());
    strNextRecordingChannelName.Format("%s", timer->ChannelName());
    strNextRecordingChannelIcon.Format("%s", timer->ChannelIcon());
    strNextRecordingTime.Format("%s",        timer->StartAsLocalTime().GetAsLocalizedDateTime(false, false));

    strNextTimerInfo.Format("%s %s %s %s",
        g_localizeStrings.Get(19106),
        timer->StartAsLocalTime().GetAsLocalizedDate(true),
        g_localizeStrings.Get(19107),
        timer->StartAsLocalTime().GetAsLocalizedTime("HH:mm", false));
  }

  CSingleLock lock(m_critSection);
  m_strNextRecordingTitle       = strNextRecordingTitle;
  m_strNextRecordingChannelName = strNextRecordingChannelName;
  m_strNextRecordingChannelIcon = strNextRecordingChannelIcon;
  m_strNextRecordingTime        = strNextRecordingTime;
  m_strNextTimerInfo            = strNextTimerInfo;
}
Example #4
0
void CPVRGUIInfo::UpdateTimersToggle(void)
{
  CSingleLock lock(m_critSection);

  if (!TimerInfoToggle())
    return;

  m_strActiveTimerTitle         = "";
  m_strActiveTimerChannelName   = "";
  m_strActiveTimerChannelIcon   = "";
  m_strActiveTimerTime          = "";

  unsigned int iBoundary = m_iRecordingTimerAmount > 0 ? m_iRecordingTimerAmount : m_iTimerAmount;
  if (m_iTimerInfoToggleCurrent < iBoundary)
  {
    CPVRTimerInfoTag tag;
    if (g_PVRTimers->GetTimerByIndex(m_iTimerInfoToggleCurrent, &tag))
    {
      m_strActiveTimerTitle.Format("%s",       tag.m_strTitle);
      m_strActiveTimerChannelName.Format("%s", tag.ChannelName());
      m_strActiveTimerChannelIcon.Format("%s", tag.ChannelIcon());
      m_strActiveTimerTime.Format("%s",        tag.StartAsLocalTime().GetAsLocalizedDateTime(false, false));
    }
  }
}