From cd07a0e8a8140a224ab693bdf2da60b25f5a34ea Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Sun, 11 Nov 2012 03:44:42 +0100 Subject: [pvr/epg] fixed - start+end times weren't updated after the current tag expired after 6eecd3ddd7f0363abd027591e55e6a1d15d7ce0f --- xbmc/GUIInfoManager.cpp | 26 ++++++++++++++++++++++---- 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& 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; -- cgit v1.2.3