From ccd8e3918299b1cf7a1d33d698e55cbfa36c9c7e Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Fri, 27 Apr 2012 08:13:29 +0200 Subject: [PATCH] * Numeric display volumebar can be switched off. - Adjustable via Menu -> Settings -> OSD -> Volumebar digits --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/driver/volume.cpp | 8 ++++---- src/gui/osd_setup.cpp | 8 +++++++- src/neutrino.cpp | 2 ++ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/settings.h | 1 + 8 files changed, 22 insertions(+), 5 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index f6592f3c2..230f40fb4 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -391,6 +391,7 @@ extra.tp_pol_r R extra.tp_rate Symbolrate extra.update_dir Lokales Update-Verzeichnis extra.use_gotoxx Benutze gotoXX +extra.volume_digits Lautstärkeanzeige Ziffern extra.volume_pos Lautstärkeanzeige extra.west Westen extra.zap_cycle Zap nur in Bouquet @@ -1047,6 +1048,7 @@ menu.hint_video_format Diese Option aktiviert das 'Bildschirmformat'\nauf das Fo menu.hint_video_mode Definiert in welchen Videoformat das Bild über den\nHDMI-Ausgang ausgegeben wird menu.hint_video_modes Definiert welche Videosysteme mit der VF-Taste\nder Fernbedienung ausgewählt werden können menu.hint_video_scart_mode Wählen Sie den Analogausgang Modus\nfür den SCART Ausgang +menu.hint_volume_digits Zifferndarstellung der Lautstärkeanzeige ein/ausschalten menu.hint_volume_pos Hier können Sie die Anzeigeposition der Lautstärkeanzeige auswählen menu.hint_zap_cycle Dadurch wird nur innerhalb des aktiven Bouquets gezappt menu.next Weiter (Menü zum Beenden) diff --git a/data/locale/english.locale b/data/locale/english.locale index 92192660f..9a2d73bf9 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -315,6 +315,7 @@ extra.tp.pol_v V extra.tp_rate Symbol rate extra.update_dir Local update directory extra.use_gotoxx Use gotoXX +extra.volume_digits Volumebar digits extra.volume_pos Volumebar extra.west West extra.zap_cycle Zap cycle @@ -1047,6 +1048,7 @@ menu.hint_video_mode HDMI output video mode menu.hint_video_modes VF key will cycle between enabled modes menu.hint_video_scart_mode Select analog output mode for SCART connectors menu.hint_video Video output, resolution, format\nAspect ratio, fast mode switch options +menu.hint_volume_digits Numeric display of the volumebar on/off menu.hint_volume_pos Select volume indicator position menu.hint_zap_cycle When swithing channels, stay in current bouquet menu.next Next (press Menu to quit) diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index 07f26ce78..a5534d80d 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -57,12 +57,11 @@ CVolume::CVolume() v_RemoteControl = new CRemoteControl; #endif VolumeFont = SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO; - paintDigits = true; // For future On/Off digits paintShadow = false; // For future On/Off switch shadow MuteIconFrame = false; // For future On/Off switch IconFrame ShadowOffset = 4; mute_ay = 0; - m_mode = CNeutrinoApp::getInstance()->getMode(); + m_mode = CNeutrinoApp::getInstance()->getMode(); Init(); } @@ -75,6 +74,7 @@ CVolume::~CVolume() void CVolume::Init() { + paintDigits = g_settings.volume_digits; mute_ay_old = mute_ay; int faktor_h = 18; // scale * 10 int clock_height= 0; @@ -239,9 +239,9 @@ void CVolume::setVolume(const neutrino_msg_t key, const bool bDoPaint, bool nowa // volumebar shadow if (paintShadow) - frameBuffer->paintBoxRel(x+ShadowOffset , y+ShadowOffset , (paintDigits) ? vbar_w - vbar_h : vbar_w, vbar_h, colShadow, ROUNDED, CORNER_TOP_LEFT | CORNER_BOTTOM_LEFT); + frameBuffer->paintBoxRel(x+ShadowOffset , y+ShadowOffset , (paintDigits) ? vbar_w - vbar_h : vbar_w + 1, vbar_h, colShadow, ROUNDED, (paintDigits) ? CORNER_TOP_LEFT | CORNER_BOTTOM_LEFT : CORNER_ALL); // volumebar - frameBuffer->paintBoxRel(x , y , (paintDigits) ? vbar_w - vbar_h : vbar_w, vbar_h, colBar, ROUNDED, CORNER_TOP_LEFT | CORNER_BOTTOM_LEFT); + frameBuffer->paintBoxRel(x , y , (paintDigits) ? vbar_w - vbar_h : vbar_w + 1, vbar_h, colBar, ROUNDED, (paintDigits) ? CORNER_TOP_LEFT | CORNER_BOTTOM_LEFT : CORNER_ALL); // frame for progress frameBuffer->paintBoxRel(progress_x-pB, progress_y-pB, progress_w+pB*1, progress_h+pB*2, colFrame); // volume icon diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 938d9a458..f00c98c38 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -466,6 +466,11 @@ int COsdSetup::showOsdSetup() mc->setHint("", LOCALE_MENU_HINT_VOLUME_POS); osd_menu->addItem(mc); + // volume digits + mc = new CMenuOptionChooser(LOCALE_EXTRA_VOLUME_DIGITS, &g_settings.volume_digits, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); + mc->setHint("", LOCALE_MENU_HINT_VOLUME_DIGITS); + osd_menu->addItem(mc); + // show mute at volume 0 mc = new CMenuOptionChooser(LOCALE_EXTRA_SHOW_MUTE_ICON, &g_settings.show_mute_icon, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_SHOW_MUTE_ICON); @@ -839,7 +844,8 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) g_InfoViewer->changePB(); return true; } - else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_EXTRA_VOLUME_POS)) { + else if ((ARE_LOCALES_EQUAL(OptionName, LOCALE_EXTRA_VOLUME_POS)) || + (ARE_LOCALES_EQUAL(OptionName, LOCALE_EXTRA_VOLUME_DIGITS))){ CVolume::getInstance()->Init(); return false; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 35c1abf93..69c0ff441 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -403,6 +403,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.casystem_display = configfile.getInt32("casystem_display", 2 );//mini ca mode default g_settings.scrambled_message = configfile.getBool("scrambled_message", true ); g_settings.volume_pos = configfile.getInt32("volume_pos", 0 ); + g_settings.volume_digits = configfile.getBool("volume_digits", true); g_settings.menu_pos = configfile.getInt32("menu_pos", CMenuWidget::MENU_POS_CENTER); g_settings.show_menu_hints = configfile.getBool("show_menu_hints", true); g_settings.infobar_show_sysfs_hdd = configfile.getBool("infobar_show_sysfs_hdd" , true ); @@ -845,6 +846,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("casystem_display" , g_settings.casystem_display ); configfile.setBool("scrambled_message" , g_settings.scrambled_message ); configfile.setInt32("volume_pos" , g_settings.volume_pos ); + configfile.setBool("volume_digits", g_settings.volume_digits); configfile.setInt32("menu_pos" , g_settings.menu_pos); configfile.setBool("show_menu_hints" , g_settings.show_menu_hints); configfile.setInt32("infobar_show_sysfs_hdd" , g_settings.infobar_show_sysfs_hdd ); diff --git a/src/system/locals.h b/src/system/locals.h index 142116c4d..ded816293 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -342,6 +342,7 @@ typedef enum LOCALE_EXTRA_TP_RATE, LOCALE_EXTRA_UPDATE_DIR, LOCALE_EXTRA_USE_GOTOXX, + LOCALE_EXTRA_VOLUME_DIGITS, LOCALE_EXTRA_VOLUME_POS, LOCALE_EXTRA_WEST, LOCALE_EXTRA_ZAP_CYCLE, @@ -1074,6 +1075,7 @@ typedef enum LOCALE_MENU_HINT_VIDEO_MODE, LOCALE_MENU_HINT_VIDEO_MODES, LOCALE_MENU_HINT_VIDEO_SCART_MODE, + LOCALE_MENU_HINT_VOLUME_DIGITS, LOCALE_MENU_HINT_VOLUME_POS, LOCALE_MENU_HINT_ZAP_CYCLE, LOCALE_MENU_NEXT, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 7e7c911b8..382b19209 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -342,6 +342,7 @@ const char * locale_real_names[] = "extra.tp_rate", "extra.update_dir", "extra.use_gotoxx", + "extra.volume_digits", "extra.volume_pos", "extra.west", "extra.zap_cycle", @@ -1074,6 +1075,7 @@ const char * locale_real_names[] = "menu.hint_video_mode", "menu.hint_video_modes", "menu.hint_video_scart_mode", + "menu.hint_volume_digits", "menu.hint_volume_pos", "menu.hint_zap_cycle", "menu.next", diff --git a/src/system/settings.h b/src/system/settings.h index 345ca26a6..88ded2fea 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -71,6 +71,7 @@ struct SNeutrinoSettings int casystem_display; int scrambled_message; int volume_pos; + int volume_digits; int show_mute_icon; int menu_pos; int show_menu_hints;