epgview: show progressbar in movieplayer mode

Origin commit data
------------------
Branch: ni/coolstream
Commit: de74242310
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-08-10 (Wed, 10 Aug 2016)

Origin message was:
------------------
- epgview: show progressbar in movieplayer mode

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2016-08-10 15:53:11 +02:00
parent f4dacaab4a
commit a8721ee89c
4 changed files with 26 additions and 7 deletions

View File

@@ -48,6 +48,7 @@
#include <gui/filebrowser.h> #include <gui/filebrowser.h>
#include <gui/followscreenings.h> #include <gui/followscreenings.h>
#include <gui/moviebrowser.h> #include <gui/moviebrowser.h>
#include <gui/movieplayer.h>
#include <gui/customcolor.h> #include <gui/customcolor.h>
#include <gui/pictureviewer.h> #include <gui/pictureviewer.h>
#include <gui/tmdb.h> #include <gui/tmdb.h>
@@ -504,7 +505,7 @@ bool CEpgData::isCurrentEPG(const t_channel_id channel_id)
return false; return false;
} }
int CEpgData::show_mp(MI_MOVIE_INFO *mi, int /*mp_position*/, int /*mp_duration*/, bool doLoop) int CEpgData::show_mp(MI_MOVIE_INFO *mi, int mp_position, int mp_duration, bool doLoop)
{ {
int res = menu_return::RETURN_REPAINT; int res = menu_return::RETURN_REPAINT;
@@ -647,6 +648,12 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mi, int /*mp_position*/, int /*mp_duration*
extMovieInfo += mp_movie_info->file.getFileName(); extMovieInfo += mp_movie_info->file.getFileName();
extMovieInfo += "\n"; extMovieInfo += "\n";
// this calculation is taken from timeosd.cpp
epg_done = (mp_duration && mp_duration > 100) ? (mp_position * 100 / mp_duration) : -1;
if (epg_done > 100)
epg_done = 100;
//printf("[%s:%d] epg_done: %d\n", __func__, __LINE__, epg_done);
res = show(mp_movie_info->epgEpgId >> 16, 0, 0, doLoop, false, true); res = show(mp_movie_info->epgEpgId >> 16, 0, 0, doLoop, false, true);
if(!epgTextSwitch.empty()) if(!epgTextSwitch.empty())
{ {
@@ -911,10 +918,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
if (next_id) if (next_id)
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RIGHT, sx + ox - iw - 10, iy); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RIGHT, sx + ox - iw - 10, iy);
} }
// why we do not show movie progress?
showProgressBar();
} }
showProgressBar();
// show Timer Event Buttons // show Timer Event Buttons
showTimerEventBar(true, isCurrentEPG(channel_id), mp_info); showTimerEventBar(true, isCurrentEPG(channel_id), mp_info);
@@ -956,6 +961,20 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
showProgressBar(); showProgressBar();
} }
} }
else if (epg_done != -1)
{
CMoviePlayerGui::getInstance().UpdatePosition();
int mp_position = CMoviePlayerGui::getInstance().GetPosition();
int mp_duration = CMoviePlayerGui::getInstance().GetDuration();
// this calculation is taken from timeosd.cpp
epg_done = (mp_duration && mp_duration > 100) ? (mp_position * 100 / mp_duration) : -1;
if (epg_done > 100)
epg_done = 100;
//printf("[%s:%d] epg_done: %d\n", __func__, __LINE__, epg_done);
showProgressBar();
}
break; break;
case NeutrinoMessages::EVT_CURRENTNEXT_EPG: case NeutrinoMessages::EVT_CURRENTNEXT_EPG:
if (/*!id && */ ((*(t_channel_id *) data) == (channel_id & 0xFFFFFFFFFFFFULL))) { if (/*!id && */ ((*(t_channel_id *) data) == (channel_id & 0xFFFFFFFFFFFFULL))) {

View File

@@ -105,7 +105,7 @@ class CEpgData
~CEpgData(); ~CEpgData();
void start( ); void start( );
int show(const t_channel_id channel_id, uint64_t id = 0, time_t* startzeit = NULL, bool doLoop = true, bool callFromfollowlist = false, bool mp_info = false ); int show(const t_channel_id channel_id, uint64_t id = 0, time_t* startzeit = NULL, bool doLoop = true, bool callFromfollowlist = false, bool mp_info = false );
int show_mp(MI_MOVIE_INFO *mi, int mp_position = 1, int mp_duration = 1, bool doLoop = true); int show_mp(MI_MOVIE_INFO *mi, int mp_position = 0, int mp_duration = 0, bool doLoop = true);
void hide(); void hide();
}; };

View File

@@ -1952,7 +1952,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg)
if (m_movieSelectionHandler != NULL) if (m_movieSelectionHandler != NULL)
{ {
framebuffer->paintBackground(); //clear whole screen framebuffer->paintBackground(); //clear whole screen
g_EpgData->show_mp(m_movieSelectionHandler, 0, 0); g_EpgData->show_mp(m_movieSelectionHandler);
refresh(); refresh();
} }
} }

View File

@@ -2160,7 +2160,7 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/)
CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate);
} }
else if (p_movie_info) else if (p_movie_info)
g_EpgData->show_mp(p_movie_info,0,0); g_EpgData->show_mp(p_movie_info, position, duration);
CInfoClock::getInstance()->enableInfoClock(true); CInfoClock::getInstance()->enableInfoClock(true);
if (restore) { if (restore) {