mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 17:31:20 +02:00
gui/movieplayer.cpp: add lcd indicate for slow motion,
update lcd before show infoviewer to have there correct info, update speed only if SetSpeed successfull
This commit is contained in:
@@ -239,14 +239,21 @@ void CMoviePlayerGui::updateLcd()
|
|||||||
|
|
||||||
switch (playstate) {
|
switch (playstate) {
|
||||||
case CMoviePlayerGui::PAUSE:
|
case CMoviePlayerGui::PAUSE:
|
||||||
lcd = "|| ";
|
if (speed < 0) {
|
||||||
|
sprintf(tmp, "%dx<| ", abs(speed));
|
||||||
|
lcd = tmp;
|
||||||
|
} else if (speed > 0) {
|
||||||
|
sprintf(tmp, "%dx|> ", abs(speed));
|
||||||
|
lcd = tmp;
|
||||||
|
} else
|
||||||
|
lcd = "|| ";
|
||||||
break;
|
break;
|
||||||
case CMoviePlayerGui::REW:
|
case CMoviePlayerGui::REW:
|
||||||
sprintf(tmp, "%dx<< ", speed);
|
sprintf(tmp, "%dx<< ", abs(speed));
|
||||||
lcd = tmp;
|
lcd = tmp;
|
||||||
break;
|
break;
|
||||||
case CMoviePlayerGui::FF:
|
case CMoviePlayerGui::FF:
|
||||||
sprintf(tmp, "%dx>> ", speed);
|
sprintf(tmp, "%dx>> ", abs(speed));
|
||||||
lcd = tmp;
|
lcd = tmp;
|
||||||
break;
|
break;
|
||||||
case CMoviePlayerGui::PLAY:
|
case CMoviePlayerGui::PLAY:
|
||||||
@@ -497,6 +504,11 @@ void CMoviePlayerGui::PlayFile(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
playback->GetSpeed(speed);
|
playback->GetSpeed(speed);
|
||||||
|
/* at BOF lib set speed 1, check it */
|
||||||
|
if ((playstate != CMoviePlayerGui::PLAY) && (speed == 1)) {
|
||||||
|
playstate = CMoviePlayerGui::PLAY;
|
||||||
|
update_lcd = true;
|
||||||
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("CMoviePlayerGui::PlayFile: speed %d position %d duration %d (%d, %d%%)\n", speed, position, duration, duration-position, file_prozent);
|
printf("CMoviePlayerGui::PlayFile: speed %d position %d duration %d (%d, %d%%)\n", speed, position, duration, duration-position, file_prozent);
|
||||||
#endif
|
#endif
|
||||||
@@ -521,10 +533,11 @@ void CMoviePlayerGui::PlayFile(void)
|
|||||||
playstate = CMoviePlayerGui::STOPPED;
|
playstate = CMoviePlayerGui::STOPPED;
|
||||||
} else if (msg == (neutrino_msg_t) g_settings.mpkey_play) {
|
} else if (msg == (neutrino_msg_t) g_settings.mpkey_play) {
|
||||||
if (playstate > CMoviePlayerGui::PLAY) {
|
if (playstate > CMoviePlayerGui::PLAY) {
|
||||||
update_lcd = true;
|
|
||||||
playstate = CMoviePlayerGui::PLAY;
|
playstate = CMoviePlayerGui::PLAY;
|
||||||
speed = 1;
|
speed = 1;
|
||||||
playback->SetSpeed(speed);
|
playback->SetSpeed(speed);
|
||||||
|
//update_lcd = true;
|
||||||
|
updateLcd();
|
||||||
if (!timeshift)
|
if (!timeshift)
|
||||||
callInfoViewer(duration, position);
|
callInfoViewer(duration, position);
|
||||||
}
|
}
|
||||||
@@ -533,7 +546,6 @@ void CMoviePlayerGui::PlayFile(void)
|
|||||||
FileTime.hide();
|
FileTime.hide();
|
||||||
}
|
}
|
||||||
} else if (msg == (neutrino_msg_t) g_settings.mpkey_pause) {
|
} else if (msg == (neutrino_msg_t) g_settings.mpkey_pause) {
|
||||||
update_lcd = true;
|
|
||||||
if (playstate == CMoviePlayerGui::PAUSE) {
|
if (playstate == CMoviePlayerGui::PAUSE) {
|
||||||
playstate = CMoviePlayerGui::PLAY;
|
playstate = CMoviePlayerGui::PLAY;
|
||||||
//CVFD::getInstance()->ShowIcon(VFD_ICON_PAUSE, false);
|
//CVFD::getInstance()->ShowIcon(VFD_ICON_PAUSE, false);
|
||||||
@@ -545,6 +557,8 @@ void CMoviePlayerGui::PlayFile(void)
|
|||||||
speed = 0;
|
speed = 0;
|
||||||
playback->SetSpeed(speed);
|
playback->SetSpeed(speed);
|
||||||
}
|
}
|
||||||
|
//update_lcd = true;
|
||||||
|
updateLcd();
|
||||||
if (!timeshift)
|
if (!timeshift)
|
||||||
callInfoViewer(duration, position);
|
callInfoViewer(duration, position);
|
||||||
|
|
||||||
@@ -558,16 +572,23 @@ void CMoviePlayerGui::PlayFile(void)
|
|||||||
} else if ((msg == (neutrino_msg_t) g_settings.mpkey_rewind) ||
|
} else if ((msg == (neutrino_msg_t) g_settings.mpkey_rewind) ||
|
||||||
(msg == (neutrino_msg_t) g_settings.mpkey_forward)) {
|
(msg == (neutrino_msg_t) g_settings.mpkey_forward)) {
|
||||||
|
|
||||||
|
int newspeed;
|
||||||
if (msg == (neutrino_msg_t) g_settings.mpkey_rewind) {
|
if (msg == (neutrino_msg_t) g_settings.mpkey_rewind) {
|
||||||
speed = (speed >= 0) ? -1 : speed - 1;
|
newspeed = (speed >= 0) ? -1 : speed - 1;
|
||||||
playstate = CMoviePlayerGui::REW;
|
if (playstate != CMoviePlayerGui::PAUSE)
|
||||||
|
playstate = CMoviePlayerGui::REW;
|
||||||
} else {
|
} else {
|
||||||
speed = (speed <= 0) ? 2 : speed + 1;
|
newspeed = (speed <= 0) ? 2 : speed + 1;
|
||||||
playstate = CMoviePlayerGui::FF;
|
if (playstate != CMoviePlayerGui::PAUSE)
|
||||||
|
playstate = CMoviePlayerGui::FF;
|
||||||
}
|
}
|
||||||
/* if paused, playback->SetSpeed() start slow motion */
|
/* if paused, playback->SetSpeed() start slow motion */
|
||||||
playback->SetSpeed(speed);
|
if (playback->SetSpeed(newspeed)) {
|
||||||
update_lcd = true;
|
printf("SetSpeed: update speed\n");
|
||||||
|
speed = newspeed;
|
||||||
|
updateLcd();
|
||||||
|
}
|
||||||
|
//update_lcd = true;
|
||||||
|
|
||||||
if (!timeshift)
|
if (!timeshift)
|
||||||
callInfoViewer(duration, position);
|
callInfoViewer(duration, position);
|
||||||
|
@@ -131,6 +131,7 @@ class CMoviePlayerGui : public CMenuTarget
|
|||||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||||
bool Playing() { return playing; };
|
bool Playing() { return playing; };
|
||||||
std::string CurrentAudioName() { return currentaudioname; };
|
std::string CurrentAudioName() { return currentaudioname; };
|
||||||
|
int GetSpeed() { return speed; }
|
||||||
int timeshift;
|
int timeshift;
|
||||||
int file_prozent;
|
int file_prozent;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user