From 8d3a0a16fb8c3248d9f9aa05f63d9351a7523d81 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Thu, 5 Mar 2015 01:18:59 +0100 Subject: [PATCH] [pvr] added: CPVRRecording::IsBeingRecorded() --- xbmc/pvr/recordings/PVRRecording.cpp | 10 ++++++++++ xbmc/pvr/recordings/PVRRecording.h | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/xbmc/pvr/recordings/PVRRecording.cpp b/xbmc/pvr/recordings/PVRRecording.cpp index e516212c2a32a..c34604a4b5f19 100644 --- a/xbmc/pvr/recordings/PVRRecording.cpp +++ b/xbmc/pvr/recordings/PVRRecording.cpp @@ -441,3 +441,13 @@ CPVRChannelPtr CPVRRecording::Channel(void) const } return CPVRChannelPtr(); } + +bool CPVRRecording::IsBeingRecorded(void) const +{ + if (m_iEpgEventId) + { + EPG::CEpgInfoTagPtr epgTag = EPG::CEpgContainer::Get().GetTagById(m_iEpgEventId); + return epgTag ? epgTag->HasRecording() : false; + } + return false; +} diff --git a/xbmc/pvr/recordings/PVRRecording.h b/xbmc/pvr/recordings/PVRRecording.h index eefdd23c304cc..d65c4a1512dbc 100644 --- a/xbmc/pvr/recordings/PVRRecording.h +++ b/xbmc/pvr/recordings/PVRRecording.h @@ -212,9 +212,16 @@ namespace PVR /*! * @return Get the channel on which this recording is/was running + * @note Only works if the recording has an EPG id provided by the add-on */ CPVRChannelPtr Channel(void) const; + /*! + * @return True while the recording is running + * @note Only works if the recording has an EPG id provided by the add-on + */ + bool IsBeingRecorded(void) const; + private: CDateTime m_recordingTime; /*!< start time of the recording */ bool m_bGotMetaData;