aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxhaggi <sascha.woo@gmail.com>2015-02-09 22:58:41 +0100
committerxhaggi <sascha.woo@gmail.com>2015-02-10 15:15:54 +0100
commit0b46142ec12e940ac6abf1939026d97a8f24da4d (patch)
tree81efb923490d6fa82106828490b4968ebbc69251
parent26936a902429c36aa3a8abd44b6ffa5a8d90bc1f (diff)
[gui] adds new info label Player.SeekStepSize
-rw-r--r--xbmc/GUIInfoManager.cpp9
-rw-r--r--xbmc/GUIInfoManager.h3
-rw-r--r--xbmc/utils/SeekHandler.cpp8
3 files changed, 19 insertions, 1 deletions
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index 18583bf351..a5383b1fac 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -219,6 +219,7 @@ const infomap player_param[] = {{ "art", PLAYER_ITEM_ART }};
const infomap player_times[] = {{ "seektime", PLAYER_SEEKTIME },
{ "seekoffset", PLAYER_SEEKOFFSET },
+ { "seekstepsize", PLAYER_SEEKSTEPSIZE },
{ "timeremaining", PLAYER_TIME_REMAINING },
{ "timespeed", PLAYER_TIME_SPEED },
{ "time", PLAYER_TIME },
@@ -3240,6 +3241,14 @@ std::string CGUIInfoManager::GetMultiInfoLabel(const GUIInfo &info, int contextW
if (m_seekOffset > 0)
return "+" + seekOffset;
}
+ else if (info.m_info == PLAYER_SEEKSTEPSIZE)
+ {
+ std::string seekOffset = StringUtils::SecondsToTimeString(abs(m_seekStepSize), (TIME_FORMAT)info.GetData1());
+ if (m_seekStepSize < 0)
+ return "-" + seekOffset;
+ if (m_seekStepSize > 0)
+ return "+" + seekOffset;
+ }
else if (info.m_info == PLAYER_ITEM_ART)
{
return m_currentFile->GetArt(m_stringParameters[info.GetData1()]);
diff --git a/xbmc/GUIInfoManager.h b/xbmc/GUIInfoManager.h
index 0bf5f54db0..34744d395b 100644
--- a/xbmc/GUIInfoManager.h
+++ b/xbmc/GUIInfoManager.h
@@ -111,6 +111,7 @@ namespace INFO
#define PLAYER_TITLE 53
#define PLAYER_ISINTERNETSTREAM 54
#define PLAYER_FILENAME 55
+#define PLAYER_SEEKSTEPSIZE 56
#define WEATHER_CONDITIONS 100
#define WEATHER_TEMPERATURE 101
@@ -801,6 +802,7 @@ public:
bool GetDisplayAfterSeek();
void SetDisplayAfterSeek(unsigned int timeOut = 2500, int seekOffset = 0);
+ void SetSeekStepSize(int seekStepSize) { m_seekStepSize = seekStepSize; };
void SetSeeking(bool seeking) { m_playerSeeking = seeking; };
void SetShowTime(bool showtime) { m_playerShowTime = showtime; };
void SetShowCodec(bool showcodec) { m_playerShowCodec = showcodec; };
@@ -931,6 +933,7 @@ protected:
//Fullscreen OSD Stuff
unsigned int m_AfterSeekTimeout;
int m_seekOffset;
+ int m_seekStepSize;
bool m_playerSeeking;
bool m_playerShowTime;
bool m_playerShowCodec;
diff --git a/xbmc/utils/SeekHandler.cpp b/xbmc/utils/SeekHandler.cpp
index 9bea0a304f..82e68afcfa 100644
--- a/xbmc/utils/SeekHandler.cpp
+++ b/xbmc/utils/SeekHandler.cpp
@@ -141,7 +141,10 @@ void CSeekHandler::Seek(bool forward, float amount, float duration /* = 0 */, bo
if (g_infoManager.GetTotalPlayTime())
percentPerSecond = 100.0f / (float)g_infoManager.GetTotalPlayTime();
- m_percent = m_percentPlayTime + percentPerSecond * GetSeekSeconds(forward);
+ int seekSeconds = GetSeekSeconds(forward);
+ g_infoManager.SetSeekStepSize(seekSeconds);
+
+ m_percent = m_percentPlayTime + percentPerSecond * seekSeconds;
}
if (m_percent > 100.0f) m_percent = 100.0f;
@@ -172,6 +175,9 @@ void CSeekHandler::Process()
{
g_infoManager.m_performingSeek = true;
+ // reset seek step size
+ g_infoManager.SetSeekStepSize(0);
+
// calculate the seek time
double time = g_infoManager.GetTotalPlayTime() * m_percent * 0.01;