movieplayer: allow bisectional jumps with RC_page_up/down

based upon code by TangoCash


Origin commit data
------------------
Branch: ni/coolstream
Commit: ca218e5390
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-05-13 (Sat, 13 May 2017)

Origin message was:
------------------
- movieplayer: allow bisectional jumps with RC_page_up/down

based upon code by TangoCash


------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2017-05-13 17:45:59 +02:00
parent c43e77c038
commit 5705809f1a
8 changed files with 52 additions and 0 deletions

View File

@@ -1350,6 +1350,11 @@ void CMoviePlayerGui::PlayFileLoop(void)
int position_tmp = 0;
bool at_eof = !(playstate >= CMoviePlayerGui::PLAY);;
keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL;
neutrino_msg_t lastmsg = 0; //NI
//NI - bisectional jumps
int bisection_jump = 300;
int bisection_loop = -1;
while (playstate >= CMoviePlayerGui::PLAY)
{
@@ -1366,6 +1371,12 @@ void CMoviePlayerGui::PlayFileLoop(void)
neutrino_msg_data_t data;
g_RCInput->getMsg(&msg, &data, 10); // 1 secs..
//NI - bisectional jumps
if (bisection_loop > -1)
bisection_loop++;
if (bisection_loop > 10)
bisection_loop = -1;
if ((playstate >= CMoviePlayerGui::PLAY) && (timeshift != TSHIFT_MODE_OFF || (playstate != CMoviePlayerGui::PAUSE))) {
if (playback->GetPosition(position, duration)) {
FileTimeOSD->update(position, duration);
@@ -1610,10 +1621,30 @@ void CMoviePlayerGui::PlayFileLoop(void)
SetPosition(duration/2, true);
} else if (msg == CRCInput::RC_8) { // goto end
SetPosition(duration - 60 * 1000, true);
//NI
#if 0
} else if (msg == CRCInput::RC_page_up) {
SetPosition(10 * 1000);
} else if (msg == CRCInput::RC_page_down) {
SetPosition(-10 * 1000);
#endif
//NI - bisectional jumps
} else if (msg == CRCInput::RC_page_up || msg == CRCInput::RC_page_down) {
int direction = (msg == CRCInput::RC_page_up) ? 1 : -1;
int jump = 10;
if (g_settings.movieplayer_bisection_jump)
{
if ((lastmsg == CRCInput::RC_page_up || lastmsg == CRCInput::RC_page_down) && (bisection_loop > -1 && bisection_loop <= 10))
bisection_jump /= 2;
else
bisection_jump = 300;
bisection_loop = 0;
jump = bisection_jump;
}
SetPosition(direction*jump * 1000);
} else if (msg == CRCInput::RC_0) { // cancel bookmark jump
handleMovieBrowser(CRCInput::RC_0, position);
} else if (msg == (neutrino_msg_t) g_settings.mpkey_goto) {
@@ -1736,6 +1767,9 @@ void CMoviePlayerGui::PlayFileLoop(void)
clearSubtitle();
}
}
//NI
if (msg < CRCInput::RC_MaxRC)
lastmsg = msg;
}
printf("CMoviePlayerGui::PlayFile: exit, isMovieBrowser %d p_movie_info %p\n", isMovieBrowser, p_movie_info);
playstate = CMoviePlayerGui::STOPPED;