mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
Use new class to fade
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1950 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#endif
|
||||
|
||||
#include <global.h>
|
||||
#include <neutrino.h>
|
||||
#include <gui/eventlist.h>
|
||||
#include <gui/epgplus.h>
|
||||
#include <gui/timerlist.h>
|
||||
@@ -44,25 +45,24 @@
|
||||
#include <gui/widget/mountchooser.h>
|
||||
#include <gui/pictureviewer.h>
|
||||
|
||||
#include <global.h>
|
||||
#include <neutrino.h>
|
||||
|
||||
#include "widget/hintbox.h"
|
||||
#include "widget/buttons.h"
|
||||
#include "gui/bouquetlist.h"
|
||||
#include <gui/widget/stringinput.h>
|
||||
|
||||
extern CBouquetList * bouquetList;
|
||||
#include <driver/screen_max.h>
|
||||
#include <driver/fade.h>
|
||||
|
||||
#include <zapit/client/zapitclient.h> /* CZapitClient::Utf8_to_Latin1 */
|
||||
#include <driver/screen_max.h>
|
||||
|
||||
#include <zapit/client/zapittools.h>
|
||||
#include <zapit/zapit.h>
|
||||
#include <daemonc/remotecontrol.h>
|
||||
extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
extern CBouquetList * bouquetList;
|
||||
extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */
|
||||
|
||||
extern CPictureViewer * g_PicViewer;
|
||||
|
||||
void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = "");
|
||||
@@ -293,16 +293,9 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam
|
||||
|
||||
sort_mode=0;
|
||||
|
||||
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();
|
||||
|
||||
readEvents(channel_id);
|
||||
UpdateTimerList();
|
||||
|
||||
@@ -327,38 +320,15 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam
|
||||
if ( msg <= CRCInput::RC_MaxRC )
|
||||
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]);
|
||||
|
||||
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)
|
||||
{
|
||||
selected = oldselected;
|
||||
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;
|
||||
@@ -566,15 +536,8 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam
|
||||
showFunctionBar(true, channel_id);
|
||||
} else {
|
||||
selected = oldselected;
|
||||
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,11 +654,7 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam
|
||||
}
|
||||
|
||||
hide();
|
||||
if ( fadeIn || fadeOut ) {
|
||||
g_RCInput->killTimer(fadeTimer);
|
||||
frameBuffer->setBlendMode(1); // Set back to per pixel alpha
|
||||
}
|
||||
|
||||
fader.Stop();
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user