diff options
author | Lars Op den Kamp <lars@opdenkamp.eu> | 2012-11-11 03:44:42 +0100 |
---|---|---|
committer | Lars Op den Kamp <lars@opdenkamp.eu> | 2012-11-11 04:07:11 +0100 |
commit | cd07a0e8a8140a224ab693bdf2da60b25f5a34ea (patch) | |
tree | bae1fbe30179099617a2345529618201fb4f2151 | |
parent | 0a0085c9f724ac731a2a8a91b947e3b9aa1b2bdd (diff) |
[pvr/epg] fixed - start+end times weren't updated after the current tag expired after 6eecd3ddd7f0363abd027591e55e6a1d15d7ce0f
-rw-r--r-- | xbmc/GUIInfoManager.cpp | 26 | ||||
-rw-r--r-- | xbmc/GUIInfoManager.h | 8 |
2 files changed, 30 insertions, 4 deletions
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp index 6a831b84d1..4c2093e097 100644 --- a/xbmc/GUIInfoManager.cpp +++ b/xbmc/GUIInfoManager.cpp @@ -2949,8 +2949,9 @@ CStdString CGUIInfoManager::GetMultiInfoLabel(const GUIInfo &info, int contextWi else if (info.m_info == PLAYER_FINISH_TIME) { CDateTime time; - if (m_currentFile->HasEPGInfoTag()) - time = m_currentFile->GetEPGInfoTag()->EndAsLocalTime(); + CEpgInfoTag currentTag; + if (GetEpgInfoTag(currentTag)) + time = currentTag.EndAsLocalTime(); else { time = CDateTime::GetCurrentDateTime(); @@ -2961,8 +2962,9 @@ CStdString CGUIInfoManager::GetMultiInfoLabel(const GUIInfo &info, int contextWi else if (info.m_info == PLAYER_START_TIME) { CDateTime time; - if (m_currentFile->HasEPGInfoTag()) - time = m_currentFile->GetEPGInfoTag()->StartAsLocalTime(); + CEpgInfoTag currentTag; + if (GetEpgInfoTag(currentTag)) + time = currentTag.StartAsLocalTime(); else { time = CDateTime::GetCurrentDateTime(); @@ -5380,3 +5382,19 @@ bool CGUIInfoManager::ConditionsChangedValues(const std::map<int, bool>& map) } return false; } + +bool CGUIInfoManager::GetEpgInfoTag(CEpgInfoTag& tag) const +{ + if (m_currentFile->HasEPGInfoTag()) + { + CEpgInfoTag* currentTag = m_currentFile->GetEPGInfoTag(); + while (currentTag && !currentTag->IsActive()) + currentTag = currentTag->GetNextEvent().get(); + if (currentTag) + { + tag = *currentTag; + return true; + } + } + return false; +} diff --git a/xbmc/GUIInfoManager.h b/xbmc/GUIInfoManager.h index 1868753dca..63f906095c 100644 --- a/xbmc/GUIInfoManager.h +++ b/xbmc/GUIInfoManager.h @@ -633,6 +633,7 @@ namespace INFO // forward class CInfoLabel; class CGUIWindow; +namespace EPG { class CEpgInfoTag; } // Info Flags // Stored in the top 8 bits of GUIInfo::m_data1 @@ -863,6 +864,13 @@ protected: CStdString GetAudioScrobblerLabel(int item); + /*! + * @brief Get the EPG tag that is currently active + * @param tag The active tag + * @return True if an EPG tag is active and 'tag' was updated, false otherwise + */ + bool GetEpgInfoTag(EPG::CEpgInfoTag& tag) const; + // Conditional string parameters are stored here CStdStringArray m_stringParameters; |