aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/skin.estuary/xml/Custom_1109_TopBarOverlay.xml10
-rw-r--r--addons/skin.estuary/xml/DialogSeekBar.xml31
-rw-r--r--addons/skin.estuary/xml/MusicOSD.xml32
-rw-r--r--addons/skin.estuary/xml/Variables.xml1
-rw-r--r--addons/skin.estuary/xml/VideoOSD.xml26
-rw-r--r--xbmc/GUIInfoManager.cpp40
-rw-r--r--xbmc/addons/PVRClient.cpp33
-rw-r--r--xbmc/addons/PVRClient.h21
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h10
-rw-r--r--xbmc/guiinfo/GUIInfoLabels.h6
-rw-r--r--xbmc/pvr/PVRGUIInfo.cpp91
-rw-r--r--xbmc/pvr/PVRGUIInfo.h3
-rw-r--r--xbmc/pvr/addons/PVRClients.cpp27
-rw-r--r--xbmc/pvr/addons/PVRClients.h18
-rw-r--r--xbmc/pvr/epg/EpgInfoTag.cpp18
15 files changed, 201 insertions, 166 deletions
diff --git a/addons/skin.estuary/xml/Custom_1109_TopBarOverlay.xml b/addons/skin.estuary/xml/Custom_1109_TopBarOverlay.xml
index ae0afa4237..25a9b6243f 100644
--- a/addons/skin.estuary/xml/Custom_1109_TopBarOverlay.xml
+++ b/addons/skin.estuary/xml/Custom_1109_TopBarOverlay.xml
@@ -88,8 +88,14 @@
<height>100</height>
<width>auto</width>
<visible>!String.isempty(Player.Duration)</visible>
- <visible>Player.HasVideo + !Player.HasGame</visible>
- <visible>!VideoPlayer.Content(LiveTV) | VideoPlayer.HasEpg</visible>
+ <visible>Player.HasVideo + ![Player.HasGame | VideoPlayer.HasEpg]</visible>
+ </control>
+ <control type="label">
+ <label>$INFO[PVR.EpgEventFinishTime,$LOCALIZE[31080]: ]</label>
+ <shadowcolor>text_shadow</shadowcolor>
+ <height>100</height>
+ <width>auto</width>
+ <visible>VideoPlayer.HasEpg</visible>
</control>
<control type="image">
<top>2</top>
diff --git a/addons/skin.estuary/xml/DialogSeekBar.xml b/addons/skin.estuary/xml/DialogSeekBar.xml
index bbc7fa4cb0..4d9d7cf93f 100644
--- a/addons/skin.estuary/xml/DialogSeekBar.xml
+++ b/addons/skin.estuary/xml/DialogSeekBar.xml
@@ -104,7 +104,20 @@
<wrapmultiline>true</wrapmultiline>
<animation effect="fade" time="200">VisibleChange</animation>
<label>$INFO[Player.TimeRemaining,[COLOR button_focus]$LOCALIZE[31134]:[CR][/COLOR]]</label>
- <visible>![Player.ShowInfo | Window.IsVisible(playerprocessinfo)]</visible>
+ <visible>![Player.ShowInfo | Window.IsVisible(playerprocessinfo) | VideoPlayer.HasEpg]</visible>
+ </control>
+ <control type="label">
+ <top>110</top>
+ <right>20</right>
+ <width>400</width>
+ <height>50</height>
+ <align>right</align>
+ <aligny>center</aligny>
+ <font>font30</font>
+ <wrapmultiline>true</wrapmultiline>
+ <animation effect="fade" time="200">VisibleChange</animation>
+ <label>$INFO[PVR.EpgEventRemainingTime,[COLOR button_focus]$LOCALIZE[31134]:[CR][/COLOR]]</label>
+ <visible>![Player.ShowInfo | Window.IsVisible(playerprocessinfo)] + VideoPlayer.HasEpg</visible>
</control>
</control>
<control type="label">
@@ -173,6 +186,7 @@
<info>PVR.timeshiftprogress</info>
<texturebg border="3" colordiffuse="60FFFFFF">colors/white50.png</texturebg>
<midtexture>colors/white50.png</midtexture>
+ <visible>VideoPlayer.Content(livetv)</visible>
</control>
</control>
<control type="progress">
@@ -180,10 +194,20 @@
<top>70</top>
<width>100%</width>
<height>15</height>
+ <info>PVR.Progress</info>
+ <texturebg border="3" colordiffuse="60FFFFFF">colors/white50.png</texturebg>
+ <midtexture colordiffuse="button_focus">colors/white.png</midtexture>
+ <visible>VideoPlayer.HasEpg</visible>
+ </control>
+ <control type="progress">
+ <left>0</left>
+ <top>70</top>
+ <width>100%</width>
+ <height>15</height>
<info>Player.ProgressCache</info>
<texturebg border="3" colordiffuse="60FFFFFF">colors/white50.png</texturebg>
<midtexture>colors/white50.png</midtexture>
- <visible>!Player.ChannelPreviewActive</visible>
+ <visible>!VideoPlayer.Content(livetv)</visible>
</control>
<control type="progress">
<left>0</left>
@@ -193,6 +217,7 @@
<info>Player.Progress</info>
<texturebg border="3" colordiffuse="60FFFFFF">colors/white50.png</texturebg>
<midtexture colordiffuse="button_focus">colors/white.png</midtexture>
+ <visible>!VideoPlayer.HasEpg</visible>
</control>
<control type="slider" id="401">
<left>5</left>
@@ -202,7 +227,7 @@
<texturesliderbar colordiffuse="00FFFFFF">osd/progress/nub_bar.png</texturesliderbar>
<textureslidernib colordiffuse="button_focus">osd/progress/nub_bar.png</textureslidernib>
<textureslidernibfocus colordiffuse="button_focus">colors/white.png</textureslidernibfocus>
- <visible>!VideoPlayer.Content(livetv)</visible>
+ <visible>!VideoPlayer.HasEpg</visible>
</control>
</control>
<control type="group">
diff --git a/addons/skin.estuary/xml/MusicOSD.xml b/addons/skin.estuary/xml/MusicOSD.xml
index 08a5252db3..dc835c4db5 100644
--- a/addons/skin.estuary/xml/MusicOSD.xml
+++ b/addons/skin.estuary/xml/MusicOSD.xml
@@ -220,9 +220,8 @@
<textureslidernib>osd/progress/nub_leftright.png</textureslidernib>
<textureslidernibfocus colordiffuse="button_focus">osd/progress/nub_leftright.png</textureslidernibfocus>
<info>Player.Progress</info>
- <visible>Player.SeekEnabled</visible>
+ <visible>Player.SeekEnabled + !Control.HasFocus(87) + !VideoPlayer.HasEpg</visible>
<action>seek</action>
- <visible>!Control.HasFocus(87)</visible>
</control>
<control type="slider">
<left>0</left>
@@ -235,9 +234,34 @@
<textureslidernib colordiffuse="button_focus">osd/progress/nub_leftright.png</textureslidernib>
<textureslidernibfocus colordiffuse="button_focus">osd/progress/nub_leftright.png</textureslidernibfocus>
<info>Player.Progress</info>
- <visible>Player.SeekEnabled</visible>
+ <visible>Player.SeekEnabled + Control.HasFocus(87) + !VideoPlayer.HasEpg</visible>
<action>seek</action>
- <visible>Control.HasFocus(87)</visible>
+ </control>
+ <control type="slider">
+ <left>0</left>
+ <top>-5</top>
+ <width>100%</width>
+ <height>25</height>
+ <onup>8010</onup>
+ <ondown>650</ondown>
+ <texturesliderbar colordiffuse="00FFFFFF">osd/progress/nub_leftright.png</texturesliderbar>
+ <textureslidernib>osd/progress/nub_leftright.png</textureslidernib>
+ <textureslidernibfocus colordiffuse="button_focus">osd/progress/nub_leftright.png</textureslidernibfocus>
+ <info>PVR.Progress</info>
+ <visible>Player.SeekEnabled + !Control.HasFocus(87) + VideoPlayer.HasEpg</visible>
+ </control>
+ <control type="slider">
+ <left>0</left>
+ <top>-5</top>
+ <width>100%</width>
+ <height>25</height>
+ <onup>8010</onup>
+ <ondown>650</ondown>
+ <texturesliderbar colordiffuse="00FFFFFF">osd/progress/nub_leftright.png</texturesliderbar>
+ <textureslidernib colordiffuse="button_focus">osd/progress/nub_leftright.png</textureslidernib>
+ <textureslidernibfocus colordiffuse="button_focus">osd/progress/nub_leftright.png</textureslidernibfocus>
+ <info>PVR.Progress</info>
+ <visible>Player.SeekEnabled + Control.HasFocus(87) + VideoPlayer.HasEpg</visible>
</control>
</control>
</controls>
diff --git a/addons/skin.estuary/xml/Variables.xml b/addons/skin.estuary/xml/Variables.xml
index 907d3c57f0..e3824141c4 100644
--- a/addons/skin.estuary/xml/Variables.xml
+++ b/addons/skin.estuary/xml/Variables.xml
@@ -200,6 +200,7 @@
<variable name="SeekTimeLabelVar">
<value condition="!String.IsEmpty(Player.SeekNumeric)">[B]$INFO[Player.SeekNumeric(hh:mm:ss)][/B]</value>
<value condition="Player.Seeking">$INFO[Player.SeekTime]$INFO[Player.Duration, / ]</value>
+ <value condition="VideoPlayer.HasEpg">$INFO[PVR.Time]$INFO[PVR.Duration, / ]</value>
<value>$INFO[Player.Time]$INFO[Player.Duration, / ]</value>
</variable>
<variable name="VideoOSDHelpTextVar">
diff --git a/addons/skin.estuary/xml/VideoOSD.xml b/addons/skin.estuary/xml/VideoOSD.xml
index 51d2c4c9b6..9dacdee956 100644
--- a/addons/skin.estuary/xml/VideoOSD.xml
+++ b/addons/skin.estuary/xml/VideoOSD.xml
@@ -207,7 +207,7 @@
<textureslidernibfocus colordiffuse="button_focus">osd/progress/nub_leftright.png</textureslidernibfocus>
<info>Player.Progress</info>
<action>seek</action>
- <visible>!Control.HasFocus(87)</visible>
+ <visible>!Control.HasFocus(87) + !VideoPlayer.HasEpg</visible>
</control>
<control type="slider">
<top>-5</top>
@@ -219,7 +219,29 @@
<textureslidernibfocus colordiffuse="button_focus">osd/progress/nub_leftright.png</textureslidernibfocus>
<info>Player.Progress</info>
<action>seek</action>
- <visible>Control.HasFocus(87)</visible>
+ <visible>Control.HasFocus(87) + !VideoPlayer.HasEpg</visible>
+ </control>
+ <control type="slider">
+ <top>-5</top>
+ <left>0</left>
+ <width>100%</width>
+ <height>25</height>
+ <texturesliderbar colordiffuse="00FFFFFF">osd/progress/nub_leftright.png</texturesliderbar>
+ <textureslidernib>osd/progress/nub_leftright.png</textureslidernib>
+ <textureslidernibfocus colordiffuse="button_focus">osd/progress/nub_leftright.png</textureslidernibfocus>
+ <info>PVR.Progress</info>
+ <visible>!Control.HasFocus(87) + VideoPlayer.HasEpg</visible>
+ </control>
+ <control type="slider">
+ <top>-5</top>
+ <left>0</left>
+ <width>100%</width>
+ <height>25</height>
+ <texturesliderbar colordiffuse="00FFFFFF">osd/progress/nub_leftright.png</texturesliderbar>
+ <textureslidernib colordiffuse="button_focus">osd/progress/nub_leftright.png</textureslidernib>
+ <textureslidernibfocus colordiffuse="button_focus">osd/progress/nub_leftright.png</textureslidernibfocus>
+ <info>PVR.Progress</info>
+ <visible>Control.HasFocus(87) + VideoPlayer.HasEpg</visible>
</control>
</control>
</control>
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index c50e6a17b7..7617636071 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -4373,18 +4373,28 @@ const infomap playlist[] = {{ "length", PLAYLIST_LENGTH },
/// }
/// \table_row3{ <b>`Pvr.Duration`</b>,
/// \anchor Pvr_Duration
-/// _time string_,
-/// Returns the duration of the currently played title on TV
+/// _string_,
+/// Returns the duration of the currently playing epg event
/// }
/// \table_row3{ <b>`Pvr.Time`</b>,
/// \anchor Pvr_Time
-/// _time string_,
-/// Returns the time position of the currently played title on TV
+/// _string_,
+/// Returns the time of the current position of the currently playing epg event
+/// }
+/// \table_row3{ <b>`Pvr.EpgEventRemainingTime`</b>,
+/// \anchor Pvr_EpgEventRemainingTime
+/// _string_,
+/// Returns the remaining time for currently playing epg event
+/// }
+/// \table_row3{ <b>`Pvr.EpgEventFinishTime`</b>,
+/// \anchor Pvr_EpgEventFinishTime
+/// _string_,
+/// Returns the time the currently playing epg event will end
/// }
/// \table_row3{ <b>`Pvr.Progress`</b>,
/// \anchor Pvr_Progress
/// _integer_,
-/// Returns the position of currently played title on TV as integer
+/// Returns the percentage complete of the currently playing epg event
/// }
/// \table_row3{ <b>`Pvr.ActStreamClient`</b>,
/// \anchor Pvr_ActStreamClient
@@ -4641,6 +4651,8 @@ const infomap pvr[] = {{ "isrecording", PVR_IS_RECORDING
{ "isplayingepgtag", PVR_IS_PLAYING_EPGTAG },
{ "duration", PVR_PLAYING_DURATION },
{ "time", PVR_PLAYING_TIME },
+ { "epgeventremainingtime", PVR_EPG_EVENT_REMAINING_TIME },
+ { "epgeventfinishtime", PVR_EPG_EVENT_FINISH_TIME },
{ "progress", PVR_PLAYING_PROGRESS },
{ "actstreamclient", PVR_ACTUAL_STREAM_CLIENT },
{ "actstreamdevice", PVR_ACTUAL_STREAM_DEVICE },
@@ -5981,6 +5993,8 @@ std::string CGUIInfoManager::GetLabel(int info, int contextWindow, std::string *
case PVR_NEXT_TIMER:
case PVR_PLAYING_DURATION:
case PVR_PLAYING_TIME:
+ case PVR_EPG_EVENT_REMAINING_TIME:
+ case PVR_EPG_EVENT_FINISH_TIME:
case PVR_PLAYING_PROGRESS:
case PVR_ACTUAL_STREAM_CLIENT:
case PVR_ACTUAL_STREAM_DEVICE:
@@ -6808,7 +6822,7 @@ bool CGUIInfoManager::GetInt(int &value, int info, int contextWindow, const CGUI
}
value = 0;
- switch( info )
+ switch (info)
{
case PLAYER_VOLUME:
value = (int)g_application.GetVolume();
@@ -6826,19 +6840,13 @@ bool CGUIInfoManager::GetInt(int &value, int info, int contextWindow, const CGUI
case PLAYER_CHAPTER:
case PLAYER_CHAPTERCOUNT:
{
- if( g_application.m_pPlayer->IsPlaying())
+ if (g_application.m_pPlayer->IsPlaying())
{
- switch( info )
+ switch (info)
{
case PLAYER_PROGRESS:
- {
- const CPVREpgInfoTagPtr tag(GetEpgInfoTag());
- if (tag)
- value = lrintf(tag->ProgressPercentage());
- else
- value = lrintf(g_application.GetPercentage());
- break;
- }
+ value = lrintf(g_application.GetPercentage());
+ break;
case PLAYER_PROGRESS_CACHE:
value = lrintf(g_application.GetCachePercentage());
break;
diff --git a/xbmc/addons/PVRClient.cpp b/xbmc/addons/PVRClient.cpp
index 0eaf21df91..2d9e45273c 100644
--- a/xbmc/addons/PVRClient.cpp
+++ b/xbmc/addons/PVRClient.cpp
@@ -1340,39 +1340,6 @@ PVR_ERROR CPVRClient::IsTimeshifting(bool &bTimeshifting) const
});
}
-PVR_ERROR CPVRClient::GetPlayingTime(time_t &time) const
-{
- time = time_t(0);
- PVR_ERROR error = DoAddonCall(__FUNCTION__, [&time](const AddonInstance* addon) {
- time = addon->GetPlayingTime();
- return PVR_ERROR_NO_ERROR;
- });
-
- // fallback if not implemented by addon
- if (time == 0)
- CDateTime::GetUTCDateTime().GetAsTime(time);
-
- return error;
-}
-
-PVR_ERROR CPVRClient::GetBufferTimeStart(time_t &time) const
-{
- time = time_t(0);
- return DoAddonCall(__FUNCTION__, [&time](const AddonInstance* addon) {
- time = addon->GetBufferTimeStart();
- return PVR_ERROR_NO_ERROR;
- });
-}
-
-PVR_ERROR CPVRClient::GetBufferTimeEnd(time_t &time) const
-{
- time = time_t(0);
- return DoAddonCall(__FUNCTION__, [&time](const AddonInstance* addon) {
- time = addon->GetBufferTimeEnd();
- return PVR_ERROR_NO_ERROR;
- });
-}
-
PVR_ERROR CPVRClient::GetStreamTimes(PVR_STREAM_TIMES *times)
{
return DoAddonCall(__FUNCTION__, [&times](const AddonInstance* addon) {
diff --git a/xbmc/addons/PVRClient.h b/xbmc/addons/PVRClient.h
index cad08231e9..a0f75a14f8 100644
--- a/xbmc/addons/PVRClient.h
+++ b/xbmc/addons/PVRClient.h
@@ -802,27 +802,6 @@ namespace PVR
PVR_ERROR IsTimeshifting(bool &bTimeshifting) const;
/*!
- * @brief Get the current playing time
- * @param time The time.
- * @return PVR_ERROR_NO_ERROR on success, respective error code otherwise.
- */
- PVR_ERROR GetPlayingTime(time_t &time) const;
-
- /*!
- * @brief Get the time of oldest packet in timeshift buffer
- * @param time The time.
- * @return PVR_ERROR_NO_ERROR on success, respective error code otherwise.
- */
- PVR_ERROR GetBufferTimeStart(time_t &time) const;
-
- /*!
- * @brief Get the time of latest packet in timeshift buffer
- * @param time The time.
- * @return PVR_ERROR_NO_ERROR on success, respective error code otherwise.
- */
- PVR_ERROR GetBufferTimeEnd(time_t &time) const;
-
- /*!
* @brief Check whether the currently playing stream, if any, is a real-time stream.
* @param bRealTime True if real-time, false otherwise.
* @return PVR_ERROR_NO_ERROR on success, respective error code otherwise.
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h
index fe4af80fc6..7daeee029b 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h
@@ -589,14 +589,14 @@ extern "C" {
} ATTRIBUTE_PACKED PVR_MENUHOOK_DATA;
/*!
- * @brief times of playing stream
+ * @brief times of playing stream (Live TV and recordings)
*/
typedef struct PVR_STREAM_TIMES
{
- time_t startTime; /*!< @brief time (UTC) time elapsed refers to. Ideally start of tv show */
- int64_t ptsStart; /*!< @brief pts of startTime */
- int64_t ptsBegin; /*!< @brief erliest pts player can seek back */
- int64_t ptsEnd; /*!< @brief latest pts player can seek forward */
+ time_t startTime; /*!< @brief For recordings, this must be zero. For Live TV, this is a reference time in units of time_t (UTC) from which time elapsed starts. Ideally start of tv show, but can be any other value. */
+ int64_t ptsStart; /*!< @brief the pts of startTime */
+ int64_t ptsBegin; /*!< @brief earliest pts player can seek back. Value is seconds, relative to ptsStart. For recordings, this must be zero. For Live TV, this must be zero if not timeshifting and must point to begin of the timeshift buffer, otherwise. */
+ int64_t ptsEnd; /*!< @brief latest pts player can seek forward. Value is seconds, relative to ptsStart. For recordings, this must be the total length in seconds. For Live TV, this must be zero if not timeshifting and must point to end of the timeshift buffer, otherwise. */
} ATTRIBUTE_PACKED PVR_STREAM_TIMES;
typedef struct AddonToKodiFuncTable_PVR
diff --git a/xbmc/guiinfo/GUIInfoLabels.h b/xbmc/guiinfo/GUIInfoLabels.h
index 07c274f8a9..6718b57dba 100644
--- a/xbmc/guiinfo/GUIInfoLabels.h
+++ b/xbmc/guiinfo/GUIInfoLabels.h
@@ -526,8 +526,10 @@
#define PVR_RADIO_NEXT_RECORDING_CHANNEL (PVR_STRINGS_START + 56)
#define PVR_RADIO_NEXT_RECORDING_CHAN_ICO (PVR_STRINGS_START + 57)
#define PVR_RADIO_NEXT_RECORDING_DATETIME (PVR_STRINGS_START + 58)
-#define PVR_CHANNEL_NUMBER_INPUT (PVR_STRINGS_START + 59)
-#define PVR_STRINGS_END PVR_CHANNEL_NUMBER_INPUT
+#define PVR_CHANNEL_NUMBER_INPUT (PVR_STRINGS_START + 59)
+#define PVR_EPG_EVENT_REMAINING_TIME (PVR_STRINGS_START + 60)
+#define PVR_EPG_EVENT_FINISH_TIME (PVR_STRINGS_START + 61)
+#define PVR_STRINGS_END PVR_PLAYING_FINISH_TIME
#define ADSP_CONDITIONS_START 1300
#define ADSP_IS_ACTIVE (ADSP_CONDITIONS_START)
diff --git a/xbmc/pvr/PVRGUIInfo.cpp b/xbmc/pvr/PVRGUIInfo.cpp
index 0c46768f70..4a721184a8 100644
--- a/xbmc/pvr/PVRGUIInfo.cpp
+++ b/xbmc/pvr/PVRGUIInfo.cpp
@@ -20,8 +20,11 @@
#include "PVRGUIInfo.h"
+#include <ctime>
+
#include "Application.h"
#include "ServiceBroker.h"
+#include "cores/DataCacheCore.h"
#include "guiinfo/GUIInfoLabels.h"
#include "guilib/LocalizeStrings.h"
#include "settings/AdvancedSettings.h"
@@ -79,6 +82,7 @@ void CPVRGUIInfo::ResetProperties(void)
m_bHasTVChannels = false;
m_bHasRadioChannels = false;
m_bIsTimeshifting = false;
+ m_iStartTime = time_t(0);
m_iTimeshiftStartTime = time_t(0);
m_iTimeshiftEndTime = time_t(0);
m_iTimeshiftPlayTime = time_t(0);
@@ -240,30 +244,44 @@ void CPVRGUIInfo::UpdateMisc(void)
void CPVRGUIInfo::UpdateTimeshift(void)
{
- bool bStarted = CServiceBroker::GetPVRManager().IsStarted();
+ if (!CServiceBroker::GetPVRManager().IsPlayingTV() && !CServiceBroker::GetPVRManager().IsPlayingRadio())
+ {
+ CSingleLock lock(m_critSection);
+ m_iStartTime = 0;
+ return;
+ }
- bool bIsTimeshifting = bStarted && CServiceBroker::GetPVRManager().Clients()->IsTimeshifting();
- CDateTime tmp;
- time_t iTimeshiftStartTime = CServiceBroker::GetPVRManager().Clients()->GetBufferTimeStart();
- tmp.SetFromUTCDateTime(iTimeshiftStartTime);
- std::string strTimeshiftStartTime = tmp.GetAsLocalizedTime("", false);
+ bool bIsTimeshifting = CServiceBroker::GetPVRManager().Clients()->IsTimeshifting();
+ time_t iStartTime = CServiceBroker::GetDataCacheCore().GetStartTime();
+ time_t iPlayTime = CServiceBroker::GetDataCacheCore().GetPlayTime() / 1000;
+ time_t iMinTime = bIsTimeshifting ? CServiceBroker::GetDataCacheCore().GetMinTime() / 1000 : 0;
+ time_t iMaxTime = bIsTimeshifting ? CServiceBroker::GetDataCacheCore().GetMaxTime() / 1000 : 0;
- time_t iTimeshiftEndTime = CServiceBroker::GetPVRManager().Clients()->GetBufferTimeEnd();
- tmp.SetFromUTCDateTime(iTimeshiftEndTime);
- std::string strTimeshiftEndTime = tmp.GetAsLocalizedTime("", false);
+ CSingleLock lock(m_critSection);
- time_t iTimeshiftPlayTime = CServiceBroker::GetPVRManager().Clients()->GetPlayingTime();
- tmp.SetFromUTCDateTime(iTimeshiftPlayTime);
- std::string strTimeshiftPlayTime = tmp.GetAsLocalizedTime("", true);
+ if (!iStartTime)
+ {
+ if (m_iStartTime == 0)
+ iStartTime = std::time(nullptr);
+ else
+ iStartTime = m_iStartTime;
+ }
- CSingleLock lock(m_critSection);
m_bIsTimeshifting = bIsTimeshifting;
- m_iTimeshiftStartTime = iTimeshiftStartTime;
- m_iTimeshiftEndTime = iTimeshiftEndTime;
- m_iTimeshiftPlayTime = iTimeshiftPlayTime;
- m_strTimeshiftStartTime = strTimeshiftStartTime;
- m_strTimeshiftEndTime = strTimeshiftEndTime;
- m_strTimeshiftPlayTime = strTimeshiftPlayTime;
+ m_iStartTime = iStartTime;
+ m_iTimeshiftStartTime = iStartTime + iMinTime;
+ m_iTimeshiftEndTime = iStartTime + iMaxTime;
+ m_iTimeshiftPlayTime = iStartTime + iPlayTime;
+
+ CDateTime tmp;
+ tmp.SetFromUTCDateTime(m_iTimeshiftStartTime);
+ m_strTimeshiftStartTime = tmp.GetAsLocalizedTime("", false);
+
+ tmp.SetFromUTCDateTime(m_iTimeshiftEndTime);
+ m_strTimeshiftEndTime = tmp.GetAsLocalizedTime("", false);
+
+ tmp.SetFromUTCDateTime(m_iTimeshiftPlayTime);
+ m_strTimeshiftPlayTime = tmp.GetAsLocalizedTime("", true);
}
bool CPVRGUIInfo::TranslateCharInfo(DWORD dwInfo, std::string &strValue) const
@@ -271,7 +289,7 @@ bool CPVRGUIInfo::TranslateCharInfo(DWORD dwInfo, std::string &strValue) const
bool bReturn(true);
CSingleLock lock(m_critSection);
- switch(dwInfo)
+ switch (dwInfo)
{
case PVR_NOW_RECORDING_TITLE:
m_anyTimersInfo.CharInfoActiveTimerTitle(strValue);
@@ -351,6 +369,12 @@ bool CPVRGUIInfo::TranslateCharInfo(DWORD dwInfo, std::string &strValue) const
case PVR_PLAYING_TIME:
CharInfoPlayingTime(strValue);
break;
+ case PVR_EPG_EVENT_REMAINING_TIME:
+ CharInfoEpgEventRemainingTime(strValue);
+ break;
+ case PVR_EPG_EVENT_FINISH_TIME:
+ CharInfoEpgEventFinishTime(strValue);
+ break;
case PVR_NEXT_TIMER:
m_anyTimersInfo.CharInfoNextTimer(strValue);
break;
@@ -826,7 +850,19 @@ void CPVRGUIInfo::CharInfoTimeshiftPlayTime(std::string &strValue) const
void CPVRGUIInfo::CharInfoPlayingTime(std::string &strValue) const
{
- strValue = StringUtils::SecondsToTimeString(GetStartTime()/1000, TIME_FORMAT_GUESS).c_str();
+ strValue = StringUtils::SecondsToTimeString(GetStartTime() / 1000, TIME_FORMAT_GUESS).c_str();
+}
+
+void CPVRGUIInfo::CharInfoEpgEventRemainingTime(std::string &strValue) const
+{
+ strValue = StringUtils::SecondsToTimeString((m_iDuration - GetStartTime()) / 1000, TIME_FORMAT_GUESS).c_str();
+}
+
+void CPVRGUIInfo::CharInfoEpgEventFinishTime(std::string &strValue) const
+{
+ CDateTime finishTime = CDateTime::GetCurrentDateTime();
+ finishTime += CDateTimeSpan(0, 0, 0, (m_iDuration - GetStartTime()) / 1000);
+ strValue = finishTime.GetAsLocalizedTime("", false);
}
void CPVRGUIInfo::CharInfoBackendNumber(std::string &strValue) const
@@ -1128,9 +1164,9 @@ void CPVRGUIInfo::UpdatePlayingTag(void)
if (!epgTag || !epgTag->IsActive() ||
!channel || !currentChannel || *channel != *currentChannel)
{
- CSingleLock lock(m_critSection);
- ResetPlayingTag();
const CPVREpgInfoTagPtr newTag(currentTag ? currentTag : currentChannel->GetEPGNow());
+
+ CSingleLock lock(m_critSection);
if (newTag)
{
m_playingEpgTag = newTag;
@@ -1138,8 +1174,14 @@ void CPVRGUIInfo::UpdatePlayingTag(void)
}
else if (m_iTimeshiftEndTime > m_iTimeshiftStartTime)
{
+ m_playingEpgTag.reset();
m_iDuration = (m_iTimeshiftEndTime - m_iTimeshiftStartTime) * 1000;
}
+ else
+ {
+ m_playingEpgTag.reset();
+ m_iDuration = 0;
+ }
}
}
else
@@ -1147,7 +1189,8 @@ void CPVRGUIInfo::UpdatePlayingTag(void)
const CPVRRecordingPtr recording(CServiceBroker::GetPVRManager().GetPlayingRecording());
if (recording)
{
- ResetPlayingTag();
+ CSingleLock lock(m_critSection);
+ m_playingEpgTag.reset();
m_iDuration = recording->GetDuration() * 1000;
}
}
diff --git a/xbmc/pvr/PVRGUIInfo.h b/xbmc/pvr/PVRGUIInfo.h
index 7721b3e56b..5d680631a3 100644
--- a/xbmc/pvr/PVRGUIInfo.h
+++ b/xbmc/pvr/PVRGUIInfo.h
@@ -196,6 +196,8 @@ namespace PVR
void CharInfoPlayingDuration(std::string &strValue) const;
void CharInfoPlayingTime(std::string &strValue) const;
+ void CharInfoEpgEventRemainingTime(std::string &strValue) const;
+ void CharInfoEpgEventFinishTime(std::string &strValue) const;
void CharInfoBackendNumber(std::string &strValue) const;
void CharInfoTotalDiskSpace(std::string &strValue) const;
void CharInfoSignal(std::string &strValue) const;
@@ -260,6 +262,7 @@ namespace PVR
std::vector<SBackend> m_backendProperties;
bool m_bIsTimeshifting;
+ time_t m_iStartTime;
time_t m_iTimeshiftStartTime;
time_t m_iTimeshiftEndTime;
time_t m_iTimeshiftPlayTime;
diff --git a/xbmc/pvr/addons/PVRClients.cpp b/xbmc/pvr/addons/PVRClients.cpp
index ba20e8a63f..8956ec3dda 100644
--- a/xbmc/pvr/addons/PVRClients.cpp
+++ b/xbmc/pvr/addons/PVRClients.cpp
@@ -718,33 +718,6 @@ bool CPVRClients::IsTimeshifting(void) const
return bTimeshifting;
}
-time_t CPVRClients::GetPlayingTime() const
-{
- time_t time(0);
- ForPlayingClient(__FUNCTION__, [&time](const CPVRClientPtr &client) {
- return client->GetPlayingTime(time);
- });
- return time;
-}
-
-time_t CPVRClients::GetBufferTimeStart() const
-{
- time_t time(0);
- ForPlayingClient(__FUNCTION__, [&time](const CPVRClientPtr &client) {
- return client->GetBufferTimeStart(time);
- });
- return time;
-}
-
-time_t CPVRClients::GetBufferTimeEnd() const
-{
- time_t time(0);
- ForPlayingClient(__FUNCTION__, [&time](const CPVRClientPtr &client) {
- return client->GetBufferTimeEnd(time);
- });
- return time;
-}
-
bool CPVRClients::GetStreamTimes(PVR_STREAM_TIMES *times) const
{
return ForPlayingClient(__FUNCTION__, [&times](const CPVRClientPtr &client) {
diff --git a/xbmc/pvr/addons/PVRClients.h b/xbmc/pvr/addons/PVRClients.h
index d18437bdf9..581b9ee547 100644
--- a/xbmc/pvr/addons/PVRClients.h
+++ b/xbmc/pvr/addons/PVRClients.h
@@ -325,24 +325,6 @@ namespace PVR
bool IsTimeshifting() const;
/*!
- * @brief Get the playing time of the currently playing stream.
- * @return The time.
- */
- time_t GetPlayingTime() const;
-
- /*!
- * @brief Get the start time of the timeshift buffer for the currently playing stream.
- * @return The buffer start time.
- */
- time_t GetBufferTimeStart() const;
-
- /*!
- * @brief Get the end time of the timeshift buffer for the currently playing stream.
- * @return The buffer end time.
- */
- time_t GetBufferTimeEnd() const;
-
- /*!
* @brief Get timing data for the currently playing stream.
* @param times The struct the client has to fill with data.
* @return True, if the data were fetched successfully, false itherwise.
diff --git a/xbmc/pvr/epg/EpgInfoTag.cpp b/xbmc/pvr/epg/EpgInfoTag.cpp
index 5471d73245..7e68537ea8 100644
--- a/xbmc/pvr/epg/EpgInfoTag.cpp
+++ b/xbmc/pvr/epg/EpgInfoTag.cpp
@@ -22,6 +22,7 @@
#include "ServiceBroker.h"
#include "addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h"
+#include "cores/DataCacheCore.h"
#include "guilib/LocalizeStrings.h"
#include "settings/AdvancedSettings.h"
#include "settings/Settings.h"
@@ -221,17 +222,16 @@ void CPVREpgInfoTag::Serialize(CVariant &value) const
CDateTime CPVREpgInfoTag::GetCurrentPlayingTime() const
{
- CDateTime now = CDateTime::GetUTCDateTime();
-
- CPVRChannelPtr channel(CServiceBroker::GetPVRManager().GetPlayingChannel());
- if (channel == Channel())
+ if (CServiceBroker::GetPVRManager().GetPlayingChannel() == Channel() &&
+ CServiceBroker::GetPVRManager().Clients()->IsTimeshifting())
{
- // Timeshifting active?
- time_t time = CServiceBroker::GetPVRManager().Clients()->GetPlayingTime();
- if (time > 0) // returns 0 in case no client is currently playing
- now = time;
+ // timeshifting
+ return CDateTime(CServiceBroker::GetDataCacheCore().GetStartTime() +
+ CServiceBroker::GetDataCacheCore().GetPlayTime() / 1000);
}
- return now;
+
+ // not timeshifting
+ return CDateTime::GetUTCDateTime();
}
bool CPVREpgInfoTag::IsActive(void) const