mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 08:21:07 +02:00
Use new class to fade
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1942 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: 3c2845d590
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:
@@ -43,6 +43,7 @@
|
||||
#include <driver/rcinput.h>
|
||||
#include <driver/abstime.h>
|
||||
#include <driver/record.h>
|
||||
#include <driver/fade.h>
|
||||
|
||||
#include <gui/color.h>
|
||||
#include <gui/eventlist.h>
|
||||
@@ -568,16 +569,8 @@ int CChannelList::show()
|
||||
calcSize();
|
||||
displayNext = false;
|
||||
|
||||
bool fadeIn = g_settings.widget_fade;
|
||||
bool fadeOut = false;
|
||||
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 );
|
||||
}
|
||||
COSDFader fader(g_settings.menu_Content_alpha);
|
||||
fader.StartFadeIn();
|
||||
|
||||
paintHead();
|
||||
paint();
|
||||
@@ -598,24 +591,9 @@ int CChannelList::show()
|
||||
if ( msg <= CRCInput::RC_MaxRC )
|
||||
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]);
|
||||
|
||||
if((msg == NeutrinoMessages::EVT_TIMER) && (data == fadeTimer)) {
|
||||
if (fadeOut) { // disappear
|
||||
fadeValue += FADE_STEP;
|
||||
if (fadeValue >= 100) {
|
||||
fadeValue = g_settings.menu_Content_alpha;
|
||||
g_RCInput->killTimer (fadeTimer);
|
||||
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);
|
||||
if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetTimer())) {
|
||||
if(fader.Fade()) {
|
||||
loop = false;
|
||||
}
|
||||
}
|
||||
else if ( ( msg == CRCInput::RC_timeout ) || ( msg == (neutrino_msg_t)g_settings.key_channelList_cancel) ) {
|
||||
@@ -627,16 +605,8 @@ int CChannelList::show()
|
||||
res = -4;
|
||||
selected = selected_in_new_mode;
|
||||
}
|
||||
|
||||
if ( fadeIn ) {
|
||||
g_RCInput->killTimer(fadeTimer);
|
||||
fadeIn = false;
|
||||
}
|
||||
if ((!fadeOut) && g_settings.widget_fade) {
|
||||
fadeOut = true;
|
||||
fadeTimer = g_RCInput->addTimer( FADE_TIME, false );
|
||||
if(fader.StartFadeOut()) {
|
||||
timeoutEnd = CRCInput::calcTimeoutEnd( 1 );
|
||||
frameBuffer->setBlendMode(2); // Global alpha multiplied with pixel alpha
|
||||
msg = 0;
|
||||
} else
|
||||
loop=false;
|
||||
@@ -691,6 +661,7 @@ int CChannelList::show()
|
||||
}
|
||||
else if ( msg == CRCInput::RC_setup) {
|
||||
old_b_id = bouquetList->getActiveBouquetNumber();
|
||||
fader.Stop();
|
||||
g_channel_list_changed = doChannelMenu();
|
||||
if(g_channel_list_changed) {
|
||||
res = -4;
|
||||
@@ -962,10 +933,9 @@ int CChannelList::show()
|
||||
}
|
||||
}
|
||||
hide();
|
||||
if ( fadeIn || fadeOut ) {
|
||||
g_RCInput->killTimer(fadeTimer);
|
||||
frameBuffer->setBlendMode(1); // Set back to per pixel alpha
|
||||
}
|
||||
|
||||
fader.Stop();
|
||||
|
||||
if (bShowBouquetList) {
|
||||
res = bouquetList->exec(true);
|
||||
printf("CChannelList:: bouquetList->exec res %d\n", res);
|
||||
|
Reference in New Issue
Block a user