mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
Use new class to fade
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1945 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: 4210a40244
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2011-12-06 (Tue, 06 Dec 2011)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -44,6 +44,7 @@
|
|||||||
#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>
|
||||||
|
#include <driver/fade.h>
|
||||||
|
|
||||||
#include <gui/channellist.h>
|
#include <gui/channellist.h>
|
||||||
#include <gui/color.h>
|
#include <gui/color.h>
|
||||||
@@ -472,16 +473,8 @@ int CTimerList::show()
|
|||||||
bool loop=true;
|
bool loop=true;
|
||||||
bool update=true;
|
bool update=true;
|
||||||
|
|
||||||
bool fadeIn = g_settings.widget_fade;
|
COSDFader fader(g_settings.menu_Content_alpha);
|
||||||
bool fadeOut = false;
|
fader.StartFadeIn();
|
||||||
int fadeValue = g_settings.menu_Content_alpha;
|
|
||||||
uint32_t fadeTimer = 0;
|
|
||||||
if ( fadeIn ) {
|
|
||||||
fadeValue = 100;
|
|
||||||
frameBuffer->setBlendMode(2); // Global alpha multiplied with pixel alpha
|
|
||||||
frameBuffer->setBlendLevel(fadeValue, fadeValue);
|
|
||||||
fadeTimer = g_RCInput->addTimer( FADE_TIME, false );
|
|
||||||
}
|
|
||||||
|
|
||||||
while (loop)
|
while (loop)
|
||||||
{
|
{
|
||||||
@@ -498,42 +491,20 @@ int CTimerList::show()
|
|||||||
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings
|
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings
|
||||||
::TIMING_MENU]);
|
::TIMING_MENU]);
|
||||||
|
|
||||||
if((msg == NeutrinoMessages::EVT_TIMER) && (data == fadeTimer)) {
|
if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetTimer())) {
|
||||||
if (fadeOut) { // disappear
|
if(fader.Fade())
|
||||||
fadeValue += FADE_STEP;
|
|
||||||
if (fadeValue >= 100) {
|
|
||||||
fadeValue = g_settings.menu_Content_alpha;
|
|
||||||
g_RCInput->killTimer (fadeTimer);
|
|
||||||
loop = false;
|
loop = false;
|
||||||
} else
|
|
||||||
frameBuffer->setBlendLevel(fadeValue, fadeValue);
|
|
||||||
} else { // appears
|
|
||||||
fadeValue -= FADE_STEP;
|
|
||||||
if (fadeValue <= g_settings.menu_Content_alpha) {
|
|
||||||
fadeValue = g_settings.menu_Content_alpha;
|
|
||||||
g_RCInput->killTimer (fadeTimer);
|
|
||||||
fadeIn = false;
|
|
||||||
frameBuffer->setBlendMode(1); // Set back to per pixel alpha
|
|
||||||
} else
|
|
||||||
frameBuffer->setBlendLevel(fadeValue, fadeValue);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if ( ( msg == CRCInput::RC_timeout ) ||
|
else if ( ( msg == CRCInput::RC_timeout ) ||
|
||||||
( msg == CRCInput::RC_home) || (msg == CRCInput::RC_left) ||
|
( msg == CRCInput::RC_home) || (msg == CRCInput::RC_left) ||
|
||||||
(( msg == CRCInput::RC_ok) && (timerlist.empty())) )
|
(( msg == CRCInput::RC_ok) && (timerlist.empty())) )
|
||||||
{ //Exit after timeout or cancel key
|
{ //Exit after timeout or cancel key
|
||||||
if ( fadeIn ) {
|
if(fader.StartFadeOut()) {
|
||||||
g_RCInput->killTimer(fadeTimer);
|
|
||||||
fadeIn = false;
|
|
||||||
}
|
|
||||||
if ((!fadeOut) && g_settings.widget_fade) {
|
|
||||||
fadeOut = true;
|
|
||||||
fadeTimer = g_RCInput->addTimer( FADE_TIME, false );
|
|
||||||
timeoutEnd = CRCInput::calcTimeoutEnd( 1 );
|
timeoutEnd = CRCInput::calcTimeoutEnd( 1 );
|
||||||
frameBuffer->setBlendMode(2); // Global alpha multiplied with pixel alpha
|
|
||||||
msg = 0;
|
msg = 0;
|
||||||
} else
|
} else
|
||||||
loop=false;
|
loop=false;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ((msg == CRCInput::RC_up || msg == (unsigned int)g_settings.key_channelList_pageup) && !(timerlist.empty()))
|
else if ((msg == CRCInput::RC_up || msg == (unsigned int)g_settings.key_channelList_pageup) && !(timerlist.empty()))
|
||||||
{
|
{
|
||||||
@@ -658,11 +629,8 @@ int CTimerList::show()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( fadeIn || fadeOut ) {
|
|
||||||
g_RCInput->killTimer(fadeTimer);
|
|
||||||
frameBuffer->setBlendMode(1); // Set back to per pixel alpha
|
|
||||||
}
|
|
||||||
hide();
|
hide();
|
||||||
|
fader.Stop();
|
||||||
|
|
||||||
return(res);
|
return(res);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user