movieplayer: allow bisectional jumps with RC_page_up/down

based upon code by TangoCash


Origin commit data
------------------
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 is contained in:
vanhofen
2017-05-13 17:45:59 +02:00
parent cd39eb364b
commit 77ac470486
8 changed files with 52 additions and 0 deletions

View File

@@ -1352,6 +1352,7 @@ menu.hint_misc_zapit Verwaltung der Start-Kanäle für den TV/Radio-Modus
menu.hint_movie Wiedergabe von Filmen
menu.hint_moviebrowser_fonts Ändern Sie die Schriftgrößen im Moviebrowser (Meine Aufnahmen)
menu.hint_moviebrowser_setup Legen Sie Auswahl- und Anzeigeoptionen des MovieBrowsers fest
menu.hint_movieplayer_bisection_jump Für das Vor- und Zurückspringen mit Seite hoch/runter wird ein bisektionaler Modus verwendet
menu.hint_movieplayer_plugin Wählen Sie ein Plugin, das mit einer Schnellstart-Taste im Movieplayer-Modus gestartet wird
menu.hint_net_broadcast Ändern Sie die Broadcast-Adresse.\nWenn Sie unsicher sind, verwenden Sie zuletzt .255
menu.hint_net_dhcp Verwenden Sie einen DHCP-Server für die automatische Vergabe einer IP-Adresse im Netzwerk
@@ -1999,6 +2000,7 @@ moviebrowser.yt_region Region
moviebrowser.yt_related Passende Videos
moviebrowser.yt_search Suche nach Stichwort
moviecut.cancel Bearbeiten des Filmes abbrechen?
movieplayer.bisection_jump Bisektionale Sprünge
movieplayer.bookmark Bookmarks
movieplayer.bookmarkname Bookmark Name
movieplayer.bookmarkname_hint1 Geben Sie den Namen für das neue Lesezeichen ein

View File

@@ -1352,6 +1352,7 @@ menu.hint_misc_zapit Initial TV/Radio channels
menu.hint_movie Play movies
menu.hint_moviebrowser_fonts Change moviebrowser (My recordings) font sizes
menu.hint_moviebrowser_setup Set selection and display options.
menu.hint_movieplayer_bisection_jump Use bisectional mode to jump forward/backward with page up/down
menu.hint_movieplayer_plugin Choose a plugin that's executed with the one touch key in movieplayer mode
menu.hint_net_broadcast Enter broadcast address\nif unsure, use IP address with last .255
menu.hint_net_dhcp Use DHCP server to auto-configure
@@ -1999,6 +2000,7 @@ moviebrowser.yt_region Region
moviebrowser.yt_related Related videos
moviebrowser.yt_search Search keyword
moviecut.cancel Cancel movie editing?
movieplayer.bisection_jump Bisectional jumps
movieplayer.bookmark Bookmarks
movieplayer.bookmarkname Bookmarkname
movieplayer.bookmarkname_hint1 Enter a name for your new bookmark

View File

@@ -512,6 +512,13 @@ void CKeybindSetup::showKeyBindMovieplayerSetup(CMenuWidget *bindSettings_mplaye
mf->setHint("", key_settings[i].hint);
bindSettings_mplayer->addItem(mf);
}
bindSettings_mplayer->addItem(GenericMenuSeparatorLine); //NI
//NI - bisectional jumps
CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_MOVIEPLAYER_BISECTION_JUMP, &g_settings.movieplayer_bisection_jump, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
mc->setHint("", LOCALE_MENU_HINT_MOVIEPLAYER_BISECTION_JUMP);
bindSettings_mplayer->addItem(mc);
}
void CKeybindSetup::showKeyBindMoviebrowserSetup(CMenuWidget *bindSettings_mbrowser)

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;

View File

@@ -906,6 +906,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
//Movie-Player
g_settings.movieplayer_repeat_on = configfile.getInt32("movieplayer_repeat_on", CMoviePlayerGui::REPEAT_OFF);
g_settings.movieplayer_bisection_jump = configfile.getInt32("movieplayer_bisection_jump", 1); //NI
g_settings.youtube_dev_id = configfile.getString("youtube_dev_id","AIzaSyBLdZe7M3rpNMZqSj-3IEvjbb2hATWJIdM"); //NI
g_settings.youtube_enabled = configfile.getInt32("youtube_enabled", 1);
g_settings.youtube_enabled = check_youtube_dev_id();
@@ -1571,6 +1572,7 @@ void CNeutrinoApp::saveSetup(const char * fname)
//Movie-Player
configfile.setInt32( "movieplayer_repeat_on", g_settings.movieplayer_repeat_on );
configfile.setInt32( "movieplayer_bisection_jump", g_settings.movieplayer_bisection_jump ); //NI
configfile.setString( "youtube_dev_id", g_settings.youtube_dev_id );
configfile.setInt32( "youtube_enabled", g_settings.youtube_enabled );
configfile.setString( "tmdb_api_key", g_settings.tmdb_api_key );

View File

@@ -1379,6 +1379,7 @@ typedef enum
LOCALE_MENU_HINT_MOVIE,
LOCALE_MENU_HINT_MOVIEBROWSER_FONTS,
LOCALE_MENU_HINT_MOVIEBROWSER_SETUP,
LOCALE_MENU_HINT_MOVIEPLAYER_BISECTION_JUMP,
LOCALE_MENU_HINT_MOVIEPLAYER_PLUGIN,
LOCALE_MENU_HINT_NET_BROADCAST,
LOCALE_MENU_HINT_NET_DHCP,
@@ -2026,6 +2027,7 @@ typedef enum
LOCALE_MOVIEBROWSER_YT_RELATED,
LOCALE_MOVIEBROWSER_YT_SEARCH,
LOCALE_MOVIECUT_CANCEL,
LOCALE_MOVIEPLAYER_BISECTION_JUMP,
LOCALE_MOVIEPLAYER_BOOKMARK,
LOCALE_MOVIEPLAYER_BOOKMARKNAME,
LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT1,

View File

@@ -1379,6 +1379,7 @@ const char * locale_real_names[] =
"menu.hint_movie",
"menu.hint_moviebrowser_fonts",
"menu.hint_moviebrowser_setup",
"menu.hint_movieplayer_bisection_jump",
"menu.hint_movieplayer_plugin",
"menu.hint_net_broadcast",
"menu.hint_net_dhcp",
@@ -2026,6 +2027,7 @@ const char * locale_real_names[] =
"moviebrowser.yt_related",
"moviebrowser.yt_search",
"moviecut.cancel",
"movieplayer.bisection_jump",
"movieplayer.bookmark",
"movieplayer.bookmarkname",
"movieplayer.bookmarkname_hint1",

View File

@@ -787,6 +787,7 @@ struct SNeutrinoSettings
//movieplayer
int movieplayer_repeat_on;
int movieplayer_bisection_jump; //NI
std::string youtube_dev_id;
int youtube_enabled;
std::string tmdb_api_key;