mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
InfoClock: Fix display clock in movie browser, file browser etc.
This commit is contained in:
@@ -251,8 +251,6 @@ void* CComponentsFrmClock::initClockThread(void *arg)
|
||||
time_t count = time(0);
|
||||
//start loop for paint
|
||||
while(1) {
|
||||
sleep(clock->cl_interval);
|
||||
|
||||
if (clock->paintClock) {
|
||||
//refresh item property values
|
||||
clock->refresh();
|
||||
@@ -265,6 +263,7 @@ void* CComponentsFrmClock::initClockThread(void *arg)
|
||||
clock->cl_thread = 0;
|
||||
break;
|
||||
}
|
||||
sleep(clock->cl_interval);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -94,3 +94,19 @@ void CInfoClock::paint(bool do_save_bg)
|
||||
//paint the clock
|
||||
paintForm(do_save_bg);
|
||||
}
|
||||
|
||||
bool CInfoClock::enableInfoClock(bool enable)
|
||||
{
|
||||
bool ret = false;
|
||||
if (g_settings.mode_clock) {
|
||||
if (enable) {
|
||||
if (!paintClock)
|
||||
ret = StartClock();
|
||||
}
|
||||
else {
|
||||
if (paintClock)
|
||||
ret = StopClock();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@@ -45,6 +45,7 @@ class CInfoClock : public CComponentsFrmClock
|
||||
|
||||
bool StartClock();
|
||||
bool StopClock();
|
||||
bool enableInfoClock(bool enable);
|
||||
void ClearDisplay();
|
||||
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||
};
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include <neutrinoMessages.h>
|
||||
|
||||
#include <gui/audiomute.h>
|
||||
#include <gui/infoclock.h>
|
||||
#include <gui/movieplayer.h>
|
||||
#include <gui/pictureviewer.h>
|
||||
#if ENABLE_UPNP
|
||||
@@ -52,6 +53,7 @@
|
||||
#include <system/debug.h>
|
||||
#include <video.h>
|
||||
extern cVideo * videoDecoder;
|
||||
extern CInfoClock *InfoClock;
|
||||
|
||||
CMediaPlayerMenu::CMediaPlayerMenu()
|
||||
{
|
||||
@@ -106,6 +108,7 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
else if (actionKey == "movieplayer")
|
||||
{
|
||||
audiomute->enableMuteIcon(false);
|
||||
InfoClock->enableInfoClock(false);
|
||||
int mode = CNeutrinoApp::getInstance()->getMode();
|
||||
if( mode == NeutrinoMessages::mode_radio )
|
||||
videoDecoder->StopPicture();
|
||||
@@ -113,6 +116,7 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
if( mode == NeutrinoMessages::mode_radio )
|
||||
videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg");
|
||||
audiomute->enableMuteIcon(true);
|
||||
InfoClock->enableInfoClock(true);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@@ -203,6 +203,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey)
|
||||
}
|
||||
else if (actionKey == "ytplayback") {
|
||||
CAudioMute::getInstance()->enableMuteIcon(false);
|
||||
InfoClock->enableInfoClock(false);
|
||||
isMovieBrowser = true;
|
||||
moviebrowser->setMode(MB_SHOW_YT);
|
||||
}
|
||||
@@ -245,8 +246,10 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey)
|
||||
|
||||
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
|
||||
|
||||
if (moviebrowser->getMode() == MB_SHOW_YT)
|
||||
if (moviebrowser->getMode() == MB_SHOW_YT) {
|
||||
CAudioMute::getInstance()->enableMuteIcon(true);
|
||||
InfoClock->enableInfoClock(true);
|
||||
}
|
||||
|
||||
if (timeshift){
|
||||
timeshift = 0;
|
||||
@@ -399,6 +402,7 @@ bool CMoviePlayerGui::SelectFile()
|
||||
}
|
||||
else { // filebrowser
|
||||
CAudioMute::getInstance()->enableMuteIcon(false);
|
||||
InfoClock->enableInfoClock(false);
|
||||
if (filebrowser->exec(Path_local.c_str()) == true) {
|
||||
Path_local = filebrowser->getCurrentDir();
|
||||
CFile *file;
|
||||
@@ -437,6 +441,7 @@ bool CMoviePlayerGui::SelectFile()
|
||||
} else
|
||||
menu_ret = filebrowser->getMenuRet();
|
||||
CAudioMute::getInstance()->enableMuteIcon(true);
|
||||
InfoClock->enableInfoClock(true);
|
||||
}
|
||||
if(ret && file_name.empty()) {
|
||||
std::string::size_type pos = full_name.find_last_of('/');
|
||||
@@ -573,6 +578,7 @@ void CMoviePlayerGui::PlayFile(void)
|
||||
}
|
||||
|
||||
CAudioMute::getInstance()->enableMuteIcon(true);
|
||||
InfoClock->enableInfoClock(true);
|
||||
|
||||
while (playstate >= CMoviePlayerGui::PLAY)
|
||||
{
|
||||
@@ -835,9 +841,7 @@ void CMoviePlayerGui::PlayFile(void)
|
||||
restoreNeutrino();
|
||||
|
||||
CAudioMute::getInstance()->enableMuteIcon(false);
|
||||
|
||||
if (g_settings.mode_clock)
|
||||
InfoClock->StartClock();
|
||||
InfoClock->enableInfoClock(false);
|
||||
}
|
||||
|
||||
void CMoviePlayerGui::callInfoViewer(/*const int duration, const int curr_pos*/)
|
||||
|
@@ -53,6 +53,7 @@
|
||||
#include <gui/components/cc.h>
|
||||
#include <gui/widget/buttons.h>
|
||||
#include <gui/widget/icons.h>
|
||||
#include <gui/infoclock.h>
|
||||
#include <gui/widget/menue.h>
|
||||
#include <gui/widget/messagebox.h>
|
||||
|
||||
@@ -72,6 +73,7 @@
|
||||
|
||||
#include <video.h>
|
||||
extern cVideo * videoDecoder;
|
||||
extern CInfoClock *InfoClock;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
bool comparePictureByDate (const CPicture& a, const CPicture& b)
|
||||
@@ -254,6 +256,7 @@ int CPictureViewerGui::show()
|
||||
m_currentTitle = m_audioPlayer->getAudioPlayerM_current();
|
||||
|
||||
CAudioMute::getInstance()->enableMuteIcon(false);
|
||||
InfoClock->enableInfoClock(false);
|
||||
|
||||
while (loop)
|
||||
{
|
||||
@@ -638,6 +641,7 @@ int CPictureViewerGui::show()
|
||||
hide();
|
||||
|
||||
CAudioMute::getInstance()->enableMuteIcon(true);
|
||||
InfoClock->enableInfoClock(true);
|
||||
|
||||
return(res);
|
||||
}
|
||||
|
@@ -54,8 +54,7 @@ CTimeOSD::~CTimeOSD()
|
||||
|
||||
void CTimeOSD::show(time_t time_show)
|
||||
{
|
||||
if (g_settings.mode_clock)
|
||||
InfoClock->StartClock();
|
||||
InfoClock->enableInfoClock(false);
|
||||
|
||||
GetDimensions();
|
||||
visible = true;
|
||||
@@ -77,8 +76,6 @@ void CTimeOSD::GetDimensions()
|
||||
m_width = g_Font[TIMEOSD_FONT]->getRenderWidth("00:00:00");
|
||||
t1 = g_Font[TIMEOSD_FONT]->getRenderWidth(widest_number);
|
||||
m_width += t1;
|
||||
if(g_settings.mode_clock)
|
||||
m_xend = m_xend - m_width - (m_width/4);
|
||||
}
|
||||
|
||||
void CTimeOSD::update(time_t time_show)
|
||||
@@ -142,8 +139,7 @@ void CTimeOSD::hide()
|
||||
if(!visible)
|
||||
return;
|
||||
|
||||
if (g_settings.mode_clock)
|
||||
InfoClock->StopClock();
|
||||
InfoClock->enableInfoClock(true);
|
||||
|
||||
//GetDimensions();
|
||||
frameBuffer->paintBackgroundBoxRel(m_xend - m_width - t1, m_y, m_width, m_height);
|
||||
|
@@ -51,6 +51,7 @@
|
||||
|
||||
#include <gui/audiomute.h>
|
||||
#include <gui/color.h>
|
||||
#include <gui/infoclock.h>
|
||||
#include <gui/movieplayer.h>
|
||||
|
||||
#include <gui/components/cc.h>
|
||||
@@ -66,6 +67,7 @@
|
||||
|
||||
extern cVideo * videoDecoder;
|
||||
extern CPictureViewer * g_PicViewer;
|
||||
extern CInfoClock *InfoClock;
|
||||
|
||||
const struct button_label RescanButton = {NEUTRINO_ICON_BUTTON_BLUE , LOCALE_UPNPBROWSER_RESCAN};
|
||||
const struct button_label BrowseButtons[4] =
|
||||
@@ -453,6 +455,7 @@ void CUpnpBrowserGui::selectDevice()
|
||||
return;
|
||||
|
||||
CAudioMute::getInstance()->enableMuteIcon(false);
|
||||
InfoClock->enableInfoClock(false);
|
||||
|
||||
while (loop)
|
||||
{
|
||||
@@ -542,6 +545,7 @@ printf("msg: %x\n", (int) msg);
|
||||
}
|
||||
}
|
||||
CAudioMute::getInstance()->enableMuteIcon(true);
|
||||
InfoClock->enableInfoClock(true);
|
||||
}
|
||||
|
||||
void CUpnpBrowserGui::playnext(void)
|
||||
|
@@ -107,9 +107,6 @@ void CVolumeBar::initVolumeBarSize()
|
||||
mute_corrY = (height - mute_dy) / 2;
|
||||
cvh->setMuteIconCorrY(mute_corrY);
|
||||
|
||||
if ((g_settings.mode_clock) && (!CNeutrinoApp::getInstance()->isMuted()))
|
||||
CInfoClock::getInstance()->ClearDisplay();
|
||||
|
||||
vb_pbh = height-8;
|
||||
|
||||
vb_pby = height/2-vb_pbh/2;
|
||||
|
@@ -2056,8 +2056,7 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu)
|
||||
|
||||
else if( msg == CRCInput::RC_text) {
|
||||
g_RCInput->clearRCMsg();
|
||||
if(g_settings.mode_clock)
|
||||
InfoClock->StopClock();
|
||||
InfoClock->enableInfoClock(false);
|
||||
StopSubtitles();
|
||||
tuxtx_stop_subtitle();
|
||||
|
||||
@@ -2067,19 +2066,16 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu)
|
||||
//if(!g_settings.cacheTXT)
|
||||
// tuxtxt_stop();
|
||||
g_RCInput->clearRCMsg();
|
||||
if(g_settings.mode_clock)
|
||||
InfoClock->StartClock();
|
||||
InfoClock->enableInfoClock(true);
|
||||
StartSubtitles();
|
||||
}
|
||||
else if( msg == CRCInput::RC_setup ) {
|
||||
if(!g_settings.minimode) {
|
||||
StopSubtitles();
|
||||
if(g_settings.mode_clock)
|
||||
InfoClock->StopClock();
|
||||
InfoClock->enableInfoClock(false);
|
||||
int old_ttx = g_settings.cacheTXT;
|
||||
mainMenu.exec(NULL, "");
|
||||
if(g_settings.mode_clock)
|
||||
InfoClock->StartClock();
|
||||
InfoClock->enableInfoClock(true);
|
||||
StartSubtitles();
|
||||
saveSetup(NEUTRINO_SETTINGS_FILE);
|
||||
if (!g_settings.epg_scan)
|
||||
@@ -2146,8 +2142,8 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu)
|
||||
else if( msg == (neutrino_msg_t) g_settings.key_zaphistory ) {
|
||||
// Zap-History "Bouquet"
|
||||
if(g_settings.mode_clock && g_settings.key_zaphistory == CRCInput::RC_home) {
|
||||
InfoClock->enableInfoClock(false);
|
||||
g_settings.mode_clock = false;
|
||||
InfoClock->StopClock();
|
||||
} else {
|
||||
numericZap( msg );
|
||||
}
|
||||
@@ -2306,8 +2302,8 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu)
|
||||
else {
|
||||
if (msg == CRCInput::RC_home) {
|
||||
if(g_settings.mode_clock && g_settings.key_zaphistory == CRCInput::RC_home) {
|
||||
InfoClock->enableInfoClock(false);
|
||||
g_settings.mode_clock = false;
|
||||
InfoClock->StopClock();
|
||||
}
|
||||
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
|
||||
}
|
||||
@@ -2332,8 +2328,7 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu)
|
||||
int CNeutrinoApp::showChannelList(const neutrino_msg_t _msg, bool from_menu)
|
||||
{
|
||||
neutrino_msg_t msg = _msg;
|
||||
if(g_settings.mode_clock)
|
||||
InfoClock->StopClock();
|
||||
InfoClock->enableInfoClock(false);
|
||||
|
||||
StopSubtitles();
|
||||
|
||||
@@ -2417,8 +2412,8 @@ _repeat:
|
||||
goto _show;
|
||||
}
|
||||
|
||||
if(!from_menu && g_settings.mode_clock)
|
||||
InfoClock->StartClock();
|
||||
if (!from_menu)
|
||||
InfoClock->enableInfoClock(true);
|
||||
|
||||
return ((nNewChannel >= 0) ? menu_return::RETURN_EXIT_ALL : menu_return::RETURN_REPAINT);
|
||||
}
|
||||
@@ -3308,9 +3303,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
|
||||
}
|
||||
CVFD::getInstance()->setBacklight(g_settings.backlight_standby);
|
||||
|
||||
if(g_settings.mode_clock) {
|
||||
InfoClock->StopClock();
|
||||
}
|
||||
InfoClock->enableInfoClock(false);
|
||||
|
||||
//remember tuned channel-id
|
||||
standby_channel_id = CZapit::getInstance()->GetCurrentChannelID();
|
||||
@@ -3389,8 +3382,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
|
||||
g_Sectionsd->setPauseScanning(false);
|
||||
//g_Sectionsd->setServiceChanged(live_channel_id, true );
|
||||
|
||||
if(g_settings.mode_clock)
|
||||
InfoClock->StartClock();
|
||||
InfoClock->enableInfoClock(true);
|
||||
|
||||
g_audioMute->AudioMute(current_muted, true);
|
||||
StartSubtitles();
|
||||
@@ -3454,11 +3446,11 @@ void CNeutrinoApp::switchTvRadioMode(const int prev_mode)
|
||||
void CNeutrinoApp::switchClockOnOff()
|
||||
{
|
||||
if(g_settings.mode_clock) {
|
||||
InfoClock->enableInfoClock(false);
|
||||
g_settings.mode_clock = false;
|
||||
InfoClock->StopClock();
|
||||
} else {
|
||||
g_settings.mode_clock = true;
|
||||
InfoClock->StartClock();
|
||||
InfoClock->enableInfoClock(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user