imageinfo_ni: allow fade in/out

Origin commit data
------------------
Branch: ni/coolstream
Commit: ba563ea939
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-09-29 (Thu, 29 Sep 2016)

Origin message was:
------------------
- imageinfo_ni: allow fade in/out

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2016-09-29 23:53:26 +02:00
parent d180f34ec9
commit 83c2cc832f

View File

@@ -31,6 +31,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <driver/fade.h>
#include <driver/fontrenderer.h> #include <driver/fontrenderer.h>
#include <driver/rcinput.h> #include <driver/rcinput.h>
#include <driver/screen_max.h> #include <driver/screen_max.h>
@@ -143,45 +144,72 @@ int CImageInfoNI::exec(CMenuTarget* parent, const std::string &)
parent->hide(); parent->hide();
neutrino_msg_t msg; neutrino_msg_t msg;
_stat cpu; neutrino_msg_t postmsg = 0;
_stat cpu;
cpu.usr = 0; cpu.usr = 0;
cpu.nice = 0; cpu.nice = 0;
cpu.system = 0; cpu.system = 0;
cpu.idle = 0; cpu.idle = 0;
sigBox_pos = 0; sigBox_pos = 0;
COSDFader fader(g_settings.theme.menu_Content_alpha);
fader.StartFadeIn();
bool fadeout = false;
paint(); paint();
paint_pig (xcpu, y + 10, width/3, height/3); paint_pig(xcpu, y + 10, width/3, height/3);
StartInfoThread(); StartInfoThread();
while (1) while (1)
{ {
neutrino_msg_data_t data; neutrino_msg_data_t data;
uint64_t timeoutEnd = CRCInput::calcTimeoutEnd_MS(100); uint64_t timeoutEnd = CRCInput::calcTimeoutEnd_MS(100);
g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd);
if(msg == CRCInput::RC_setup) { if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer()))
res = menu_return::RETURN_EXIT_ALL; {
break; if (fader.FadeDone())
{
break;
}
} }
else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { else if (msg == CRCInput::RC_setup)
g_RCInput->postMsg (msg, 0); {
res = menu_return::RETURN_EXIT_ALL; res = menu_return::RETURN_EXIT_ALL;
break; fadeout = true;
} }
else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { else if (CNeutrinoApp::getInstance()->listModeKey(msg))
CNeutrinoApp::getInstance ()->handleMsg (msg, data); {
postmsg = msg;
res = menu_return::RETURN_EXIT_ALL;
fadeout = true;
}
else if (msg == (neutrino_msg_t) g_settings.key_screenshot)
{
CNeutrinoApp::getInstance()->handleMsg(msg, data);
continue; continue;
} }
else if (msg <= CRCInput::RC_MaxRC) else if (msg <= CRCInput::RC_MaxRC)
{ {
break; fadeout = true;
} }
if ( msg > CRCInput::RC_MaxRC && msg != CRCInput::RC_timeout) if (msg > CRCInput::RC_MaxRC && msg != CRCInput::RC_timeout)
{ {
CNeutrinoApp::getInstance()->handleMsg( msg, data ); CNeutrinoApp::getInstance()->handleMsg(msg, data);
}
if (fadeout && msg == CRCInput::RC_timeout)
{
if (fader.StartFadeOut())
{
msg = 0;
}
else
{
break;
}
} }
Stat_Info(&cpu); Stat_Info(&cpu);
@@ -189,7 +217,14 @@ int CImageInfoNI::exec(CMenuTarget* parent, const std::string &)
} }
StopInfoThread(); StopInfoThread();
hide(); hide();
fader.StopFade();
if (postmsg)
{
g_RCInput->postMsg(postmsg, 0);
}
return res; return res;
} }