Infoclock: unify handling in some classes with singleton

This commit is contained in:
2016-02-29 08:05:05 +01:00
parent dcec44b8d6
commit 59d9b7068e
5 changed files with 17 additions and 18 deletions

View File

@@ -79,7 +79,7 @@ extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */
extern CBouquetList * bouquetList; /* neutrino.cpp */ extern CBouquetList * bouquetList; /* neutrino.cpp */
extern CPictureViewer * g_PicViewer; extern CPictureViewer * g_PicViewer;
extern cVideo * videoDecoder; extern cVideo * videoDecoder;
extern CInfoClock *InfoClock;
#define LEFT_OFFSET 5 #define LEFT_OFFSET 5
@@ -249,7 +249,7 @@ void CInfoViewer::initClock()
clock->setClockIntervall(1); clock->setClockIntervall(1);
} }
InfoClock->getInstance()->disableInfoClock(); CInfoClock::getInstance()->disableInfoClock();
clock->enableColBodyGradient(gradient_top, COL_INFOBAR_PLUS_0); clock->enableColBodyGradient(gradient_top, COL_INFOBAR_PLUS_0);
clock->doPaintBg(!gradient_top); clock->doPaintBg(!gradient_top);
clock->enableTboxSaveScreen(gradient_top); clock->enableTboxSaveScreen(gradient_top);
@@ -1213,7 +1213,7 @@ void CInfoViewer::killRadiotext()
if (g_Radiotext->S_RtOsd) if (g_Radiotext->S_RtOsd)
frameBuffer->paintBackgroundBox(rt_x, rt_y, rt_w, rt_h); frameBuffer->paintBackgroundBox(rt_x, rt_y, rt_w, rt_h);
rt_x = rt_y = rt_h = rt_w = 0; rt_x = rt_y = rt_h = rt_w = 0;
InfoClock->enableInfoClock(true); CInfoClock::getInstance()->enableInfoClock(true);
} }
void CInfoViewer::showRadiotext() void CInfoViewer::showRadiotext()
@@ -1225,7 +1225,7 @@ void CInfoViewer::showRadiotext()
infoViewerBB->showIcon_RadioText(g_Radiotext->haveRadiotext()); infoViewerBB->showIcon_RadioText(g_Radiotext->haveRadiotext());
if (g_Radiotext->S_RtOsd) { if (g_Radiotext->S_RtOsd) {
InfoClock->enableInfoClock(false); CInfoClock::getInstance()->enableInfoClock(false);
// dimensions of radiotext window // dimensions of radiotext window
int /*yoff = 8,*/ ii = 0; int /*yoff = 8,*/ ii = 0;
rt_dx = BoxEndX - BoxStartX; rt_dx = BoxEndX - BoxStartX;
@@ -2099,7 +2099,7 @@ void CInfoViewer::killTitle()
} }
} }
showButtonBar = false; showButtonBar = false;
InfoClock->getInstance()->enableInfoClock(); CInfoClock::getInstance()->enableInfoClock();
} }
#if 0 #if 0

View File

@@ -53,7 +53,7 @@
#include <system/debug.h> #include <system/debug.h>
#include <video.h> #include <video.h>
extern cVideo * videoDecoder; extern cVideo * videoDecoder;
extern CInfoClock *InfoClock;
CMediaPlayerMenu::CMediaPlayerMenu() CMediaPlayerMenu::CMediaPlayerMenu()
{ {
@@ -108,7 +108,7 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey)
else if (actionKey == "movieplayer") else if (actionKey == "movieplayer")
{ {
audiomute->enableMuteIcon(false); audiomute->enableMuteIcon(false);
InfoClock->enableInfoClock(false); CInfoClock::getInstance()->enableInfoClock(false);
int mode = CNeutrinoApp::getInstance()->getMode(); int mode = CNeutrinoApp::getInstance()->getMode();
if( mode == NeutrinoMessages::mode_radio ) if( mode == NeutrinoMessages::mode_radio )
CFrameBuffer::getInstance()->stopFrame(); CFrameBuffer::getInstance()->stopFrame();
@@ -116,7 +116,7 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey)
if( mode == NeutrinoMessages::mode_radio ) if( mode == NeutrinoMessages::mode_radio )
CFrameBuffer::getInstance()->showFrame("radiomode.jpg"); CFrameBuffer::getInstance()->showFrame("radiomode.jpg");
audiomute->enableMuteIcon(true); audiomute->enableMuteIcon(true);
InfoClock->enableInfoClock(true); CInfoClock::getInstance()->enableInfoClock(true);
return res; return res;
} }

View File

@@ -74,7 +74,7 @@
extern cVideo * videoDecoder; extern cVideo * videoDecoder;
extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */
extern CInfoClock *InfoClock;
extern CVolume* g_volume; extern CVolume* g_volume;
#define TIMESHIFT_SECONDS 3 #define TIMESHIFT_SECONDS 3
@@ -459,7 +459,7 @@ void CMoviePlayerGui::ClearQueue()
void CMoviePlayerGui::EnableClockAndMute(bool enable) void CMoviePlayerGui::EnableClockAndMute(bool enable)
{ {
CAudioMute::getInstance()->enableMuteIcon(enable); CAudioMute::getInstance()->enableMuteIcon(enable);
InfoClock->enableInfoClock(enable); CInfoClock::getInstance()->enableInfoClock(enable);
} }
void CMoviePlayerGui::makeFilename() void CMoviePlayerGui::makeFilename()
@@ -1828,7 +1828,7 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/)
bool restore = FileTime.IsVisible(); bool restore = FileTime.IsVisible();
if (restore) if (restore)
FileTime.kill(); FileTime.kill();
InfoClock->enableInfoClock(false); CInfoClock::getInstance()->enableInfoClock(false);
if (isLuaPlay && haveLuaInfoFunc) { if (isLuaPlay && haveLuaInfoFunc) {
int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; int xres = 0, yres = 0, aspectRatio = 0, framerate = -1;
@@ -1843,7 +1843,7 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/)
else if (p_movie_info) else if (p_movie_info)
cMovieInfo.showMovieInfo(*p_movie_info); cMovieInfo.showMovieInfo(*p_movie_info);
InfoClock->enableInfoClock(true); CInfoClock::getInstance()->enableInfoClock(true);
if (restore) { if (restore) {
FileTime.setMode(m_mode); FileTime.setMode(m_mode);
FileTime.update(position, duration); FileTime.update(position, duration);

View File

@@ -76,7 +76,7 @@
#include <zapit/zapit.h> #include <zapit/zapit.h>
#include <video.h> #include <video.h>
extern cVideo * videoDecoder; extern cVideo * videoDecoder;
extern CInfoClock *InfoClock;
//------------------------------------------------------------------------ //------------------------------------------------------------------------
bool comparePictureByDate (const CPicture& a, const CPicture& b) bool comparePictureByDate (const CPicture& a, const CPicture& b)
@@ -258,7 +258,7 @@ int CPictureViewerGui::show()
m_currentTitle = m_audioPlayer->getAudioPlayerM_current(); m_currentTitle = m_audioPlayer->getAudioPlayerM_current();
CAudioMute::getInstance()->enableMuteIcon(false); CAudioMute::getInstance()->enableMuteIcon(false);
InfoClock->enableInfoClock(false); CInfoClock::getInstance()->enableInfoClock(false);
while (loop) while (loop)
{ {
@@ -644,7 +644,7 @@ int CPictureViewerGui::show()
hide(); hide();
CAudioMute::getInstance()->enableMuteIcon(true); CAudioMute::getInstance()->enableMuteIcon(true);
InfoClock->enableInfoClock(true); CInfoClock::getInstance()->enableInfoClock(true);
return(res); return(res);
} }

View File

@@ -459,8 +459,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
} }
} }
extern CInfoClock *InfoClock; CInfoClock::getInstance()->enableInfoClock(false);
InfoClock->enableInfoClock(false);
// show menu if there are more than 2 items only // show menu if there are more than 2 items only
// otherwise, we start the item directly (must be the last one) // otherwise, we start the item directly (must be the last one)
if (menu_items > 1 ) if (menu_items > 1 )
@@ -468,7 +467,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
else if (last_menu_item) else if (last_menu_item)
last_menu_item->exec( NULL ); last_menu_item->exec( NULL );
InfoClock->enableInfoClock(true); CInfoClock::getInstance()->enableInfoClock(true);
CNeutrinoApp::getInstance()->StartSubtitles(); CNeutrinoApp::getInstance()->StartSubtitles();
if (button < COL_BUTTONMAX) if (button < COL_BUTTONMAX)