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/followscreenings.h>
#include <gui/moviebrowser.h>
#include <gui/movieplayer.h>
#include <gui/customcolor.h>
#include <gui/pictureviewer.h>
#include <gui/tmdb.h>
@@ -504,7 +505,7 @@ bool CEpgData::isCurrentEPG(const t_channel_id channel_id)
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;
@@ -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 += "\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);
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)
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RIGHT, sx + ox - iw - 10, iy);
}
// why we do not show movie progress?
showProgressBar();
}
showProgressBar();
// show Timer Event Buttons
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();
}
}
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;
case NeutrinoMessages::EVT_CURRENTNEXT_EPG:
if (/*!id && */ ((*(t_channel_id *) data) == (channel_id & 0xFFFFFFFFFFFFULL))) {