mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 01:11:06 +02:00
update glcd
Origin commit data
------------------
Branch: ni/coolstream
Commit: 0c2dcc9eb1
Author: redblue-pkt <redblue-pkt@orange.pl>
Date: 2020-06-19 (Fri, 19 Jun 2020)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -84,10 +84,6 @@
|
||||
//NI InfoIcons
|
||||
#include <gui/infoicons.h>
|
||||
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
bool glcd_play = false;
|
||||
#endif
|
||||
|
||||
#if HAVE_COOL_HARDWARE || HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
|
||||
#define LCD_MODE CVFD::MODE_MENU_UTF8
|
||||
#else
|
||||
@@ -391,6 +387,21 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
if (!bgThread) {
|
||||
cGLCD::MirrorOSD(false);
|
||||
|
||||
channel = g_Locale->getText(LOCALE_MOVIEPLAYER_HEAD);
|
||||
|
||||
epg = g_Locale->getText(LOCALE_MPKEY_STOP);
|
||||
cGLCD::ShowLcdIcon(false);
|
||||
cGLCD::lockChannel(channel, epg, 0);
|
||||
cGLCD::lockDuration("00/00");
|
||||
cGLCD::lockStart("00:00");
|
||||
cGLCD::lockEnd("00:00");
|
||||
}
|
||||
#endif
|
||||
|
||||
exec_controlscript(MOVIEPLAYER_START_SCRIPT);
|
||||
|
||||
Cleanup();
|
||||
@@ -488,11 +499,39 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey)
|
||||
timeshift = TSHIFT_MODE_OFF;
|
||||
return menu_return::RETURN_EXIT_ALL;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
if (!isHTTP || !isUPNP || !bgThread) {
|
||||
cGLCD::MirrorOSD(g_settings.glcd_mirror_osd);
|
||||
cGLCD::ShowLcdIcon(false);
|
||||
cGLCD::unlockChannel();
|
||||
cGLCD::unlockDuration();
|
||||
cGLCD::unlockStart();
|
||||
cGLCD::unlockEnd();
|
||||
}
|
||||
#endif
|
||||
|
||||
return menu_ret;
|
||||
}
|
||||
|
||||
void CMoviePlayerGui::updateLcd(bool display_playtime)
|
||||
{
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
if (!bgThread) {
|
||||
if (CMoviePlayerGui::getInstance().p_movie_info)
|
||||
{
|
||||
if (!CMoviePlayerGui::getInstance().p_movie_info->channelName.empty())
|
||||
channel = CMoviePlayerGui::getInstance().p_movie_info->channelName;
|
||||
if (!CMoviePlayerGui::getInstance().p_movie_info->epgTitle.empty())
|
||||
epg = CMoviePlayerGui::getInstance().p_movie_info->epgTitle;
|
||||
} else if (!CMoviePlayerGui::getInstance().GetFile().empty()) {
|
||||
epg = CMoviePlayerGui::getInstance().GetFile();
|
||||
}
|
||||
|
||||
if (channel.empty())
|
||||
channel = g_Locale->getText(LOCALE_MOVIEPLAYER_HEAD);
|
||||
}
|
||||
#endif
|
||||
char tmp[20];
|
||||
std::string lcd;
|
||||
std::string name;
|
||||
@@ -515,7 +554,32 @@ void CMoviePlayerGui::updateLcd(bool display_playtime)
|
||||
|
||||
switch (playstate)
|
||||
{
|
||||
case CMoviePlayerGui::STOPPED:
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
if (!bgThread) {
|
||||
channel = g_Locale->getText(LOCALE_MOVIEPLAYER_HEAD);
|
||||
|
||||
epg = g_Locale->getText(LOCALE_MPKEY_STOP);
|
||||
|
||||
cGLCD::ShowLcdIcon(false);
|
||||
cGLCD::lockChannel(channel, epg, 0);
|
||||
cGLCD::lockDuration("00/00");
|
||||
cGLCD::lockStart("00:00");
|
||||
cGLCD::lockEnd("00:00");
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case CMoviePlayerGui::PAUSE:
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
if (!bgThread) {
|
||||
channel = "";
|
||||
cGLCD::lockChannel(channel, epg, glcd_position);
|
||||
cGLCD::lockDuration(glcd_duration);
|
||||
cGLCD::lockStart(start);
|
||||
cGLCD::lockEnd(end);
|
||||
cGLCD::ShowLcdIcon(true);
|
||||
}
|
||||
#endif
|
||||
if (speed < 0)
|
||||
{
|
||||
sprintf(tmp, "%dx<| ", abs(speed));
|
||||
@@ -530,14 +594,44 @@ void CMoviePlayerGui::updateLcd(bool display_playtime)
|
||||
lcd = "|| ";
|
||||
break;
|
||||
case CMoviePlayerGui::REW:
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
if (!bgThread) {
|
||||
channel = "";
|
||||
cGLCD::lockChannel(channel, epg, glcd_position);
|
||||
cGLCD::lockDuration(glcd_duration);
|
||||
cGLCD::lockStart(start);
|
||||
cGLCD::lockEnd(end);
|
||||
cGLCD::ShowLcdIcon(true);
|
||||
}
|
||||
#endif
|
||||
sprintf(tmp, "%dx<< ", abs(speed));
|
||||
lcd = tmp;
|
||||
break;
|
||||
case CMoviePlayerGui::FF:
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
if (!bgThread) {
|
||||
channel = "";
|
||||
cGLCD::lockChannel(channel, epg, glcd_position);
|
||||
cGLCD::lockDuration(glcd_duration);
|
||||
cGLCD::lockStart(start);
|
||||
cGLCD::lockEnd(end);
|
||||
cGLCD::ShowLcdIcon(true);
|
||||
}
|
||||
#endif
|
||||
sprintf(tmp, "%dx>> ", abs(speed));
|
||||
lcd = tmp;
|
||||
break;
|
||||
case CMoviePlayerGui::PLAY:
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
if (!bgThread) {
|
||||
channel = "";
|
||||
cGLCD::lockChannel(channel, epg, glcd_position);
|
||||
cGLCD::lockDuration(glcd_duration);
|
||||
cGLCD::lockStart(start);
|
||||
cGLCD::lockEnd(end);
|
||||
cGLCD::ShowLcdIcon(true);
|
||||
}
|
||||
#endif
|
||||
lcd = "> ";
|
||||
break;
|
||||
default:
|
||||
@@ -1292,6 +1386,19 @@ void CMoviePlayerGui::stopPlayBack(void)
|
||||
webtv_started = false;
|
||||
if(playback)
|
||||
playback->RequestAbort();
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
if (!bgThread) {
|
||||
channel = g_Locale->getText(LOCALE_MOVIEPLAYER_HEAD);
|
||||
|
||||
epg = g_Locale->getText(LOCALE_MPKEY_STOP);
|
||||
|
||||
cGLCD::ShowLcdIcon(false);
|
||||
cGLCD::lockChannel(channel, epg, 0);
|
||||
cGLCD::lockDuration("00/00");
|
||||
cGLCD::lockStart("00:00");
|
||||
cGLCD::lockEnd("00:00");
|
||||
}
|
||||
#endif
|
||||
mutex.unlock();
|
||||
cond.broadcast();
|
||||
pthread_join(bgThread, NULL);
|
||||
@@ -1375,13 +1482,7 @@ bool CMoviePlayerGui::PlayFileStart(void)
|
||||
}
|
||||
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
nGLCD::MirrorOSD(false);
|
||||
if (p_movie_info)
|
||||
nGLCD::lockChannel(p_movie_info->channelName, p_movie_info->epgTitle);
|
||||
else {
|
||||
glcd_play = true;
|
||||
nGLCD::lockChannel(g_Locale->getText(LOCALE_MOVIEPLAYER_HEAD), file_name.c_str(), file_prozent);
|
||||
}
|
||||
cGLCD::MirrorOSD(false);
|
||||
#endif
|
||||
|
||||
file_prozent = 0;
|
||||
@@ -1578,14 +1679,6 @@ void CMoviePlayerGui::PlayFileLoop(void)
|
||||
|
||||
while (playstate >= CMoviePlayerGui::PLAY)
|
||||
{
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
if (p_movie_info)
|
||||
nGLCD::lockChannel(p_movie_info->channelName, p_movie_info->epgTitle, duration ? (100 * position / duration) : 0);
|
||||
else {
|
||||
glcd_play = true;
|
||||
nGLCD::lockChannel(g_Locale->getText(LOCALE_MOVIEPLAYER_HEAD), file_name.c_str(), file_prozent);
|
||||
}
|
||||
#endif
|
||||
if (update_lcd || g_settings.movieplayer_display_playtime) {
|
||||
update_lcd = false;
|
||||
updateLcd(g_settings.movieplayer_display_playtime);
|
||||
@@ -1639,6 +1732,32 @@ void CMoviePlayerGui::PlayFileLoop(void)
|
||||
if (duration > 100)
|
||||
file_prozent = (unsigned char) (position / (duration / 100));
|
||||
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
if (!bgThread) {
|
||||
int pos = position / (60 * 1000);
|
||||
int dur = duration / (60 * 1000);
|
||||
|
||||
glcd_duration = to_string(position / (60 * 1000)) + "/" + to_string(duration / (60 * 1000));
|
||||
//glcd_duration = to_string(pos/10) + to_string(pos%10) + "/" + to_string(dur/10) + to_string(dur%10);
|
||||
|
||||
time_t sTime = time(NULL);
|
||||
sTime -= (position / 1000);
|
||||
tm_struct = localtime(&sTime);
|
||||
start = to_string(tm_struct->tm_hour/10) + to_string(tm_struct->tm_hour%10) + ":" + to_string(tm_struct->tm_min/10) + to_string(tm_struct->tm_min%10);
|
||||
|
||||
time_t eTime = time(NULL);
|
||||
eTime += (duration / 1000) - (position / 1000);
|
||||
tm_struct = localtime(&eTime);
|
||||
end = to_string(tm_struct->tm_hour/10) + to_string(tm_struct->tm_hour%10) + ":" + to_string(tm_struct->tm_min/10) + to_string(tm_struct->tm_min%10);
|
||||
|
||||
//glcd_position = duration ? 100 * (position / duration) : 0;
|
||||
glcd_position = file_prozent;
|
||||
cGLCD::lockChannel(channel, epg, glcd_position);
|
||||
cGLCD::lockDuration(glcd_duration);
|
||||
cGLCD::lockStart(start);
|
||||
cGLCD::lockEnd(end);
|
||||
}
|
||||
#endif
|
||||
CVFD::getInstance()->showPercentOver(file_prozent);
|
||||
|
||||
playback->GetSpeed(speed);
|
||||
@@ -2098,9 +2217,16 @@ void CMoviePlayerGui::PlayFileEnd(bool restore)
|
||||
playback->SetSpeed(1);
|
||||
playback->Close();
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
if (p_movie_info || glcd_play == true) {
|
||||
glcd_play = false;
|
||||
nGLCD::unlockChannel();
|
||||
if (!bgThread) {
|
||||
channel = g_Locale->getText(LOCALE_MOVIEPLAYER_HEAD);
|
||||
|
||||
epg = g_Locale->getText(LOCALE_MPKEY_STOP);
|
||||
|
||||
cGLCD::ShowLcdIcon(false);
|
||||
cGLCD::lockChannel(channel, epg, 0);
|
||||
cGLCD::lockDuration("00/00");
|
||||
cGLCD::lockStart("00:00");
|
||||
cGLCD::lockEnd("00:00");
|
||||
}
|
||||
#endif
|
||||
if (iso_file) {
|
||||
@@ -2252,8 +2378,10 @@ void CMoviePlayerGui::callInfoViewer(bool init_vzap_it)
|
||||
if (!movie_info.channelName.empty() || !movie_info.epgTitle.empty())
|
||||
p_movie_info = &movie_info;
|
||||
#ifdef ENABLE_GRAPHLCD
|
||||
if (!bgThread) {
|
||||
if (p_movie_info)
|
||||
nGLCD::lockChannel(p_movie_info->channelName, p_movie_info->epgTitle);
|
||||
cGLCD::lockChannel(p_movie_info->channelName, p_movie_info->epgTitle);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user