Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Show the right info for currently program(s).

  • Loading branch information...
commit 7be0a86b38eab68d557d61b39eeb105c767b7d77 1 parent 7bc746d
@jajoflo jajoflo authored
View
5 xbmc/pvr/PVRGUIInfo.cpp
@@ -759,11 +759,10 @@ void CPVRGUIInfo::UpdateTimersToggle(void)
CStdString strActiveTimerTime;
/* safe to fetch these unlocked, since they're updated from the same thread as this one */
- unsigned int iBoundary = m_iRecordingTimerAmount > 0 ? m_iRecordingTimerAmount : m_iTimerAmount;
- if (m_iTimerInfoToggleCurrent < iBoundary)
+ if (m_iRecordingTimerAmount > 0)
{
vector<CPVRTimerInfoTag *> activeTags;
- g_PVRTimers->GetActiveTimers(&activeTags);
+ g_PVRTimers->GetActiveRecordings(&activeTags);
if (activeTags.at(m_iTimerInfoToggleCurrent) != 0)
{
strActiveTimerTitle.Format("%s", activeTags.at(m_iTimerInfoToggleCurrent)->m_strTitle);
View
17 xbmc/pvr/timers/PVRTimers.cpp
@@ -338,6 +338,23 @@ int CPVRTimers::GetNumActiveTimers(void) const
return iReturn;
}
+int CPVRTimers::GetActiveRecordings(vector<CPVRTimerInfoTag *> *tags) const
+{
+ int iInitialSize = tags->size();
+ CSingleLock lock(m_critSection);
+
+ for (map<CDateTime, vector<CPVRTimerInfoTag *>* >::const_iterator it = m_tags.begin(); it != m_tags.end(); it++)
+ {
+ for (unsigned int iTimerPtr = 0; iTimerPtr < it->second->size(); iTimerPtr++)
+ {
+ if (it->second->at(iTimerPtr)->IsRecording())
+ tags->push_back(it->second->at(iTimerPtr));
+ }
+ }
+
+ return tags->size() - iInitialSize;
+}
+
int CPVRTimers::GetNumActiveRecordings(void) const
{
int iReturn(0);
View
1  xbmc/pvr/timers/PVRTimers.h
@@ -80,6 +80,7 @@ namespace PVR
int GetActiveTimers(std::vector<CPVRTimerInfoTag *> *tags) const;
+ int GetActiveRecordings(std::vector<CPVRTimerInfoTag *> *tags) const;
/**
* The amount of timers in this container.
*/
Please sign in to comment.
Something went wrong with that request. Please try again.