diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp index 23aa8e290..54b485b09 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -126,19 +126,22 @@ bool CInfoClock::enableInfoClock(bool enable) } } - if (enable) { - if (FileTimeOSD->getRestore()) { - FileTimeOSD->setMode(FileTimeOSD->getTmpMode()); - FileTimeOSD->update(CMoviePlayerGui::getInstance().GetPosition(), - CMoviePlayerGui::getInstance().GetDuration()); + if (!FileTimeOSD->getMpTimeForced()) { + if (enable) { + if (FileTimeOSD->getRestore()) { + FileTimeOSD->setRestore(false); + FileTimeOSD->setMode(FileTimeOSD->getTmpMode()); + FileTimeOSD->update(CMoviePlayerGui::getInstance().GetPosition(), + CMoviePlayerGui::getInstance().GetDuration()); + } } - } - else { - if (FileTimeOSD->getMode() != CTimeOSD::MODE_HIDE) { - FileTimeOSD->setTmpMode(); - FileTimeOSD->setRestore(); - if (FileTimeOSD->getRestore()) - FileTimeOSD->kill(); + else { + if (FileTimeOSD->getMode() != CTimeOSD::MODE_HIDE) { + FileTimeOSD->setTmpMode(); + FileTimeOSD->setRestore(true); + if (FileTimeOSD->getRestore()) + FileTimeOSD->kill(); + } } } diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index eee9d3b19..dfb1b2d02 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -282,6 +282,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) FileTimeOSD->kill(); FileTimeOSD->setMode(CTimeOSD::MODE_HIDE); + FileTimeOSD->setMpTimeForced(false); time_forced = false; if (actionKey == "tsmoviebrowser") { @@ -1100,6 +1101,7 @@ bool CMoviePlayerGui::PlayFileStart(void) { menu_ret = menu_return::RETURN_REPAINT; + FileTimeOSD->setMpTimeForced(false); time_forced = false; position = 0, duration = 0; @@ -1201,6 +1203,7 @@ bool CMoviePlayerGui::PlayFileStart(void) FileTimeOSD->switchMode(position, duration); time_forced = true; } + FileTimeOSD->setMpTimeForced(true); } else if (timeshift == TSHIFT_MODE_OFF || !g_settings.timeshift_pause) { playback->SetSpeed(1); } @@ -1402,6 +1405,7 @@ void CMoviePlayerGui::PlayFileLoop(void) time_forced = false; FileTimeOSD->kill(); } + FileTimeOSD->setMpTimeForced(false); if (playstate > CMoviePlayerGui::PLAY) { playstate = CMoviePlayerGui::PLAY; speed = 1; @@ -1436,6 +1440,11 @@ void CMoviePlayerGui::PlayFileLoop(void) enableOsdElements(MUTE); } } else if (msg == (neutrino_msg_t) g_settings.mpkey_pause) { + if (time_forced) { + time_forced = false; + FileTimeOSD->kill(); + } + FileTimeOSD->setMpTimeForced(false); if (playstate == CMoviePlayerGui::PAUSE) { playstate = CMoviePlayerGui::PLAY; //CVFD::getInstance()->ShowIcon(VFD_ICON_PAUSE, false); @@ -1467,6 +1476,8 @@ void CMoviePlayerGui::PlayFileLoop(void) update_lcd = true; } else if (msg == (neutrino_msg_t) g_settings.mpkey_time) { FileTimeOSD->switchMode(position, duration); + time_forced = false; + FileTimeOSD->setMpTimeForced(false); } else if (msg == (neutrino_msg_t) g_settings.mbkey_cover) { makeScreenShot(false, true); } else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { @@ -1492,6 +1503,7 @@ void CMoviePlayerGui::PlayFileLoop(void) FileTimeOSD->switchMode(position, duration); time_forced = true; } + FileTimeOSD->setMpTimeForced(true); if (timeshift == TSHIFT_MODE_OFF) callInfoViewer(); } else if (msg == CRCInput::RC_1) { // Jump Backwards 1 minute diff --git a/src/gui/timeosd.cpp b/src/gui/timeosd.cpp index 597d2b2b2..32c025f0f 100644 --- a/src/gui/timeosd.cpp +++ b/src/gui/timeosd.cpp @@ -42,6 +42,7 @@ CTimeOSD::CTimeOSD():CComponentsFrmClock( 1, 1, NULL, "%H:%M:%S", NULL, false, 1 m_mode = MODE_HIDE; tmp_mode = MODE_HIDE; m_restore = false; + mp_time_forced = false; Init(); } diff --git a/src/gui/timeosd.h b/src/gui/timeosd.h index c79da7dec..fe2f678f3 100644 --- a/src/gui/timeosd.h +++ b/src/gui/timeosd.h @@ -44,6 +44,7 @@ class CTimeOSD : public CComponentsFrmClock CProgressBar timescale; mode m_mode, tmp_mode; bool m_restore; + bool mp_time_forced; time_t m_time_show; void initTimeString(); @@ -65,7 +66,9 @@ class CTimeOSD : public CComponentsFrmClock mode getTmpMode() { return tmp_mode; }; void setTmpMode () { tmp_mode = m_mode; }; bool getRestore() { return m_restore; }; - void setRestore() { m_restore = (m_mode != MODE_HIDE); }; + void setRestore(bool m) { m_restore = m; }; void setHeight(const int){}//NOTE: dummy member, height is strictly bound to settings + bool getMpTimeForced() { return mp_time_forced; }; + void setMpTimeForced(bool m) { mp_time_forced = m; }; }; #endif