movieplayer: show timeosd when set position

Origin commit data
------------------
Branch: ni/coolstream
Commit: 19079a930c
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-01-03 (Wed, 03 Jan 2018)

Origin message was:
------------------
- movieplayer: show timeosd when set position

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2018-01-03 01:41:10 +01:00
parent 8bb0fa5113
commit f81f069d7e
4 changed files with 24 additions and 0 deletions

View File

@@ -1482,6 +1482,7 @@ bool CMoviePlayerGui::SetPosition(int pos, bool absolute)
playback->SetSpeed(speed); playback->SetSpeed(speed);
} }
StartSubtitles(true); StartSubtitles(true);
FileTimeOSD_tmp = 0;
return res; return res;
} }
@@ -1553,6 +1554,8 @@ void CMoviePlayerGui::PlayFileLoop(void)
int bisection_loop = -1; int bisection_loop = -1;
int bisection_loop_max = 5; int bisection_loop_max = 5;
FileTimeOSD_tmp = -1;
while (playstate >= CMoviePlayerGui::PLAY) while (playstate >= CMoviePlayerGui::PLAY)
{ {
if (update_lcd) { if (update_lcd) {
@@ -1586,9 +1589,25 @@ void CMoviePlayerGui::PlayFileLoop(void)
if (bisection_loop > bisection_loop_max) if (bisection_loop > bisection_loop_max)
bisection_loop = -1; bisection_loop = -1;
if (FileTimeOSD_tmp > -1)
FileTimeOSD_tmp++;
if ((playstate >= CMoviePlayerGui::PLAY) && (timeshift != TSHIFT_MODE_OFF || (playstate != CMoviePlayerGui::PAUSE))) { if ((playstate >= CMoviePlayerGui::PLAY) && (timeshift != TSHIFT_MODE_OFF || (playstate != CMoviePlayerGui::PAUSE))) {
if (playback->GetPosition(position, duration)) { if (playback->GetPosition(position, duration)) {
FileTimeOSD->update(position, duration); FileTimeOSD->update(position, duration);
if (FileTimeOSD_tmp > -1 && !FileTimeOSD->IsVisible())
{
FileTimeOSD->setMode(CTimeOSD::MODE_TMP);
FileTimeOSD->show(position);
}
if (FileTimeOSD_tmp > bisection_loop_max)
{
FileTimeOSD_tmp = -1;
if (FileTimeOSD->getMode() == CTimeOSD::MODE_TMP)
FileTimeOSD->kill();
}
if (duration > 100) if (duration > 100)
file_prozent = (unsigned char) (position / (duration / 100)); file_prozent = (unsigned char) (position / (duration / 100));
@@ -1866,6 +1885,7 @@ void CMoviePlayerGui::PlayFileLoop(void)
FileTimeOSD->switchMode(position, duration); FileTimeOSD->switchMode(position, duration);
time_forced = false; time_forced = false;
FileTimeOSD->setMpTimeForced(false); FileTimeOSD->setMpTimeForced(false);
FileTimeOSD_tmp = -1;
} else if (msg == (neutrino_msg_t) g_settings.mbkey_cover) { } else if (msg == (neutrino_msg_t) g_settings.mbkey_cover) {
makeScreenShot(false, true); makeScreenShot(false, true);
} else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { } else if (msg == (neutrino_msg_t) g_settings.key_screenshot) {

View File

@@ -107,6 +107,7 @@ class CMoviePlayerGui : public CMenuTarget
std::string currentaudioname; std::string currentaudioname;
bool playing; bool playing;
bool time_forced; bool time_forced;
int FileTimeOSD_tmp;
CMoviePlayerGui::state playstate; CMoviePlayerGui::state playstate;
int keyPressed; int keyPressed;
bool isLuaPlay; bool isLuaPlay;

View File

@@ -139,6 +139,7 @@ void CTimeOSD::update(int position, int duration)
{ {
switch(m_mode) { switch(m_mode) {
case MODE_ASC: case MODE_ASC:
case MODE_TMP:
show(position, false); show(position, false);
break; break;
case MODE_DESC: case MODE_DESC:
@@ -156,6 +157,7 @@ void CTimeOSD::switchMode(int position, int duration)
{ {
switch (m_mode) { switch (m_mode) {
case MODE_ASC: case MODE_ASC:
case MODE_TMP:
InfoIcons->enableInfoIcons(false); //NI InfoIcons InfoIcons->enableInfoIcons(false); //NI InfoIcons
m_mode = MODE_DESC; m_mode = MODE_DESC;
CComponents::kill(); CComponents::kill();

View File

@@ -37,6 +37,7 @@ class CTimeOSD : public CComponentsFrmClock
MODE_ASC, MODE_ASC,
MODE_DESC, MODE_DESC,
MODE_BAR, MODE_BAR,
MODE_TMP,
MODE_HIDE MODE_HIDE
}; };