setting-helpers: formatting code using astyle

Origin commit data
------------------
Commit: 47fb92bd31
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-11-19 (Fri, 19 Nov 2021)

Origin message was:
------------------
- setting-helpers: formatting code using astyle
This commit is contained in:
vanhofen
2021-11-19 23:05:40 +01:00
parent f4509f290f
commit 6c8913a53f
2 changed files with 227 additions and 192 deletions

View File

@@ -61,7 +61,6 @@
#include <driver/display.h> #include <driver/display.h>
#include <driver/volume.h> #include <driver/volume.h>
#include <system/helpers.h> #include <system/helpers.h>
// obsolete #include <gui/streaminfo.h>
#include <gui/widget/msgbox.h> #include <gui/widget/msgbox.h>
#include <gui/widget/hintbox.h> #include <gui/widget/hintbox.h>
@@ -79,8 +78,8 @@
#include <zapit/satconfig.h> #include <zapit/satconfig.h>
#include <zapit/zapit.h> #include <zapit/zapit.h>
extern CPlugins * g_Plugins; /* neutrino.cpp */ extern CPlugins *g_Plugins; /* neutrino.cpp */
extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */
extern cVideo *videoDecoder; extern cVideo *videoDecoder;
extern cAudio *audioDecoder; extern cAudio *audioDecoder;
@@ -88,7 +87,7 @@ extern cDemux *videoDemux;
extern cDemux *audioDemux; extern cDemux *audioDemux;
extern cDemux *pcrDemux; extern cDemux *pcrDemux;
extern "C" int pinghost( const char *hostname ); extern "C" int pinghost(const char *hostname);
COnOffNotifier::COnOffNotifier(int OffValue) COnOffNotifier::COnOffNotifier(int OffValue)
{ {
@@ -97,22 +96,22 @@ COnOffNotifier::COnOffNotifier(int OffValue)
bool COnOffNotifier::changeNotify(const neutrino_locale_t, void *Data) bool COnOffNotifier::changeNotify(const neutrino_locale_t, void *Data)
{ {
bool active = (*(int*)(Data) != offValue); bool active = (*(int *)(Data) != offValue);
for (std::vector<CMenuItem*>::iterator it = toDisable.begin(); it != toDisable.end(); it++) for (std::vector<CMenuItem *>::iterator it = toDisable.begin(); it != toDisable.end(); it++)
(*it)->setActive(active); (*it)->setActive(active);
return false; return false;
} }
void COnOffNotifier::addItem(CMenuItem* menuItem) void COnOffNotifier::addItem(CMenuItem *menuItem)
{ {
toDisable.push_back(menuItem); toDisable.push_back(menuItem);
} }
bool CSectionsdConfigNotifier::changeNotify(const neutrino_locale_t locale, void *data) bool CSectionsdConfigNotifier::changeNotify(const neutrino_locale_t locale, void *data)
{ {
char *str = (char*) data; char *str = (char *) data;
if (locale == LOCALE_MISCSETTINGS_EPG_CACHE) if (locale == LOCALE_MISCSETTINGS_EPG_CACHE)
g_settings.epg_cache = atoi(str); g_settings.epg_cache = atoi(str);
else if (locale == LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE) else if (locale == LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE)
@@ -122,15 +121,15 @@ bool CSectionsdConfigNotifier::changeNotify(const neutrino_locale_t locale, void
else if (locale == LOCALE_MISCSETTINGS_EPG_MAX_EVENTS) else if (locale == LOCALE_MISCSETTINGS_EPG_MAX_EVENTS)
g_settings.epg_max_events = atoi(str); g_settings.epg_max_events = atoi(str);
CNeutrinoApp::getInstance()->SendSectionsdConfig(); CNeutrinoApp::getInstance()->SendSectionsdConfig();
return false; return false;
} }
bool CTouchFileNotifier::changeNotify(const neutrino_locale_t, void * data) bool CTouchFileNotifier::changeNotify(const neutrino_locale_t, void *data)
{ {
if ((*(int *)data) != 0) if ((*(int *)data) != 0)
{ {
FILE * fd = fopen(filename, "w"); FILE *fd = fopen(filename, "w");
if (fd) if (fd)
fclose(fd); fclose(fd);
else else
@@ -141,7 +140,7 @@ bool CTouchFileNotifier::changeNotify(const neutrino_locale_t, void * data)
return true; return true;
} }
bool CFlagFileNotifier::changeNotify(const neutrino_locale_t, void * data) bool CFlagFileNotifier::changeNotify(const neutrino_locale_t, void *data)
{ {
std::string flagfile = FLAGDIR; std::string flagfile = FLAGDIR;
flagfile += "/."; flagfile += "/.";
@@ -149,20 +148,20 @@ bool CFlagFileNotifier::changeNotify(const neutrino_locale_t, void * data)
if ((*(int *)data) != 0) if ((*(int *)data) != 0)
{ {
FILE * fd = fopen(flagfile.c_str(), "w"); FILE *fd = fopen(flagfile.c_str(), "w");
if (fd) if (fd)
{ {
fclose(fd); fclose(fd);
if (strstr(filename, "scart_osd_fix")) if (strstr(filename, "scart_osd_fix"))
{ {
//change to scart-osd-fix values // change to scart-osd-fix values
g_settings.screen_StartX_b_0 = 30; g_settings.screen_StartX_b_0 = 30;
g_settings.screen_StartY_b_0 = 45; g_settings.screen_StartY_b_0 = 45;
g_settings.screen_EndX_b_0 = 690; g_settings.screen_EndX_b_0 = 690;
g_settings.screen_EndY_b_0 = 535; g_settings.screen_EndY_b_0 = 535;
g_settings.screen_preset = 1; g_settings.screen_preset = 1;
//set values // set values
g_settings.screen_StartX = g_settings.screen_StartX_b_0; g_settings.screen_StartX = g_settings.screen_StartX_b_0;
g_settings.screen_StartY = g_settings.screen_StartY_b_0; g_settings.screen_StartY = g_settings.screen_StartY_b_0;
g_settings.screen_EndX = g_settings.screen_EndX_b_0; g_settings.screen_EndX = g_settings.screen_EndX_b_0;
@@ -203,13 +202,13 @@ bool CFlagFileNotifier::changeNotify(const neutrino_locale_t, void * data)
{ {
if (strstr(filename, "scart_osd_fix")) if (strstr(filename, "scart_osd_fix"))
{ {
//reset to defaults // reset to defaults
g_settings.screen_StartX_b_0 = 22; g_settings.screen_StartX_b_0 = 22;
g_settings.screen_StartY_b_0 = 12; g_settings.screen_StartY_b_0 = 12;
g_settings.screen_EndX_b_0 = 1259 - g_settings.screen_StartX_b_0 - 1; g_settings.screen_EndX_b_0 = 1259 - g_settings.screen_StartX_b_0 - 1;
g_settings.screen_EndY_b_0 = 708 - g_settings.screen_StartY_b_0 - 1; g_settings.screen_EndY_b_0 = 708 - g_settings.screen_StartY_b_0 - 1;
//set values // set values
g_settings.screen_StartX = g_settings.screen_preset ? g_settings.screen_StartX_b_0 : g_settings.screen_StartX_a_0; g_settings.screen_StartX = g_settings.screen_preset ? g_settings.screen_StartX_b_0 : g_settings.screen_StartX_a_0;
g_settings.screen_StartY = g_settings.screen_preset ? g_settings.screen_StartY_b_0 : g_settings.screen_StartY_a_0; g_settings.screen_StartY = g_settings.screen_preset ? g_settings.screen_StartY_b_0 : g_settings.screen_StartY_a_0;
g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_b_0 : g_settings.screen_EndX_a_0; g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_b_0 : g_settings.screen_EndX_a_0;
@@ -253,153 +252,153 @@ void CColorSetupNotifier::setPalette()
{ {
CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); CFrameBuffer *frameBuffer = CFrameBuffer::getInstance();
SNeutrinoTheme &t = g_settings.theme; SNeutrinoTheme &t = g_settings.theme;
//setting colors-..
// setting colors
frameBuffer->paletteGenFade(COL_MENUHEAD, frameBuffer->paletteGenFade(COL_MENUHEAD,
convertSetupColor2RGB(t.menu_Head_red, t.menu_Head_green, t.menu_Head_blue), convertSetupColor2RGB(t.menu_Head_red, t.menu_Head_green, t.menu_Head_blue),
convertSetupColor2RGB(t.menu_Head_Text_red, t.menu_Head_Text_green, t.menu_Head_Text_blue), convertSetupColor2RGB(t.menu_Head_Text_red, t.menu_Head_Text_green, t.menu_Head_Text_blue),
8, convertSetupAlpha2Alpha( t.menu_Head_alpha ) ); 8, convertSetupAlpha2Alpha(t.menu_Head_alpha));
frameBuffer->paletteGenFade(COL_MENUCONTENT, frameBuffer->paletteGenFade(COL_MENUCONTENT,
convertSetupColor2RGB(t.menu_Content_red, t.menu_Content_green, t.menu_Content_blue), convertSetupColor2RGB(t.menu_Content_red, t.menu_Content_green, t.menu_Content_blue),
convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue), convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue),
8, convertSetupAlpha2Alpha(t.menu_Content_alpha) ); 8, convertSetupAlpha2Alpha(t.menu_Content_alpha));
frameBuffer->paletteGenFade(COL_MENUCONTENTDARK, frameBuffer->paletteGenFade(COL_MENUCONTENTDARK,
convertSetupColor2RGB(int(t.menu_Content_red*0.6), int(t.menu_Content_green*0.6), int(t.menu_Content_blue*0.6)), convertSetupColor2RGB(int(t.menu_Content_red * 0.6), int(t.menu_Content_green * 0.6), int(t.menu_Content_blue * 0.6)),
convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue), convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue),
8, convertSetupAlpha2Alpha(t.menu_Content_alpha) ); 8, convertSetupAlpha2Alpha(t.menu_Content_alpha));
frameBuffer->paletteGenFade(COL_MENUCONTENTSELECTED, frameBuffer->paletteGenFade(COL_MENUCONTENTSELECTED,
convertSetupColor2RGB(t.menu_Content_Selected_red, t.menu_Content_Selected_green, t.menu_Content_Selected_blue), convertSetupColor2RGB(t.menu_Content_Selected_red, t.menu_Content_Selected_green, t.menu_Content_Selected_blue),
convertSetupColor2RGB(t.menu_Content_Selected_Text_red, t.menu_Content_Selected_Text_green, t.menu_Content_Selected_Text_blue), convertSetupColor2RGB(t.menu_Content_Selected_Text_red, t.menu_Content_Selected_Text_green, t.menu_Content_Selected_Text_blue),
8, convertSetupAlpha2Alpha(t.menu_Content_Selected_alpha) ); 8, convertSetupAlpha2Alpha(t.menu_Content_Selected_alpha));
frameBuffer->paletteGenFade(COL_MENUCONTENTINACTIVE, frameBuffer->paletteGenFade(COL_MENUCONTENTINACTIVE,
convertSetupColor2RGB(t.menu_Content_inactive_red, t.menu_Content_inactive_green, t.menu_Content_inactive_blue), convertSetupColor2RGB(t.menu_Content_inactive_red, t.menu_Content_inactive_green, t.menu_Content_inactive_blue),
convertSetupColor2RGB(t.menu_Content_inactive_Text_red, t.menu_Content_inactive_Text_green, t.menu_Content_inactive_Text_blue), convertSetupColor2RGB(t.menu_Content_inactive_Text_red, t.menu_Content_inactive_Text_green, t.menu_Content_inactive_Text_blue),
8, convertSetupAlpha2Alpha(t.menu_Content_inactive_alpha) ); 8, convertSetupAlpha2Alpha(t.menu_Content_inactive_alpha));
frameBuffer->paletteGenFade(COL_MENUFOOT, frameBuffer->paletteGenFade(COL_MENUFOOT,
convertSetupColor2RGB(t.menu_Foot_red, t.menu_Foot_green, t.menu_Foot_blue), convertSetupColor2RGB(t.menu_Foot_red, t.menu_Foot_green, t.menu_Foot_blue),
convertSetupColor2RGB(t.menu_Foot_Text_red, t.menu_Foot_Text_green, t.menu_Foot_Text_blue), convertSetupColor2RGB(t.menu_Foot_Text_red, t.menu_Foot_Text_green, t.menu_Foot_Text_blue),
8, convertSetupAlpha2Alpha( t.menu_Foot_alpha ) ); 8, convertSetupAlpha2Alpha(t.menu_Foot_alpha));
frameBuffer->paletteGenFade(COL_INFOBAR, frameBuffer->paletteGenFade(COL_INFOBAR,
convertSetupColor2RGB(t.infobar_red, t.infobar_green, t.infobar_blue), convertSetupColor2RGB(t.infobar_red, t.infobar_green, t.infobar_blue),
convertSetupColor2RGB(t.infobar_Text_red, t.infobar_Text_green, t.infobar_Text_blue), convertSetupColor2RGB(t.infobar_Text_red, t.infobar_Text_green, t.infobar_Text_blue),
8, convertSetupAlpha2Alpha(t.infobar_alpha) ); 8, convertSetupAlpha2Alpha(t.infobar_alpha));
frameBuffer->paletteGenFade(COL_SHADOW, frameBuffer->paletteGenFade(COL_SHADOW,
convertSetupColor2RGB(int(t.shadow_red), int(t.shadow_green), int(t.shadow_blue)), convertSetupColor2RGB(int(t.shadow_red), int(t.shadow_green), int(t.shadow_blue)),
convertSetupColor2RGB(t.shadow_red, t.shadow_green, t.shadow_blue), convertSetupColor2RGB(t.shadow_red, t.shadow_green, t.shadow_blue),
8, convertSetupAlpha2Alpha(t.shadow_alpha) ); 8, convertSetupAlpha2Alpha(t.shadow_alpha));
frameBuffer->paletteGenFade(COL_INFOBAR_CASYSTEM, frameBuffer->paletteGenFade(COL_INFOBAR_CASYSTEM,
convertSetupColor2RGB(t.infobar_casystem_red, t.infobar_casystem_green, t.infobar_casystem_blue), convertSetupColor2RGB(t.infobar_casystem_red, t.infobar_casystem_green, t.infobar_casystem_blue),
convertSetupColor2RGB(t.infobar_Text_red, t.infobar_Text_green, t.infobar_Text_blue), convertSetupColor2RGB(t.infobar_Text_red, t.infobar_Text_green, t.infobar_Text_blue),
8, convertSetupAlpha2Alpha(t.infobar_casystem_alpha) ); 8, convertSetupAlpha2Alpha(t.infobar_casystem_alpha));
frameBuffer->paletteGenFade(COL_COLORED_EVENTS_INFOBAR, frameBuffer->paletteGenFade(COL_COLORED_EVENTS_INFOBAR,
convertSetupColor2RGB(t.infobar_red, t.infobar_green, t.infobar_blue), convertSetupColor2RGB(t.infobar_red, t.infobar_green, t.infobar_blue),
convertSetupColor2RGB(t.colored_events_red, t.colored_events_green, t.colored_events_blue), convertSetupColor2RGB(t.colored_events_red, t.colored_events_green, t.colored_events_blue),
8, convertSetupAlpha2Alpha(t.infobar_alpha) ); 8, convertSetupAlpha2Alpha(t.infobar_alpha));
frameBuffer->paletteGenFade(COL_COLORED_EVENTS_CHANNELLIST, frameBuffer->paletteGenFade(COL_COLORED_EVENTS_CHANNELLIST,
convertSetupColor2RGB(int(t.menu_Content_red*0.6), int(t.menu_Content_green*0.6), int(t.menu_Content_blue*0.6)), convertSetupColor2RGB(int(t.menu_Content_red * 0.6), int(t.menu_Content_green * 0.6), int(t.menu_Content_blue * 0.6)),
convertSetupColor2RGB(t.colored_events_red, t.colored_events_green, t.colored_events_blue), convertSetupColor2RGB(t.colored_events_red, t.colored_events_green, t.colored_events_blue),
8, convertSetupAlpha2Alpha(t.infobar_alpha) ); 8, convertSetupAlpha2Alpha(t.infobar_alpha));
frameBuffer->paletteGenFade(COL_PROGRESSBAR, frameBuffer->paletteGenFade(COL_PROGRESSBAR,
convertSetupColor2RGB(t.progressbar_passive_red, t.progressbar_passive_green, t.progressbar_passive_blue), convertSetupColor2RGB(t.progressbar_passive_red, t.progressbar_passive_green, t.progressbar_passive_blue),
convertSetupColor2RGB(t.progressbar_active_red, t.progressbar_active_green, t.progressbar_active_blue), convertSetupColor2RGB(t.progressbar_active_red, t.progressbar_active_green, t.progressbar_active_blue),
8, convertSetupAlpha2Alpha(t.menu_Content_alpha)); 8, convertSetupAlpha2Alpha(t.menu_Content_alpha));
// ##### TEXT COLORS ##### // ##### TEXT COLORS #####
// COL_COLORED_EVENTS_TEXT // COL_COLORED_EVENTS_TEXT
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 0, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 0,
convertSetupColor2RGB(t.colored_events_red, t.colored_events_green, t.colored_events_blue), convertSetupColor2RGB(t.colored_events_red, t.colored_events_green, t.colored_events_blue),
convertSetupAlpha2Alpha(t.menu_Content_alpha)); convertSetupAlpha2Alpha(t.menu_Content_alpha));
// COL_INFOBAR_TEXT // COL_INFOBAR_TEXT
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 1, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 1,
convertSetupColor2RGB(t.infobar_Text_red, t.infobar_Text_green, t.infobar_Text_blue), convertSetupColor2RGB(t.infobar_Text_red, t.infobar_Text_green, t.infobar_Text_blue),
convertSetupAlpha2Alpha(t.infobar_alpha)); convertSetupAlpha2Alpha(t.infobar_alpha));
// COL_MENUFOOT_TEXT // COL_MENUFOOT_TEXT
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 2, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 2,
convertSetupColor2RGB(t.menu_Foot_Text_red, t.menu_Foot_Text_green, t.menu_Foot_Text_blue), convertSetupColor2RGB(t.menu_Foot_Text_red, t.menu_Foot_Text_green, t.menu_Foot_Text_blue),
convertSetupAlpha2Alpha(t.menu_Foot_alpha)); convertSetupAlpha2Alpha(t.menu_Foot_alpha));
// COL_MENUHEAD_TEXT // COL_MENUHEAD_TEXT
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 3, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 3,
convertSetupColor2RGB(t.menu_Head_Text_red, t.menu_Head_Text_green, t.menu_Head_Text_blue), convertSetupColor2RGB(t.menu_Head_Text_red, t.menu_Head_Text_green, t.menu_Head_Text_blue),
convertSetupAlpha2Alpha(t.menu_Head_alpha)); convertSetupAlpha2Alpha(t.menu_Head_alpha));
// COL_MENUCONTENT_TEXT // COL_MENUCONTENT_TEXT
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 4, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 4,
convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue), convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue),
convertSetupAlpha2Alpha(t.menu_Content_alpha)); convertSetupAlpha2Alpha(t.menu_Content_alpha));
// COL_MENUCONTENT_TEXT_PLUS_1 // COL_MENUCONTENT_TEXT_PLUS_1
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 5, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 5,
changeBrightnessRGBRel(convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue), -16), changeBrightnessRGBRel(convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue), -16),
convertSetupAlpha2Alpha(t.menu_Content_alpha)); convertSetupAlpha2Alpha(t.menu_Content_alpha));
// COL_MENUCONTENT_TEXT_PLUS_2 // COL_MENUCONTENT_TEXT_PLUS_2
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 6, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 6,
changeBrightnessRGBRel(convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue), -32), changeBrightnessRGBRel(convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue), -32),
convertSetupAlpha2Alpha(t.menu_Content_alpha)); convertSetupAlpha2Alpha(t.menu_Content_alpha));
// COL_MENUCONTENT_TEXT_PLUS_3 // COL_MENUCONTENT_TEXT_PLUS_3
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 7, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 7,
changeBrightnessRGBRel(convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue), -48), changeBrightnessRGBRel(convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue), -48),
convertSetupAlpha2Alpha(t.menu_Content_alpha)); convertSetupAlpha2Alpha(t.menu_Content_alpha));
// COL_MENUCONTENTDARK_TEXT // COL_MENUCONTENTDARK_TEXT
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 8, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 8,
convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue), convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue),
convertSetupAlpha2Alpha(t.menu_Content_alpha)); convertSetupAlpha2Alpha(t.menu_Content_alpha));
// COL_MENUCONTENTDARK_TEXT_PLUS_1 // COL_MENUCONTENTDARK_TEXT_PLUS_1
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 9, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 9,
changeBrightnessRGBRel(convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue), -52), changeBrightnessRGBRel(convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue), -52),
convertSetupAlpha2Alpha(t.menu_Content_alpha)); convertSetupAlpha2Alpha(t.menu_Content_alpha));
// COL_MENUCONTENTDARK_TEXT_PLUS_2 // COL_MENUCONTENTDARK_TEXT_PLUS_2
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 10, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 10,
changeBrightnessRGBRel(convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue), -60), changeBrightnessRGBRel(convertSetupColor2RGB(t.menu_Content_Text_red, t.menu_Content_Text_green, t.menu_Content_Text_blue), -60),
convertSetupAlpha2Alpha(t.menu_Content_alpha)); convertSetupAlpha2Alpha(t.menu_Content_alpha));
// COL_MENUCONTENTSELECTED_TEXT // COL_MENUCONTENTSELECTED_TEXT
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 11, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 11,
convertSetupColor2RGB(t.menu_Content_Selected_Text_red, t.menu_Content_Selected_Text_green, t.menu_Content_Selected_Text_blue), convertSetupColor2RGB(t.menu_Content_Selected_Text_red, t.menu_Content_Selected_Text_green, t.menu_Content_Selected_Text_blue),
convertSetupAlpha2Alpha(t.menu_Content_Selected_alpha)); convertSetupAlpha2Alpha(t.menu_Content_Selected_alpha));
// COL_MENUCONTENTSELECTED_TEXT_PLUS_1 // COL_MENUCONTENTSELECTED_TEXT_PLUS_1
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 12, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 12,
changeBrightnessRGBRel(convertSetupColor2RGB(t.menu_Content_Selected_Text_red, t.menu_Content_Selected_Text_green, t.menu_Content_Selected_Text_blue), -16), changeBrightnessRGBRel(convertSetupColor2RGB(t.menu_Content_Selected_Text_red, t.menu_Content_Selected_Text_green, t.menu_Content_Selected_Text_blue), -16),
convertSetupAlpha2Alpha(t.menu_Content_Selected_alpha)); convertSetupAlpha2Alpha(t.menu_Content_Selected_alpha));
// COL_MENUCONTENTSELECTED_TEXT_PLUS_2 // COL_MENUCONTENTSELECTED_TEXT_PLUS_2
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 13, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 13,
changeBrightnessRGBRel(convertSetupColor2RGB(t.menu_Content_Selected_Text_red, t.menu_Content_Selected_Text_green, t.menu_Content_Selected_Text_blue), -32), changeBrightnessRGBRel(convertSetupColor2RGB(t.menu_Content_Selected_Text_red, t.menu_Content_Selected_Text_green, t.menu_Content_Selected_Text_blue), -32),
convertSetupAlpha2Alpha(t.menu_Content_Selected_alpha)); convertSetupAlpha2Alpha(t.menu_Content_Selected_alpha));
// COL_MENUCONTENTINACTIVE_TEXT // COL_MENUCONTENTINACTIVE_TEXT
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 14, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 14,
convertSetupColor2RGB(t.menu_Content_inactive_Text_red, t.menu_Content_inactive_Text_green, t.menu_Content_inactive_Text_blue), convertSetupColor2RGB(t.menu_Content_inactive_Text_red, t.menu_Content_inactive_Text_green, t.menu_Content_inactive_Text_blue),
convertSetupAlpha2Alpha(t.menu_Content_inactive_alpha)); convertSetupAlpha2Alpha(t.menu_Content_inactive_alpha));
// COL_INFOCLOCK_TEXT // COL_INFOCLOCK_TEXT
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 15, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 15,
convertSetupColor2RGB(t.clock_Digit_red, t.clock_Digit_green, t.clock_Digit_blue), convertSetupColor2RGB(t.clock_Digit_red, t.clock_Digit_green, t.clock_Digit_blue),
convertSetupAlpha2Alpha(t.clock_Digit_alpha)); convertSetupAlpha2Alpha(t.clock_Digit_alpha));
// COL_PROGRESSBAR_ACTIVE // COL_PROGRESSBAR_ACTIVE
frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 16, frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 16,
convertSetupColor2RGB(t.progressbar_active_red, t.progressbar_active_green, t.progressbar_active_blue), convertSetupColor2RGB(t.progressbar_active_red, t.progressbar_active_green, t.progressbar_active_blue),
convertSetupAlpha2Alpha(t.menu_Content_alpha)); convertSetupAlpha2Alpha(t.menu_Content_alpha));
frameBuffer->paletteSet(); frameBuffer->paletteSet();
} }
@@ -413,38 +412,56 @@ bool CColorSetupNotifier::changeNotify(const neutrino_locale_t, void *)
bool CAudioSetupNotifier::changeNotify(const neutrino_locale_t OptionName, void *) bool CAudioSetupNotifier::changeNotify(const neutrino_locale_t OptionName, void *)
{ {
//printf("notify: %d\n", OptionName); //printf("notify: %d\n", OptionName);
#if 0 //FIXME to do ? manual audio delay #if 0
// FIXME to do ? manual audio delay
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_PCMOFFSET)) if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_PCMOFFSET))
{ {
} }
#endif #endif
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_ANALOG_MODE)) { if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_ANALOG_MODE))
{
g_Zapit->setAudioMode(g_settings.audio_AnalogMode); g_Zapit->setAudioMode(g_settings.audio_AnalogMode);
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_ANALOG_OUT)) { }
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_ANALOG_OUT))
{
audioDecoder->EnableAnalogOut(g_settings.analog_out ? true : false); audioDecoder->EnableAnalogOut(g_settings.analog_out ? true : false);
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE #if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_AC3)) { }
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_AC3))
{
audioDecoder->SetHdmiDD(g_settings.ac3_pass ? true : false); audioDecoder->SetHdmiDD(g_settings.ac3_pass ? true : false);
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_DTS)) { }
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_DTS))
{
audioDecoder->SetSpdifDD(g_settings.dts_pass ? true : false); audioDecoder->SetSpdifDD(g_settings.dts_pass ? true : false);
#else #else
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_HDMI_DD)) { }
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_HDMI_DD))
{
audioDecoder->SetHdmiDD((HDMI_ENCODED_MODE) g_settings.hdmi_dd); audioDecoder->SetHdmiDD((HDMI_ENCODED_MODE) g_settings.hdmi_dd);
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_SPDIF_DD)) { }
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_SPDIF_DD))
{
audioDecoder->SetSpdifDD(g_settings.spdif_dd ? true : false); audioDecoder->SetSpdifDD(g_settings.spdif_dd ? true : false);
#endif #endif
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_AVSYNC)) { }
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_AVSYNC))
{
videoDecoder->SetSyncMode((AVSYNC_TYPE)g_settings.avsync); videoDecoder->SetSyncMode((AVSYNC_TYPE)g_settings.avsync);
audioDecoder->SetSyncMode((AVSYNC_TYPE)g_settings.avsync); audioDecoder->SetSyncMode((AVSYNC_TYPE)g_settings.avsync);
videoDemux->SetSyncMode((AVSYNC_TYPE)g_settings.avsync); videoDemux->SetSyncMode((AVSYNC_TYPE)g_settings.avsync);
audioDemux->SetSyncMode((AVSYNC_TYPE)g_settings.avsync); audioDemux->SetSyncMode((AVSYNC_TYPE)g_settings.avsync);
pcrDemux->SetSyncMode((AVSYNC_TYPE)g_settings.avsync); pcrDemux->SetSyncMode((AVSYNC_TYPE)g_settings.avsync);
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_CLOCKREC)) { }
//.Clock recovery enable/disable else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_CLOCKREC))
{
// Clock recovery enable/disable
// FIXME add code here. // FIXME add code here.
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIO_SRS_ALGO) || }
ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIO_SRS_NMGR) || else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIO_SRS_ALGO) ||
ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIO_SRS_VOLUME)) { ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIO_SRS_NMGR) ||
ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIO_SRS_VOLUME))
{
audioDecoder->SetSRS(g_settings.srs_enable, g_settings.srs_nmgr_enable, g_settings.srs_algo, g_settings.srs_ref_volume); audioDecoder->SetSRS(g_settings.srs_enable, g_settings.srs_nmgr_enable, g_settings.srs_algo, g_settings.srs_ref_volume);
} }
return false; return false;
@@ -453,33 +470,37 @@ bool CAudioSetupNotifier::changeNotify(const neutrino_locale_t OptionName, void
// used in ./gui/osd_setup.cpp: // used in ./gui/osd_setup.cpp:
bool CFontSizeNotifier::changeNotify(const neutrino_locale_t, void *) bool CFontSizeNotifier::changeNotify(const neutrino_locale_t, void *)
{ {
CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FONTSIZE_HINT)); // UTF-8 CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FONTSIZE_HINT));
hintBox.paint(); hintBox.paint();
CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT); CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT);
hintBox.hide(); hintBox.hide();
/* recalculate infoclock/muteicon/volumebar */ // recalculate infoclock/muteicon/volumebar
CVolumeHelper::getInstance()->refresh(); CVolumeHelper::getInstance()->refresh();
return true; return true;
} }
int CSubtitleChangeExec::exec(CMenuTarget* /*parent*/, const std::string & actionKey) int CSubtitleChangeExec::exec(CMenuTarget * /*parent*/, const std::string &actionKey)
{ {
printf("CSubtitleChangeExec::exec: action %s\n", actionKey.c_str()); printf("CSubtitleChangeExec::exec: action %s\n", actionKey.c_str());
if(actionKey == "off") { if (actionKey == "off")
{
tuxtx_stop_subtitle(); tuxtx_stop_subtitle();
dvbsub_stop(); dvbsub_stop();
return menu_return::RETURN_EXIT; return menu_return::RETURN_EXIT;
} }
if(!strncmp(actionKey.c_str(), "DVB", 3)) { if (!strncmp(actionKey.c_str(), "DVB", 3))
char const * pidptr = strchr(actionKey.c_str(), ':'); {
int pid = atoi(pidptr+1); char const *pidptr = strchr(actionKey.c_str(), ':');
int pid = atoi(pidptr + 1);
tuxtx_stop_subtitle(); tuxtx_stop_subtitle();
dvbsub_pause(); dvbsub_pause();
dvbsub_start(pid); dvbsub_start(pid);
} else { }
char const * ptr = strchr(actionKey.c_str(), ':'); else
{
char const *ptr = strchr(actionKey.c_str(), ':');
ptr++; ptr++;
int pid = atoi(ptr); int pid = atoi(ptr);
ptr = strchr(ptr, ':'); ptr = strchr(ptr, ':');
@@ -487,19 +508,19 @@ printf("CSubtitleChangeExec::exec: action %s\n", actionKey.c_str());
int page = strtol(ptr, NULL, 16); int page = strtol(ptr, NULL, 16);
ptr = strchr(ptr, ':'); ptr = strchr(ptr, ':');
ptr++; ptr++;
printf("CSubtitleChangeExec::exec: TTX, pid %x page %x lang %s\n", pid, page, ptr); printf("CSubtitleChangeExec::exec: TTX, pid %x page %x lang %s\n", pid, page, ptr);
tuxtx_stop_subtitle(); tuxtx_stop_subtitle();
tuxtx_set_pid(pid, page, ptr); tuxtx_set_pid(pid, page, ptr);
dvbsub_stop(); dvbsub_stop();
tuxtx_main(pid, page); tuxtx_main(pid, page);
} }
return menu_return::RETURN_EXIT; return menu_return::RETURN_EXIT;
} }
int CNVODChangeExec::exec(CMenuTarget* parent, const std::string & actionKey) int CNVODChangeExec::exec(CMenuTarget *parent, const std::string &actionKey)
{ {
// printf("CNVODChangeExec exec: %s\n", actionKey.c_str()); //printf("CNVODChangeExec exec: %s\n", actionKey.c_str());
unsigned sel= atoi(actionKey.c_str()); unsigned sel = atoi(actionKey.c_str());
g_RemoteControl->setSubChannel(sel); g_RemoteControl->setSubChannel(sel);
parent->hide(); parent->hide();
@@ -507,7 +528,7 @@ int CNVODChangeExec::exec(CMenuTarget* parent, const std::string & actionKey)
return menu_return::RETURN_EXIT; return menu_return::RETURN_EXIT;
} }
int CMoviePluginChangeExec::exec(CMenuTarget* parent, const std::string & actionKey) int CMoviePluginChangeExec::exec(CMenuTarget *parent, const std::string &actionKey)
{ {
if (parent) if (parent)
parent->hide(); parent->hide();
@@ -526,7 +547,7 @@ int CMoviePluginChangeExec::exec(CMenuTarget* parent, const std::string & action
return menu_return::RETURN_EXIT; return menu_return::RETURN_EXIT;
} }
long CNetAdapter::mac_addr_sys ( u_char *addr) //only for function getMacAddr() long CNetAdapter::mac_addr_sys(u_char *addr) // only for function getMacAddr()
{ {
struct ifreq ifr; struct ifreq ifr;
struct ifreq *IFR; struct ifreq *IFR;
@@ -535,7 +556,7 @@ long CNetAdapter::mac_addr_sys ( u_char *addr) //only for function getMacAddr()
int s, i; int s, i;
int ok = 0; int ok = 0;
s = socket(AF_INET, SOCK_DGRAM, 0); s = socket(AF_INET, SOCK_DGRAM, 0);
if (s==-1) if (s == -1)
{ {
return -1; return -1;
} }
@@ -549,7 +570,7 @@ long CNetAdapter::mac_addr_sys ( u_char *addr) //only for function getMacAddr()
strcpy(ifr.ifr_name, IFR->ifr_name); strcpy(ifr.ifr_name, IFR->ifr_name);
if (ioctl(s, SIOCGIFFLAGS, &ifr) == 0) if (ioctl(s, SIOCGIFFLAGS, &ifr) == 0)
{ {
if (! (ifr.ifr_flags & IFF_LOOPBACK)) if (!(ifr.ifr_flags & IFF_LOOPBACK))
{ {
if (ioctl(s, SIOCGIFHWADDR, &ifr) == 0) if (ioctl(s, SIOCGIFHWADDR, &ifr) == 0)
{ {
@@ -575,13 +596,13 @@ std::string CNetAdapter::getMacAddr(void)
{ {
long stat; long stat;
u_char addr[6]; u_char addr[6];
stat = mac_addr_sys( addr); stat = mac_addr_sys(addr);
if (0 == stat) if (0 == stat)
{ {
std::stringstream mac_tmp; std::stringstream mac_tmp;
for(int i=0;i<6;++i) for (int i = 0; i < 6; ++i)
mac_tmp<<std::hex<<std::setfill('0')<<std::setw(2)<<(int)addr[i]<<':'; mac_tmp << std::hex << std::setfill('0') << std::setw(2) << (int)addr[i] << ':';
return mac_tmp.str().substr(0,17); return mac_tmp.str().substr(0, 17);
} }
else else
{ {
@@ -590,36 +611,41 @@ std::string CNetAdapter::getMacAddr(void)
} }
} }
bool CTZChangeNotifier::changeNotify(const neutrino_locale_t, void * Data) bool CTZChangeNotifier::changeNotify(const neutrino_locale_t, void *Data)
{ {
bool found = false; bool found = false;
std::string name, zone; std::string name, zone;
printf("CTZChangeNotifier::changeNotify: %s\n", (char *) Data); printf("CTZChangeNotifier::changeNotify: %s\n", (char *) Data);
xmlDocPtr parser = parseXmlFile("/etc/timezone.xml"); xmlDocPtr parser = parseXmlFile("/etc/timezone.xml");
if (parser != NULL) { if (parser != NULL)
xmlNodePtr search = xmlDocGetRootElement(parser); {
xmlNodePtr search = xmlDocGetRootElement(parser);
search = xmlChildrenNode(search); search = xmlChildrenNode(search);
while (search) { while (search)
if (!strcmp(xmlGetName(search), "zone")) { {
if (!strcmp(xmlGetName(search), "zone"))
{
const char *nptr = xmlGetAttribute(search, "name"); const char *nptr = xmlGetAttribute(search, "name");
if(nptr) if (nptr)
name = nptr; name = nptr;
if(g_settings.timezone == name) { if (g_settings.timezone == name)
{
const char *zptr = xmlGetAttribute(search, "zone"); const char *zptr = xmlGetAttribute(search, "zone");
if(zptr) if (zptr)
zone = zptr; zone = zptr;
if (!access(TARGET_PREFIX "/share/zoneinfo/" + zone, R_OK)) if (!access(TARGET_PREFIX "/share/zoneinfo/" + zone, R_OK))
found = true; found = true;
break; break;
} }
} }
search = xmlNextNode(search); search = xmlNextNode(search);
} }
xmlFreeDoc(parser); xmlFreeDoc(parser);
} }
if(found) { if (found)
{
printf("Timezone: %s -> %s\n", name.c_str(), zone.c_str()); printf("Timezone: %s -> %s\n", name.c_str(), zone.c_str());
std::string cmd = TARGET_PREFIX "/share/zoneinfo/" + zone; std::string cmd = TARGET_PREFIX "/share/zoneinfo/" + zone;
printf("symlink %s to /etc/localtime\n", cmd.c_str()); printf("symlink %s to /etc/localtime\n", cmd.c_str());
@@ -627,9 +653,10 @@ bool CTZChangeNotifier::changeNotify(const neutrino_locale_t, void * Data)
perror("unlink failed"); perror("unlink failed");
if (symlink(cmd.c_str(), "/etc/localtime")) if (symlink(cmd.c_str(), "/etc/localtime"))
perror("symlink failed"); perror("symlink failed");
/* for yocto tzdata compatibility */ // for yocto tzdata compatibility
FILE *f = fopen("/etc/timezone", "w"); FILE *f = fopen("/etc/timezone", "w");
if (f) { if (f)
{
fprintf(f, "%s\n", zone.c_str()); fprintf(f, "%s\n", zone.c_str());
fclose(f); fclose(f);
} }
@@ -643,7 +670,7 @@ bool CTZChangeNotifier::changeNotify(const neutrino_locale_t, void * Data)
extern Zapit_config zapitCfg; extern Zapit_config zapitCfg;
int CDataResetNotifier::exec(CMenuTarget* /*parent*/, const std::string& actionKey) int CDataResetNotifier::exec(CMenuTarget * /*parent*/, const std::string &actionKey)
{ {
bool delete_all = (actionKey == "all"); bool delete_all = (actionKey == "all");
bool delete_chan = (actionKey == "channels") || delete_all; bool delete_chan = (actionKey == "channels") || delete_all;
@@ -652,29 +679,32 @@ int CDataResetNotifier::exec(CMenuTarget* /*parent*/, const std::string& actionK
neutrino_locale_t msg = delete_all ? LOCALE_RESET_ALL : delete_chan ? LOCALE_RESET_CHANNELS : LOCALE_RESET_SETTINGS; neutrino_locale_t msg = delete_all ? LOCALE_RESET_ALL : delete_chan ? LOCALE_RESET_CHANNELS : LOCALE_RESET_SETTINGS;
int ret = menu_return::RETURN_REPAINT; int ret = menu_return::RETURN_REPAINT;
/* no need to confirm if we only remove deleted channels */ // no need to confirm if we only remove deleted channels
if (!delete_removed) { if (!delete_removed)
{
int result = ShowMsg(msg, g_Locale->getText(LOCALE_RESET_CONFIRM), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo); int result = ShowMsg(msg, g_Locale->getText(LOCALE_RESET_CONFIRM), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo);
if (result != CMsgBox::mbrYes) if (result != CMsgBox::mbrYes)
return true; return true;
} }
if(delete_all) { if (delete_all)
{
my_system(3, "/bin/sh", "-c", "rm -f " ZAPITDIR "/*.conf"); my_system(3, "/bin/sh", "-c", "rm -f " ZAPITDIR "/*.conf");
CServiceManager::getInstance()->SatelliteList().clear(); CServiceManager::getInstance()->SatelliteList().clear();
CZapit::getInstance()->LoadSettings(); CZapit::getInstance()->LoadSettings();
CZapit::getInstance()->GetConfig(zapitCfg); CZapit::getInstance()->GetConfig(zapitCfg);
#ifdef BOXMODEL_CST_HD2 #ifdef BOXMODEL_CST_HD2
/* flag file to erase /var partition on factory reset, // flag file to erase /var partition on factory reset
will be done by init scripts */ // will be done by init scripts
FILE * fp = fopen("/var_init/etc/.reset", "w"); FILE *fp = fopen("/var_init/etc/.reset", "w");
if (fp) if (fp)
fclose(fp); fclose(fp);
#endif #endif
g_RCInput->postMsg( NeutrinoMessages::REBOOT, 0); g_RCInput->postMsg(NeutrinoMessages::REBOOT, 0);
ret = menu_return::RETURN_EXIT_ALL; ret = menu_return::RETURN_EXIT_ALL;
} }
if(delete_set) { if (delete_set)
{
unlink(NEUTRINO_SETTINGS_FILE); unlink(NEUTRINO_SETTINGS_FILE);
//unlink(NEUTRINO_SCAN_SETTINGS_FILE); //unlink(NEUTRINO_SCAN_SETTINGS_FILE);
CNeutrinoApp::getInstance()->loadSetup(NEUTRINO_SETTINGS_FILE); CNeutrinoApp::getInstance()->loadSetup(NEUTRINO_SETTINGS_FILE);
@@ -685,11 +715,13 @@ int CDataResetNotifier::exec(CMenuTarget* /*parent*/, const std::string& actionK
CVFD::getInstance()->setlcdparameter(); CVFD::getInstance()->setlcdparameter();
CFrameBuffer::getInstance()->Clear(); CFrameBuffer::getInstance()->Clear();
} }
if(delete_chan) { if (delete_chan)
{
my_system(3, "/bin/sh", "-c", "rm -f " ZAPITDIR "/*.xml"); my_system(3, "/bin/sh", "-c", "rm -f " ZAPITDIR "/*.xml");
g_Zapit->reinitChannels(); g_Zapit->reinitChannels();
} }
if (delete_removed) { if (delete_removed)
{
CHintBox chb(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_RELOAD_HINT)); CHintBox chb(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_RELOAD_HINT));
chb.paint(); chb.paint();
CServiceManager::getInstance()->SaveServices(true, false, true); CServiceManager::getInstance()->SaveServices(true, false, true);
@@ -705,7 +737,8 @@ void CFanControlNotifier::setSpeed(unsigned int speed)
printf("FAN Speed %d\n", speed); printf("FAN Speed %d\n", speed);
#ifndef BOXMODEL_CST_HD2 #ifndef BOXMODEL_CST_HD2
int cfd = open("/dev/cs_control", O_RDONLY); int cfd = open("/dev/cs_control", O_RDONLY);
if(cfd < 0) { if (cfd < 0)
{
perror("Cannot open /dev/cs_control"); perror("Cannot open /dev/cs_control");
return; return;
} }
@@ -716,7 +749,7 @@ void CFanControlNotifier::setSpeed(unsigned int speed)
#endif #endif
} }
bool CFanControlNotifier::changeNotify(const neutrino_locale_t, void * data) bool CFanControlNotifier::changeNotify(const neutrino_locale_t, void *data)
{ {
unsigned int speed = * (int *) data; unsigned int speed = * (int *) data;
setSpeed(speed); setSpeed(speed);
@@ -733,13 +766,13 @@ bool CFanControlNotifier::changeNotify(const neutrino_locale_t, void *)
} }
#endif #endif
bool CCpuFreqNotifier::changeNotify(const neutrino_locale_t, void * data) bool CCpuFreqNotifier::changeNotify(const neutrino_locale_t, void *data)
{ {
extern cCpuFreqManager * cpuFreq; extern cCpuFreqManager *cpuFreq;
int freq = * (int *) data; int freq = * (int *) data;
printf("CCpuFreqNotifier: %d Mhz\n", freq); printf("CCpuFreqNotifier: %d Mhz\n", freq);
freq *= 1000*1000; freq *= 1000 * 1000;
if (cpuFreq) if (cpuFreq)
cpuFreq->SetCpuFreq(freq); cpuFreq->SetCpuFreq(freq);
@@ -747,25 +780,27 @@ extern cCpuFreqManager * cpuFreq;
} }
extern CMenuOptionChooser::keyval_ext VIDEOMENU_VIDEOMODE_OPTIONS[]; extern CMenuOptionChooser::keyval_ext VIDEOMENU_VIDEOMODE_OPTIONS[];
bool CAutoModeNotifier::changeNotify(const neutrino_locale_t /*OptionName*/, void * /* data */) bool CAutoModeNotifier::changeNotify(const neutrino_locale_t /*OptionName*/, void * /*data*/)
{ {
int i; int i;
int modes[VIDEO_STD_MAX+1]; int modes[VIDEO_STD_MAX + 1];
memset(modes, 0, sizeof(modes)); memset(modes, 0, sizeof(modes));
for(i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) { for (i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++)
if (VIDEOMENU_VIDEOMODE_OPTIONS[i].key < 0) /* not available on this platform */ {
if (VIDEOMENU_VIDEOMODE_OPTIONS[i].key < 0) // not available on this platform
continue; continue;
if (VIDEOMENU_VIDEOMODE_OPTIONS[i].key >= VIDEO_STD_MAX) { if (VIDEOMENU_VIDEOMODE_OPTIONS[i].key >= VIDEO_STD_MAX)
/* this must not happen */ {
// this must not happen
printf("CAutoModeNotifier::changeNotify VIDEOMODE_OPTIONS[%d].key = %d (>= %d)\n", printf("CAutoModeNotifier::changeNotify VIDEOMODE_OPTIONS[%d].key = %d (>= %d)\n",
i, VIDEOMENU_VIDEOMODE_OPTIONS[i].key, VIDEO_STD_MAX); i, VIDEOMENU_VIDEOMODE_OPTIONS[i].key, VIDEO_STD_MAX);
continue; continue;
} }
#ifdef BOXMODEL_CST_HD2 #ifdef BOXMODEL_CST_HD2
for(i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) for (i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++)
modes[VIDEOMENU_VIDEOMODE_OPTIONS[i].key] = g_settings.enabled_auto_modes[i]; modes[VIDEOMENU_VIDEOMODE_OPTIONS[i].key] = g_settings.enabled_auto_modes[i];
#else #else
modes[VIDEOMENU_VIDEOMODE_OPTIONS[i].key] = g_settings.enabled_video_modes[i]; modes[VIDEOMENU_VIDEOMODE_OPTIONS[i].key] = g_settings.enabled_video_modes[i];
#endif #endif

View File

@@ -41,16 +41,16 @@
class CGenericMenuActivate class CGenericMenuActivate
{ {
private: private:
std::vector<CMenuItem*> items; std::vector<CMenuItem *> items;
public: public:
CGenericMenuActivate() {}; CGenericMenuActivate() {};
~CGenericMenuActivate() { items.clear(); }; ~CGenericMenuActivate() { items.clear(); };
void Add(CMenuItem* item) { items.push_back(item); } void Add(CMenuItem *item) { items.push_back(item); }
void Clear() { items.clear(); } void Clear() { items.clear(); }
void Activate(bool enable) void Activate(bool enable)
{ {
for(std::vector<CMenuItem*>::iterator it = items.begin(); it != items.end(); ++it) for (std::vector<CMenuItem *>::iterator it = items.begin(); it != items.end(); ++it)
(*it)->setActive(enable); (*it)->setActive(enable);
} }
}; };
@@ -59,35 +59,35 @@ class COnOffNotifier : public CChangeObserver
{ {
private: private:
int offValue; int offValue;
std::vector<CMenuItem*> toDisable; std::vector<CMenuItem *> toDisable;
public: public:
COnOffNotifier(int OffValue = 0); COnOffNotifier(int OffValue = 0);
bool changeNotify(const neutrino_locale_t, void *Data); bool changeNotify(const neutrino_locale_t, void *Data);
void addItem(CMenuItem* menuItem); void addItem(CMenuItem *menuItem);
}; };
class CSectionsdConfigNotifier : public CChangeObserver class CSectionsdConfigNotifier : public CChangeObserver
{ {
public: public:
bool changeNotify(const neutrino_locale_t, void * ); bool changeNotify(const neutrino_locale_t, void *);
}; };
class CTouchFileNotifier : public CChangeObserver class CTouchFileNotifier : public CChangeObserver
{ {
const char * filename; const char *filename;
public: public:
inline CTouchFileNotifier(const char * _filename) { filename = _filename; }; inline CTouchFileNotifier(const char *_filename) { filename = _filename; };
bool changeNotify(const neutrino_locale_t, void * data); bool changeNotify(const neutrino_locale_t, void *data);
}; };
class CFlagFileNotifier : public CChangeObserver class CFlagFileNotifier : public CChangeObserver
{ {
const char * filename; const char *filename;
public: public:
inline CFlagFileNotifier(const char * _filename) { filename = _filename; }; inline CFlagFileNotifier(const char *_filename) { filename = _filename; };
bool changeNotify(const neutrino_locale_t, void * data); bool changeNotify(const neutrino_locale_t, void *data);
}; };
class CColorSetupNotifier : public CChangeObserver class CColorSetupNotifier : public CChangeObserver
@@ -112,56 +112,56 @@ class CFontSizeNotifier : public CChangeObserver
class CSubtitleChangeExec : public CMenuTarget class CSubtitleChangeExec : public CMenuTarget
{ {
public: public:
int exec(CMenuTarget* parent, const std::string & actionKey); int exec(CMenuTarget *parent, const std::string &actionKey);
}; };
class CNVODChangeExec : public CMenuTarget class CNVODChangeExec : public CMenuTarget
{ {
public: public:
int exec(CMenuTarget* parent, const std::string & actionKey); int exec(CMenuTarget *parent, const std::string &actionKey);
}; };
class CMoviePluginChangeExec : public CMenuTarget class CMoviePluginChangeExec : public CMenuTarget
{ {
public: public:
int exec(CMenuTarget* parent, const std::string & actionKey); int exec(CMenuTarget *parent, const std::string &actionKey);
}; };
class CTZChangeNotifier : public CChangeObserver class CTZChangeNotifier : public CChangeObserver
{ {
public: public:
bool changeNotify(const neutrino_locale_t, void * data); bool changeNotify(const neutrino_locale_t, void *data);
}; };
class CDataResetNotifier : public CMenuTarget class CDataResetNotifier : public CMenuTarget
{ {
public: public:
int exec(CMenuTarget* parent, const std::string& actionKey); int exec(CMenuTarget *parent, const std::string &actionKey);
}; };
class CFanControlNotifier : public CChangeObserver class CFanControlNotifier : public CChangeObserver
{ {
public: public:
bool changeNotify(const neutrino_locale_t, void * data); bool changeNotify(const neutrino_locale_t, void *data);
static void setSpeed(unsigned int speed); static void setSpeed(unsigned int speed);
}; };
class CCpuFreqNotifier : public CChangeObserver class CCpuFreqNotifier : public CChangeObserver
{ {
public: public:
bool changeNotify(const neutrino_locale_t, void * data); bool changeNotify(const neutrino_locale_t, void *data);
}; };
class CAutoModeNotifier : public CChangeObserver class CAutoModeNotifier : public CChangeObserver
{ {
public: public:
bool changeNotify(const neutrino_locale_t, void * data); bool changeNotify(const neutrino_locale_t, void *data);
}; };
class CApiKey class CApiKey
{ {
public: public:
static int check_api_key(const std::string& api_key_setting, const std::string& api_key_pattern) static int check_api_key(const std::string &api_key_setting, const std::string &api_key_pattern)
{ {
return ((api_key_setting != api_key_pattern) && !api_key_setting.empty()); return ((api_key_setting != api_key_pattern) && !api_key_setting.empty());
} }