diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 1eaccff19..a1e4da3b3 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1204,6 +1204,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 Auswahl- und Anzeigeoptionen einstellen. +menu.hint_movieplayer_display_playtime Zeigt während der Wiedergabe die Spielzeit anstatt des Fimtitels im VFD 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 @@ -1828,6 +1829,7 @@ movieplayer.bookmarkname Bookmark Name movieplayer.bookmarkname_hint1 Geben Sie den Namen für das neue Lesezeichen ein movieplayer.bookmarkname_hint2 movieplayer.chapters Kapitel +movieplayer.display_playtime Zeige Spielzeit im VFD movieplayer.fileplayback_audio Multiformat-Audiowiedergabe movieplayer.fileplayback_video Multiformat-Videowiedergabe movieplayer.head Movieplayer diff --git a/data/locale/english.locale b/data/locale/english.locale index f6bffc8b8..9cdbcb60d 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1204,6 +1204,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_display_playtime While playback show playtime instead of movietitle on VFD 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 @@ -1828,8 +1829,9 @@ movieplayer.bookmarkname Bookmarkname movieplayer.bookmarkname_hint1 Enter a name for your new bookmark movieplayer.bookmarkname_hint2 movieplayer.chapters Chapters -movieplayer.fileplayback_audio Multiformat Audio Player -movieplayer.fileplayback_video Multiformat Video Player +movieplayer.display_playtime Show playtime in VFD +movieplayer.fileplayback_audio Multiformat audio playback +movieplayer.fileplayback_video Multiformat video playback movieplayer.head Movieplayer movieplayer.help_additional To find more user definable key bindings, see "Mainmenu" > "Settings" > "Keys" > "Edit" > "Movieplayer".\n\nWhile movie playback some menuitems in mainmenu are deactivated. movieplayer.help_button_1 1 minute backward diff --git a/src/gui/mediaplayer_setup.cpp b/src/gui/mediaplayer_setup.cpp index bb18e8333..3a52e2532 100644 --- a/src/gui/mediaplayer_setup.cpp +++ b/src/gui/mediaplayer_setup.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include @@ -113,6 +114,12 @@ int CMediaPlayerSetup::showMediaPlayerSetup() mf->setHint(NEUTRINO_ICON_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY_SETUP); mediaSetup->addItem(mf); + mediaSetup->addItem(GenericMenuSeparator); + + CMenuOptionChooser *mc; + mc = new CMenuOptionChooser(LOCALE_MOVIEPLAYER_DISPLAY_PLAYTIME, &g_settings.movieplayer_display_playtime, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_info.hw_caps->display_xres >= 8); + mc->setHint("", LOCALE_MENU_HINT_MOVIEPLAYER_DISPLAY_PLAYTIME); + mediaSetup->addItem(mc); int res = mediaSetup->exec (NULL, ""); selected = mediaSetup->getSelected(); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 6c2fef6b1..ca85dec99 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -491,12 +491,26 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) return menu_ret; } -void CMoviePlayerGui::updateLcd() +void CMoviePlayerGui::updateLcd(bool display_playtime) { char tmp[20]; std::string lcd; std::string name; + if (display_playtime) + { + int ss = position/1000; + int hh = ss/3600; + ss -= hh * 3600; + int mm = ss/60; + ss -= mm * 60; + lcd = to_string(hh/10) + to_string(hh%10) + ":" + to_string(mm/10) + to_string(mm%10) + ":" + to_string(ss/10) + to_string(ss%10); + + CVFD::getInstance()->setMode(LCD_MODE); + CVFD::getInstance()->showMenuText(0, lcd.c_str(), -1, true); + return; + } + if (isMovieBrowser && p_movie_info && !p_movie_info->epgTitle.empty() && p_movie_info->epgTitle.size() && strncmp(p_movie_info->epgTitle.c_str(), "not", 3)) name = p_movie_info->epgTitle; else @@ -1475,9 +1489,9 @@ void CMoviePlayerGui::PlayFileLoop(void) #endif while (playstate >= CMoviePlayerGui::PLAY) { - if (update_lcd) { + if (update_lcd || g_settings.movieplayer_display_playtime) { update_lcd = false; - updateLcd(); + updateLcd(g_settings.movieplayer_display_playtime); } if (first_start) { usleep(50000); @@ -1853,6 +1867,8 @@ void CMoviePlayerGui::PlayFileLoop(void) } else if (msg == CRCInput::RC_info) { if (fromInfoviewer) { disableOsdElements(NO_MUTE); + if (g_settings.movieplayer_display_playtime) + updateLcd(false); // force title #ifdef ENABLE_LUA if (isLuaPlay && haveLuaInfoFunc) { int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; @@ -1881,6 +1897,8 @@ void CMoviePlayerGui::PlayFileLoop(void) bool restore = FileTimeOSD->IsVisible(); FileTimeOSD->kill(); + if (g_settings.movieplayer_display_playtime) + updateLcd(false); // force title if (msg == CRCInput::RC_epg) g_EventList->exec(CNeutrinoApp::getInstance()->channelList->getActiveChannel_ChannelID(), CNeutrinoApp::getInstance()->channelList->getActiveChannelName()); else if (msg == NeutrinoMessages::SHOW_EPG) @@ -1930,6 +1948,7 @@ void CMoviePlayerGui::PlayFileLoop(void) // do nothing } else if (msg == (neutrino_msg_t) CRCInput::RC_setup) { CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::SHOW_MAINMENU, 0); + update_lcd = true; } else if (msg == CRCInput::RC_red || msg == CRCInput::RC_green || msg == CRCInput::RC_yellow || msg == CRCInput::RC_blue ) { //maybe move FileTimeOSD->kill to Usermenu to simplify this call bool restore = FileTimeOSD->IsVisible(); @@ -2029,6 +2048,8 @@ void CMoviePlayerGui::callInfoViewer(bool init_vzap_it) } if (timeshift != TSHIFT_MODE_OFF) { + if (g_settings.movieplayer_display_playtime) + updateLcd(false); // force title g_InfoViewer->showTitle(CNeutrinoApp::getInstance()->channelList->getActiveChannel()); return; } @@ -2059,7 +2080,6 @@ void CMoviePlayerGui::callInfoViewer(bool init_vzap_it) } if (p_movie_info) { - if(duration <= 0) UpdatePosition(); @@ -2079,11 +2099,15 @@ void CMoviePlayerGui::callInfoViewer(bool init_vzap_it) if (channelName.empty()) channelName = pretty_name; + if (g_settings.movieplayer_display_playtime) + updateLcd(false); // force title g_InfoViewer->showMovieTitle(playstate, mi->epgId >>16, channelName, mi->epgTitle, mi->epgInfo1, duration, position, repeat_mode, init_vzap_it ? 0 /*IV_MODE_DEFAULT*/ : 1 /*IV_MODE_VIRTUAL_ZAP*/); return; } + if (g_settings.movieplayer_display_playtime) + updateLcd(false); // force title /* not moviebrowser => use the filename as title */ g_InfoViewer->showMovieTitle(playstate, 0, pretty_name, info_1, info_2, duration, position, repeat_mode); } diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 42c5b0f77..40e12550b 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -208,7 +208,7 @@ class CMoviePlayerGui : public CMenuTarget void handleMovieBrowser(neutrino_msg_t msg, int position = 0); bool SelectFile(); - void updateLcd(); + void updateLcd(bool display_playtime = false); bool convertSubtitle(std::string &text); void selectChapter(); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 2fbdbe395..ee03a7e23 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -875,6 +875,7 @@ int CNeutrinoApp::loadSetup(const char * fname) //Movie-Player g_settings.movieplayer_repeat_on = configfile.getInt32("movieplayer_repeat_on", CMoviePlayerGui::REPEAT_OFF); g_settings.youtube_dev_id = configfile.getString("youtube_dev_id","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); + g_settings.movieplayer_display_playtime = configfile.getInt32("movieplayer_display_playtime", 0); g_settings.youtube_enabled = configfile.getInt32("youtube_enabled", 1); g_settings.youtube_enabled = g_settings.youtube_enabled && check_youtube_dev_id(); g_settings.tmdb_api_key = configfile.getString("tmdb_api_key","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); @@ -1496,6 +1497,7 @@ void CNeutrinoApp::saveSetup(const char * fname) //Movie-Player configfile.setInt32( "movieplayer_repeat_on", g_settings.movieplayer_repeat_on ); + configfile.setInt32( "movieplayer_display_playtime", g_settings.movieplayer_display_playtime ); 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 ); diff --git a/src/system/locals.h b/src/system/locals.h index 40af0f895..fcce9298c 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1231,6 +1231,7 @@ typedef enum LOCALE_MENU_HINT_MOVIE, LOCALE_MENU_HINT_MOVIEBROWSER_FONTS, LOCALE_MENU_HINT_MOVIEBROWSER_SETUP, + LOCALE_MENU_HINT_MOVIEPLAYER_DISPLAY_PLAYTIME, LOCALE_MENU_HINT_MOVIEPLAYER_PLUGIN, LOCALE_MENU_HINT_NET_BROADCAST, LOCALE_MENU_HINT_NET_DHCP, @@ -1855,6 +1856,7 @@ typedef enum LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT1, LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT2, LOCALE_MOVIEPLAYER_CHAPTERS, + LOCALE_MOVIEPLAYER_DISPLAY_PLAYTIME, LOCALE_MOVIEPLAYER_FILEPLAYBACK_AUDIO, LOCALE_MOVIEPLAYER_FILEPLAYBACK_VIDEO, LOCALE_MOVIEPLAYER_HEAD, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 606ef3657..aa44655be 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1231,6 +1231,7 @@ const char * locale_real_names[] = "menu.hint_movie", "menu.hint_moviebrowser_fonts", "menu.hint_moviebrowser_setup", + "menu.hint_movieplayer_display_playtime", "menu.hint_movieplayer_plugin", "menu.hint_net_broadcast", "menu.hint_net_dhcp", @@ -1855,6 +1856,7 @@ const char * locale_real_names[] = "movieplayer.bookmarkname_hint1", "movieplayer.bookmarkname_hint2", "movieplayer.chapters", + "movieplayer.display_playtime", "movieplayer.fileplayback_audio", "movieplayer.fileplayback_video", "movieplayer.head", diff --git a/src/system/settings.h b/src/system/settings.h index 707d8984b..ee9e71bd7 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -784,6 +784,7 @@ struct SNeutrinoSettings //movieplayer int movieplayer_repeat_on; + int movieplayer_display_playtime; std::string youtube_dev_id; int youtube_enabled; std::string tmdb_api_key;