Use new class to fade

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1944 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Branch: ni/coolstream
Commit: 346d3ad63e
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:
[CST] Focus
2011-12-06 12:48:16 +00:00
parent 0babf66dbe
commit 1c63b703d4

View File

@@ -49,6 +49,7 @@
#include <driver/encoding.h> #include <driver/encoding.h>
#include <driver/screen_max.h> #include <driver/screen_max.h>
#include <driver/fade.h>
#include <gui/filebrowser.h> #include <gui/filebrowser.h>
#include <gui/customcolor.h> #include <gui/customcolor.h>
#include <gui/pictureviewer.h> #include <gui/pictureviewer.h>
@@ -598,16 +599,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
FollowScreenings(channel_id, epgData.title); FollowScreenings(channel_id, epgData.title);
} }
bool fadeIn = g_settings.widget_fade && doLoop; 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 );
}
//show the epg //show the epg
frameBuffer->paintBoxRel(sx, sy, ox, toph, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); frameBuffer->paintBoxRel(sx, sy, ox, toph, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);
@@ -712,25 +705,9 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
pb.paintProgressBarDefault(pbx, sy+oy-height, 104, height-6, epg_done, 100); pb.paintProgressBarDefault(pbx, sy+oy-height, 104, height-6, epg_done, 100);
} }
} }
if(data == fadeTimer) { if(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 only
} else
frameBuffer->setBlendLevel(fadeValue, fadeValue);
}
} }
else else
CNeutrinoApp::getInstance()->handleMsg(msg, data); CNeutrinoApp::getInstance()->handleMsg(msg, data);
@@ -896,15 +873,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
case CRCInput::RC_ok: case CRCInput::RC_ok:
case CRCInput::RC_timeout: case CRCInput::RC_timeout:
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;
@@ -918,15 +888,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
default: default:
// konfigurierbare Keys handlen... // konfigurierbare Keys handlen...
if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel) { if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel) {
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;
@@ -942,10 +905,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
} }
} }
hide(); hide();
if ( fadeIn || fadeOut ) { fader.Stop();
g_RCInput->killTimer(fadeTimer);
frameBuffer->setBlendMode(1); // set back to per pixel alpha only
}
} }
return res; return res;
} }