- screensaver: move code for ignored msgs to screensaver code

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2018-08-03 22:58:24 +02:00
committed by Thilo Graf
parent 47105169e1
commit 685f5306bd
3 changed files with 19 additions and 12 deletions

View File

@@ -318,3 +318,20 @@ bool CScreenSaver::isActive()
return true;
return false;
}
bool CScreenSaver::ignoredMsg(neutrino_msg_t msg)
{
/* screensaver will ignore these msgs */
if (
msg == NeutrinoMessages::EVT_CURRENTEPG
|| msg == NeutrinoMessages::EVT_NEXTEPG
|| msg == NeutrinoMessages::EVT_CURRENTNEXT_EPG
|| msg == NeutrinoMessages::EVT_TIMESET
|| msg == NeutrinoMessages::EVT_PROGRAMLOCKSTATUS
|| msg == NeutrinoMessages::EVT_ZAP_GOT_SUBSERVICES
|| msg == NeutrinoMessages::EVT_ZAP_GOTAPIDS
|| msg == NeutrinoMessages::EVT_ZAP_GOTPIDS
)
return true;
return false;
}

View File

@@ -71,6 +71,7 @@ class CScreenSaver : public sigc::trackable
bool isActive();
void Start();
void Stop();
bool ignoredMsg(neutrino_msg_t msg);
sigc::signal<void> OnBeforeStart;
sigc::signal<void> OnAfterStop;

View File

@@ -2679,17 +2679,6 @@ void CNeutrinoApp::RealRun()
if (mode == NeutrinoModes::mode_radio || mode == NeutrinoModes::mode_webradio)
#endif
{
bool ignored_msg = (
/* radio screensaver will ignore this msgs */
msg == NeutrinoMessages::EVT_CURRENTEPG
|| msg == NeutrinoMessages::EVT_NEXTEPG
|| msg == NeutrinoMessages::EVT_CURRENTNEXT_EPG
|| msg == NeutrinoMessages::EVT_TIMESET
|| msg == NeutrinoMessages::EVT_PROGRAMLOCKSTATUS
|| msg == NeutrinoMessages::EVT_ZAP_GOT_SUBSERVICES
|| msg == NeutrinoMessages::EVT_ZAP_GOTAPIDS
|| msg == NeutrinoMessages::EVT_ZAP_GOTPIDS
);
if (msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER)
{
if (CScreenSaver::getInstance()->canStart() && !CScreenSaver::getInstance()->isActive())
@@ -2698,7 +2687,7 @@ void CNeutrinoApp::RealRun()
CScreenSaver::getInstance()->Start();
}
}
else if (!ignored_msg)
else if (!CScreenSaver::getInstance()->ignoredMsg(msg))
{
if (CScreenSaver::getInstance()->isActive())
{