diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 23f09266f..06db287ab 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -472,7 +472,9 @@ void CInfoViewer::show_current_next(bool new_chan, int epgpos) } } -void CInfoViewer::showMovieTitle( const int playState, const std::string Channel, const std::string g_file_epg, const std::string g_file_epg1) +void CInfoViewer::showMovieTitle(const int playState, const std::string Channel, + const std::string g_file_epg, const std::string g_file_epg1, + const int duration, const int curr_pos) { chack_channellogo_ca_SettingsChange(); aspectRatio = 0; @@ -517,7 +519,10 @@ void CInfoViewer::showMovieTitle( const int playState, const std::string Channel char runningPercent = file_prozent; if (runningPercent > 100) runningPercent = 100; - display_Info(g_file_epg.c_str(), g_file_epg1.c_str(), true, false, runningPercent); + + char runningRest[32]; // %d can be 10 digits max... + sprintf(runningRest, "%d / %d min", (curr_pos + 30000) / 60000, (duration + 30000) / 60000); + display_Info(g_file_epg.c_str(), g_file_epg1.c_str(), true, false, runningPercent, NULL, runningRest); const char *playicon = NULL; switch (playState) { diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index 67d82d76a..c3a783a40 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -151,7 +151,9 @@ class CInfoViewer uint32_t lcdUpdateTimer; CInfoViewer(); - void showMovieTitle( const int playState, const std::string Channel, const std::string g_file_epg, const std::string g_file_epg1); + void showMovieTitle(const int playState, const std::string title, + const std::string g_file_epg, const std::string g_file_epg1, + const int duration, const int curr_pos); void start(); void showEpgInfo(); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 3fa9b6abf..dc7c67508 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -945,7 +945,7 @@ void CMoviePlayerGui::PlayFile(void) speed = 1; playback->SetSpeed(speed); if (!timeshift) - callInfoViewer(p_movie_info->epgTitle, p_movie_info->epgInfo1, p_movie_info->epgChannel ); + callInfoViewer(p_movie_info->epgTitle, p_movie_info->epgInfo1, p_movie_info->epgChannel, duration, position); } else if (!timeshift) { open_filebrowser = true; } @@ -962,17 +962,15 @@ void CMoviePlayerGui::PlayFile(void) //CVFD::getInstance()->ShowIcon(VFD_ICON_PAUSE, false); speed = 1; playback->SetSpeed(speed); - if (!timeshift ) - callInfoViewer(p_movie_info->epgTitle, p_movie_info->epgInfo1, p_movie_info->epgChannel ); } else { playstate = CMoviePlayerGui::PAUSE; //CVFD::getInstance()->ShowIcon(VFD_ICON_PAUSE, true); speed = 0; playback->SetSpeed(speed); - if (!timeshift) - callInfoViewer(p_movie_info->epgTitle, p_movie_info->epgInfo1, p_movie_info->epgChannel ); - } + if (!timeshift) + callInfoViewer(p_movie_info->epgTitle, p_movie_info->epgInfo1, p_movie_info->epgChannel, position, duration); + } else if (msg == (neutrino_msg_t) g_settings.mpkey_bookmark) { // is there already a bookmark activity? if (isMovieBrowser != true) { @@ -1103,7 +1101,7 @@ void CMoviePlayerGui::PlayFile(void) update_lcd = true; if (!timeshift) - callInfoViewer(p_movie_info->epgTitle, p_movie_info->epgInfo1, p_movie_info->epgChannel ); + callInfoViewer(p_movie_info->epgTitle, p_movie_info->epgInfo1, p_movie_info->epgChannel, position, duration); if (!FileTime.IsVisible()) { if (g_settings.mode_clock) @@ -1125,7 +1123,7 @@ void CMoviePlayerGui::PlayFile(void) playstate = CMoviePlayerGui::FF; if (!timeshift) - callInfoViewer(p_movie_info->epgTitle, p_movie_info->epgInfo1, p_movie_info->epgChannel ); + callInfoViewer(p_movie_info->epgTitle, p_movie_info->epgInfo1, p_movie_info->epgChannel, duration, position); if (!FileTime.IsVisible()) { if (g_settings.mode_clock) @@ -1140,7 +1138,7 @@ void CMoviePlayerGui::PlayFile(void) g_InfoViewer->showTitle(CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber(), CNeutrinoApp::getInstance()->channelList->getActiveChannelName(), CNeutrinoApp::getInstance()->channelList->getActiveSatellitePosition(), CNeutrinoApp::getInstance()->channelList->getActiveChannel_ChannelID()); // UTF-8 else { - callInfoViewer(p_movie_info->epgTitle, p_movie_info->epgInfo1, p_movie_info->epgChannel ); + callInfoViewer(p_movie_info->epgTitle, p_movie_info->epgInfo1, p_movie_info->epgChannel, duration, position); CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8); update_lcd = true; //showHelpTS(); @@ -1268,10 +1266,10 @@ printf("CMoviePlayerGui::PlayFile: exit, isMovieBrowser %d p_movie_info %x\n", i if (g_settings.mode_clock) InfoClock->StartClock(); } -void CMoviePlayerGui::callInfoViewer(const std::string & epg_title, const std::string & epg_info1, const std::string & epg_channel ) +void CMoviePlayerGui::callInfoViewer(const std::string & epg_title, const std::string & epg_info1, const std::string & epg_channel, const int duration, const int curr_pos) { if (isMovieBrowser) { - g_InfoViewer->showMovieTitle(playstate, epg_channel.c_str(), epg_title, epg_info1); + g_InfoViewer->showMovieTitle(playstate, epg_channel.c_str(), epg_title, epg_info1, duration, curr_pos); } else { char temp_name[255]; const char *slash = strrchr(filename, '/'); @@ -1287,7 +1285,7 @@ void CMoviePlayerGui::callInfoViewer(const std::string & epg_title, const std::s temp_name[len] = 0; } // g_InfoViewer->showTitle(0, temp_name, 0, 0); // UTF-8 - g_InfoViewer->showMovieTitle(playstate, temp_name, "", ""); // UTF-8 + g_InfoViewer->showMovieTitle(playstate, temp_name, "", "", duration, curr_pos); } } void CMoviePlayerGui::showHelpTS() diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 06431b2c7..3f15bc92f 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -109,7 +109,8 @@ class CMoviePlayerGui : public CMenuTarget CFileFilter vlcfilefilter; void showHelpTS(void); void showHelpVLC(void); - void callInfoViewer(const std::string & epg_title, const std::string & epg_info1, const std::string & epg_channel ); + void callInfoViewer(const std::string & epg_title, const std::string & epg_info1, + const std::string & epg_channel, const int duration, const int pos); public: CMoviePlayerGui(); ~CMoviePlayerGui();