- movieplayer: change logic in updateLcd() function

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2018-02-28 23:45:54 +01:00
committed by Thilo Graf
parent 3e8e7758e8
commit 97d4740fb3

View File

@@ -497,7 +497,7 @@ void CMoviePlayerGui::updateLcd(bool display_playtime)
std::string lcd; std::string lcd;
std::string name; std::string name;
if (display_playtime) if (display_playtime && g_info.hw_caps->display_xres >= 8)
{ {
int ss = position/1000; int ss = position/1000;
int hh = ss/3600; int hh = ss/3600;
@@ -505,26 +505,28 @@ void CMoviePlayerGui::updateLcd(bool display_playtime)
int mm = ss/60; int mm = ss/60;
ss -= mm * 60; ss -= mm * 60;
lcd = to_string(hh/10) + to_string(hh%10) + ":" + to_string(mm/10) + to_string(mm%10) + ":" + to_string(ss/10) + to_string(ss%10); lcd = to_string(hh/10) + to_string(hh%10) + ":" + to_string(mm/10) + to_string(mm%10) + ":" + to_string(ss/10) + to_string(ss%10);
CVFD::getInstance()->setMode(LCD_MODE);
CVFD::getInstance()->showMenuText(0, lcd.c_str(), -1, true);
return;
} }
else
{
if (isMovieBrowser && p_movie_info && !p_movie_info->epgTitle.empty() && p_movie_info->epgTitle.size() && strncmp(p_movie_info->epgTitle.c_str(), "not", 3)) if (isMovieBrowser && p_movie_info && !p_movie_info->epgTitle.empty() && p_movie_info->epgTitle.size() && strncmp(p_movie_info->epgTitle.c_str(), "not", 3))
name = p_movie_info->epgTitle; name = p_movie_info->epgTitle;
else else
name = pretty_name; name = pretty_name;
switch (playstate) { switch (playstate)
{
case CMoviePlayerGui::PAUSE: case CMoviePlayerGui::PAUSE:
if (speed < 0) { if (speed < 0)
{
sprintf(tmp, "%dx<| ", abs(speed)); sprintf(tmp, "%dx<| ", abs(speed));
lcd = tmp; lcd = tmp;
} else if (speed > 0) { }
else if (speed > 0)
{
sprintf(tmp, "%dx|> ", abs(speed)); sprintf(tmp, "%dx|> ", abs(speed));
lcd = tmp; lcd = tmp;
} else }
else
lcd = "|| "; lcd = "|| ";
break; break;
case CMoviePlayerGui::REW: case CMoviePlayerGui::REW:
@@ -542,6 +544,8 @@ void CMoviePlayerGui::updateLcd(bool display_playtime)
break; break;
} }
lcd += name; lcd += name;
}
CVFD::getInstance()->setMode(LCD_MODE); CVFD::getInstance()->setMode(LCD_MODE);
CVFD::getInstance()->showMenuText(0, lcd.c_str(), -1, true); CVFD::getInstance()->showMenuText(0, lcd.c_str(), -1, true);
} }