diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 4dc1ca70d..3fd061450 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1030,6 +1030,8 @@ keychoosermenu.setnone Keine Taste languagesetup.head Sprache und Zeitzonen languagesetup.osd Menüsprache languagesetup.select Sprache +lcd4l_brightness Helligkeit +lcd4l_brightness_standby Helligkeit im Standby-Modus lcd4l_clock_a Analog-Uhr im Standby-Modus lcd4l_convert Konvertiere Umlaute lcd4l_display_type Display-Typ diff --git a/data/locale/english.locale b/data/locale/english.locale index 146ffa003..d4c823fd9 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1030,6 +1030,8 @@ keychoosermenu.setnone No key languagesetup.head Language and timezone languagesetup.osd OSD language languagesetup.select OSD language +lcd4l_brightness Brightness +lcd4l_brightness_standby Brightness in standby lcd4l_clock_a Analog clock in standby mode lcd4l_convert Convert umlauts lcd4l_display_type Display Type diff --git a/src/driver/lcd4l.cpp b/src/driver/lcd4l.cpp index cdd234ec3..db035eba1 100644 --- a/src/driver/lcd4l.cpp +++ b/src/driver/lcd4l.cpp @@ -64,6 +64,8 @@ extern cVideo *videoDecoder; #define LOGO_DUMMY LCD_ICONSDIR "blank.png" +#define BRIGHTNESS LCD_DATADIR "brightness" +#define BRIGHTNESS_STANDBY LCD_DATADIR "brightness_standby" #define RESOLUTION LCD_DATADIR "resolution" #define ASPECTRATIO LCD_DATADIR "aspectratio" #define VIDEOTEXT LCD_DATADIR "videotext" @@ -189,6 +191,8 @@ void CLCD4l::Init() { m_ParseID = 0; + m_Brightness = -1; + m_Brightness_standby = -1; m_Resolution = "n/a"; m_AspectRatio = "n/a"; m_Videotext = -1; @@ -311,6 +315,26 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) /* ----------------------------------------------------------------- */ + int Brightness = g_settings.lcd4l_brightness; + if (m_Brightness != Brightness) + { + WriteFile(BRIGHTNESS, to_string(Brightness)); + m_Brightness = Brightness; + lcd4linux(false); + lcd4linux(true); + } + + int Brightness_standby = g_settings.lcd4l_brightness_standby; + if (m_Brightness_standby != Brightness_standby) + { + WriteFile(BRIGHTNESS_STANDBY, to_string(Brightness_standby)); + m_Brightness_standby = Brightness_standby; + lcd4linux(false); + lcd4linux(true); + } + + /* ----------------------------------------------------------------- */ + int x_res, y_res, framerate; videoDecoder->getPictureInfo(x_res, y_res, framerate); diff --git a/src/driver/lcd4l.h b/src/driver/lcd4l.h index 34250f02b..16ee24f17 100644 --- a/src/driver/lcd4l.h +++ b/src/driver/lcd4l.h @@ -70,6 +70,8 @@ class CLCD4l int m_Mode; int m_ModeChannel; + int m_Brightness; + int m_Brightness_standby; std::string m_Resolution; std::string m_AspectRatio; int m_Videotext; diff --git a/src/gui/lcd4l_setup.cpp b/src/gui/lcd4l_setup.cpp index d1c0d9a38..0f6fe1341 100644 --- a/src/gui/lcd4l_setup.cpp +++ b/src/gui/lcd4l_setup.cpp @@ -159,6 +159,14 @@ int CLCD4lSetup::show() mc->setHint(NEUTRINO_ICON_HINT_LCD4L, LOCALE_MENU_HINT_LCD4L_SKIN_RADIO); lcd4lSetup->addItem(mc); + nc = new CMenuOptionNumberChooser(LOCALE_LCD4L_BRIGHTNESS, (int *)&g_settings.lcd4l_brightness, true, 1, 7, this); + nc->setHint("", LOCALE_MENU_HINT_LCD4L_BRIGHTNESS); + lcd4lSetup->addItem(nc); + + nc = new CMenuOptionNumberChooser(LOCALE_LCD4L_BRIGHTNESS_STANDBY, (int *)&g_settings.lcd4l_brightness_standby, true, 1, 7, this); + nc->setHint("", LOCALE_MENU_HINT_LCD4L_BRIGHTNESS_STANDBY); + lcd4lSetup->addItem(nc); + const char *flag_lcd4l_weather = FLAGDIR "/.lcd-weather"; int fake_lcd4l_weather = file_exists(flag_lcd4l_weather); CTouchFileNotifier * lcd_weather = new CTouchFileNotifier(flag_lcd4l_weather); diff --git a/src/gui/lcd4l_setup.h b/src/gui/lcd4l_setup.h index 88734d875..fb6c94ef5 100644 --- a/src/gui/lcd4l_setup.h +++ b/src/gui/lcd4l_setup.h @@ -36,6 +36,7 @@ class CLCD4lSetup : public CMenuTarget, CChangeObserver { private: + CMenuOptionNumberChooser *nc; CMenuOptionChooser *mc; CMenuForwarder * mf; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 35d4b5650..c581f931b 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -373,6 +373,8 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.lcd4l_display_type = configfile.getInt32("lcd4l_display_type", 0); g_settings.lcd4l_skin = configfile.getInt32("lcd4l_skin" , 0); g_settings.lcd4l_skin_radio = configfile.getInt32("lcd4l_skin_radio" , 0); + g_settings.lcd4l_brightness = configfile.getInt32("lcd4l_brightness", 7); + g_settings.lcd4l_brightness_standby = configfile.getInt32("lcd4l_brightness_standby", 3); g_settings.lcd4l_convert = configfile.getInt32("lcd4l_convert", 1); g_settings.show_menu_hints_line = configfile.getBool("show_menu_hints_line", false); g_settings.mode_icons = configfile.getInt32( "mode_icons", 0); @@ -1302,6 +1304,8 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("lcd4l_display_type" , g_settings.lcd4l_display_type); configfile.setInt32("lcd4l_skin" , g_settings.lcd4l_skin); configfile.setInt32("lcd4l_skin_radio" , g_settings.lcd4l_skin_radio); + configfile.setInt32("lcd4l_brightness", g_settings.lcd4l_brightness); + configfile.setInt32("lcd4l_brightness_standby", g_settings.lcd4l_brightness_standby); configfile.setInt32("lcd4l_convert" , g_settings.lcd4l_convert); configfile.setBool("show_menu_hints_line" , g_settings.show_menu_hints_line); configfile.setInt32("mode_icons", g_settings.mode_icons ); diff --git a/src/system/locals.h b/src/system/locals.h index 7ad89716a..16960cf10 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1057,6 +1057,8 @@ typedef enum LOCALE_LANGUAGESETUP_HEAD, LOCALE_LANGUAGESETUP_OSD, LOCALE_LANGUAGESETUP_SELECT, + LOCALE_LCD4L_BRIGHTNESS, + LOCALE_LCD4L_BRIGHTNESS_STANDBY, LOCALE_LCD4L_CLOCK_A, LOCALE_LCD4L_CONVERT, LOCALE_LCD4L_DISPLAY_TYPE, @@ -1403,6 +1405,8 @@ typedef enum LOCALE_MENU_HINT_LAST_RADIO, LOCALE_MENU_HINT_LAST_TV, LOCALE_MENU_HINT_LAST_USE, + LOCALE_MENU_HINT_LCD4L_BRIGHTNESS, + LOCALE_MENU_HINT_LCD4L_BRIGHTNESS_STANDBY, LOCALE_MENU_HINT_LCD4L_CLOCK_A, LOCALE_MENU_HINT_LCD4L_CONVERT, LOCALE_MENU_HINT_LCD4L_LOGODIR, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index f1f464552..4b48510aa 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1057,6 +1057,8 @@ const char * locale_real_names[] = "languagesetup.head", "languagesetup.osd", "languagesetup.select", + "lcd4l_brightness", + "lcd4l_brightness_standby", "lcd4l_clock_a", "lcd4l_convert", "lcd4l_display_type", @@ -1403,6 +1405,8 @@ const char * locale_real_names[] = "menu.hint_last_radio", "menu.hint_last_tv", "menu.hint_last_use", + "menu.hint_lcd4l_brightness", + "menu.hint_lcd4l_brightness_standby", "menu.hint_lcd4l_clock_a", "menu.hint_lcd4l_convert", "menu.hint_lcd4l_logodir", diff --git a/src/system/settings.h b/src/system/settings.h index 6d1966373..d9b2be8d6 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -868,6 +868,8 @@ struct SNeutrinoSettings // lcd4linux int lcd4l_support; std::string lcd4l_logodir; + int lcd4l_brightness; + int lcd4l_brightness_standby; int lcd4l_display_type; int lcd4l_skin; int lcd4l_skin_radio;