mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 17:01:15 +02:00
gui/movieplayer.cpp: add position,duration, CTimeOSD class members;
add UpdatePosition() to be called from infoviewer; set infoviewer timer to 1 sec for playback
This commit is contained in:
@@ -148,6 +148,8 @@ void CMoviePlayerGui::cutNeutrino()
|
||||
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_ts);
|
||||
m_LastMode = (CNeutrinoApp::getInstance()->getLastMode() | NeutrinoMessages::norezap);
|
||||
/* set g_InfoViewer update timer to 1 sec, should be reset to default from restoreNeutrino->set neutrino mode */
|
||||
g_InfoViewer->setUpdateTimer(1000 * 1000);
|
||||
}
|
||||
|
||||
void CMoviePlayerGui::restoreNeutrino()
|
||||
@@ -374,13 +376,13 @@ bool CMoviePlayerGui::SelectFile()
|
||||
if (cLine[strlen(cLine)-1]=='\r')
|
||||
cLine[strlen(cLine)-1]=0;
|
||||
|
||||
int duration;
|
||||
sscanf(cLine, "#EXTINF:%d,%[^\n]\n", &duration, name);
|
||||
int dur;
|
||||
sscanf(cLine, "#EXTINF:%d,%[^\n]\n", &dur, name);
|
||||
if (strlen(cLine) > 0 && cLine[0]!='#')
|
||||
{
|
||||
char *url = strstr(cLine, "http://");
|
||||
if (url != NULL) {
|
||||
printf("name %s [%d] url: %s\n", name, duration, url);
|
||||
printf("name %s [%d] url: %s\n", name, dur, url);
|
||||
full_name = url;
|
||||
if(strlen(name))
|
||||
file_name = name;
|
||||
@@ -415,13 +417,13 @@ void CMoviePlayerGui::PlayFile(void)
|
||||
neutrino_msg_data_t data;
|
||||
menu_ret = menu_return::RETURN_REPAINT;
|
||||
|
||||
int position = 0, duration = 0;
|
||||
bool first_start_timeshift = false;
|
||||
bool time_forced = false;
|
||||
bool update_lcd = true;
|
||||
int eof = 0;
|
||||
|
||||
CTimeOSD FileTime;
|
||||
//CTimeOSD FileTime;
|
||||
position = 0, duration = 0;
|
||||
|
||||
playstate = CMoviePlayerGui::STOPPED;
|
||||
printf("Startplay at %d seconds\n", startposition/1000);
|
||||
@@ -489,7 +491,7 @@ void CMoviePlayerGui::PlayFile(void)
|
||||
updateLcd();
|
||||
}
|
||||
if (first_start_timeshift) {
|
||||
callInfoViewer(duration, position);
|
||||
callInfoViewer(/*duration, position*/);
|
||||
first_start_timeshift = false;
|
||||
}
|
||||
|
||||
@@ -539,7 +541,7 @@ void CMoviePlayerGui::PlayFile(void)
|
||||
//update_lcd = true;
|
||||
updateLcd();
|
||||
if (!timeshift)
|
||||
callInfoViewer(duration, position);
|
||||
callInfoViewer(/*duration, position*/);
|
||||
}
|
||||
if (time_forced) {
|
||||
time_forced = false;
|
||||
@@ -560,7 +562,7 @@ void CMoviePlayerGui::PlayFile(void)
|
||||
//update_lcd = true;
|
||||
updateLcd();
|
||||
if (!timeshift)
|
||||
callInfoViewer(duration, position);
|
||||
callInfoViewer(/*duration, position*/);
|
||||
|
||||
} else if (msg == (neutrino_msg_t) g_settings.mpkey_bookmark) {
|
||||
handleMovieBrowser((neutrino_msg_t) g_settings.mpkey_bookmark, position);
|
||||
@@ -591,7 +593,7 @@ void CMoviePlayerGui::PlayFile(void)
|
||||
//update_lcd = true;
|
||||
|
||||
if (!timeshift)
|
||||
callInfoViewer(duration, position);
|
||||
callInfoViewer(/*duration, position*/);
|
||||
|
||||
if (!FileTime.IsVisible()) {
|
||||
FileTime.show(position);
|
||||
@@ -622,7 +624,7 @@ void CMoviePlayerGui::PlayFile(void)
|
||||
} else if (msg == CRCInput::RC_0) { // cancel bookmark jump
|
||||
handleMovieBrowser(CRCInput::RC_0, position);
|
||||
} else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) {
|
||||
callInfoViewer(duration, position);
|
||||
callInfoViewer(/*duration, position*/);
|
||||
update_lcd = true;
|
||||
//showHelpTS();
|
||||
} else if(timeshift && (msg == CRCInput::RC_text || msg == CRCInput::RC_epg || msg == NeutrinoMessages::SHOW_EPG)) {
|
||||
@@ -719,7 +721,7 @@ void CMoviePlayerGui::PlayFile(void)
|
||||
InfoClock->StartClock();
|
||||
}
|
||||
|
||||
void CMoviePlayerGui::callInfoViewer(const int duration, const int curr_pos)
|
||||
void CMoviePlayerGui::callInfoViewer(/*const int duration, const int curr_pos*/)
|
||||
{
|
||||
if(timeshift) {
|
||||
g_InfoViewer->showTitle(CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber(),
|
||||
@@ -733,12 +735,12 @@ void CMoviePlayerGui::callInfoViewer(const int duration, const int curr_pos)
|
||||
|
||||
if (isMovieBrowser && p_movie_info) {
|
||||
g_InfoViewer->showMovieTitle(playstate, p_movie_info->epgChannel, p_movie_info->epgTitle, p_movie_info->epgInfo1,
|
||||
duration, curr_pos);
|
||||
duration, position);
|
||||
return;
|
||||
}
|
||||
|
||||
/* not moviebrowser => use the filename as title */
|
||||
g_InfoViewer->showMovieTitle(playstate, file_name, "", "", duration, curr_pos);
|
||||
g_InfoViewer->showMovieTitle(playstate, file_name, "", "", duration, position);
|
||||
}
|
||||
|
||||
bool CMoviePlayerGui::getAudioName(int apid, std::string &apidtitle)
|
||||
@@ -896,7 +898,7 @@ void CMoviePlayerGui::selectAudioPid(bool file_player)
|
||||
}
|
||||
}
|
||||
|
||||
void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int position)
|
||||
void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/)
|
||||
{
|
||||
CMovieInfo cMovieInfo; // funktions to save and load movie info
|
||||
|
||||
@@ -1150,6 +1152,18 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int position)
|
||||
return;
|
||||
}
|
||||
|
||||
void CMoviePlayerGui::UpdatePosition()
|
||||
{
|
||||
if(playback->GetPosition(position, duration)) {
|
||||
if(duration > 100)
|
||||
file_prozent = (unsigned char) (position / (duration / 100));
|
||||
FileTime.update(position, duration);
|
||||
#ifdef DEBUG
|
||||
printf("CMoviePlayerGui::PlayFile: speed %d position %d duration %d (%d, %d%%)\n", speed, position, duration, duration-position, file_prozent);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void CMoviePlayerGui::showHelpTS()
|
||||
{
|
||||
Helpbox helpbox;
|
||||
|
Reference in New Issue
Block a user