From d08d18522e8748d25b93e616ccf636252cd977ed Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 3 Jun 2013 23:49:37 +0200 Subject: [PATCH] * Add volume bar to osd timeouts in the OSD setup --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/driver/volume.cpp | 6 +++--- src/driver/volume.h | 2 +- src/gui/scan.cpp | 2 +- src/neutrino.cpp | 6 +++--- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 20 ++++++++++---------- 9 files changed, 22 insertions(+), 18 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index be4b95017..ff083e9a7 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1852,6 +1852,7 @@ timing.infobar_movieplayer Infobar (Filmwiedergabe) timing.infobar_radio Infobar (Radiobetrieb) timing.menu Menü timing.numericzap Umschalten mit Zifferntasten +timing.volumebar Lautstärkeanzeige unicable.lnb Unicable Eingang unicable.qrg Unicable Frequenz unicable.scr Unicable SCR diff --git a/data/locale/english.locale b/data/locale/english.locale index 89f1aee37..9908a4495 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1852,6 +1852,7 @@ timing.infobar_movieplayer Infobar (movie mode) timing.infobar_radio Infobar (radio mode) timing.menu Menu timing.numericzap Numeric Zap +timing.volumebar Volume bar unicable.lnb Unicable Input unicable.qrg Unicable Frequency unicable.scr Unicable SCR diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index c6c395586..ae5b0abcf 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -74,7 +74,7 @@ void CVolume::setvol(int vol) CZapit::getInstance()->SetVolume(vol); } -void CVolume::setVolume(const neutrino_msg_t key, bool nowait) +void CVolume::setVolume(const neutrino_msg_t key) { neutrino_msg_t msg = key; int mode = CNeutrinoApp::getInstance()->getMode(); @@ -164,10 +164,10 @@ void CVolume::setVolume(const neutrino_msg_t key, bool nowait) } setvol(g_settings.current_volume); - timeoutEnd = CRCInput::calcTimeoutEnd(nowait ? 1 : 3); + timeoutEnd = CRCInput::calcTimeoutEnd (g_settings.timing[SNeutrinoSettings::TIMING_VOLUMEBAR] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_VOLUMEBAR]); } else if (msg == NeutrinoMessages::EVT_VOLCHANGED) { - timeoutEnd = CRCInput::calcTimeoutEnd(3); + timeoutEnd = CRCInput::calcTimeoutEnd (g_settings.timing[SNeutrinoSettings::TIMING_VOLUMEBAR] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_VOLUMEBAR]); } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::unhandled) { g_RCInput->postMsg(msg, data); diff --git a/src/driver/volume.h b/src/driver/volume.h index 06fa956b6..4c901c779 100644 --- a/src/driver/volume.h +++ b/src/driver/volume.h @@ -47,7 +47,7 @@ class CVolume : public CChangeObserver static CVolume* getInstance(); void setvol(int vol); - void setVolume(const neutrino_msg_t key, bool nowait = false); + void setVolume(const neutrino_msg_t key); void SetCurrentPid(int pid) { apid = pid; } void SetCurrentChannel(t_channel_id id) { channel_id = id; } diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 54640546e..9387449b8 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -450,7 +450,7 @@ int CScanTs::handleMsg(neutrino_msg_t msg, neutrino_msg_data_t data) case CRCInput::RC_minus: case CRCInput::RC_left: case CRCInput::RC_right: - CVolume::getInstance()->setVolume(msg, true /*nowait = true*/); + CVolume::getInstance()->setVolume(msg); break; default: if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000)) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 9be0abbdd..d200bad33 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2094,7 +2094,7 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) showInfo(); break; case SNeutrinoSettings::VOLUME: - g_volume->setVolume(msg, true); + g_volume->setVolume(msg); break; default: /* SNeutrinoSettings::ZAP */ quickZap(msg); @@ -2114,7 +2114,7 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) showInfo(); break; case SNeutrinoSettings::VOLUME: - g_volume->setVolume(msg, true); + g_volume->setVolume(msg); break; default: /* SNeutrinoSettings::ZAP */ quickZap(msg); @@ -2535,7 +2535,7 @@ _repeat: } else if ((msg == CRCInput::RC_plus) || (msg == CRCInput::RC_minus)) { - g_volume->setVolume(msg, (mode != mode_scart)); + g_volume->setVolume(msg); return messages_return::handled; } else if( msg == CRCInput::RC_spkr ) { diff --git a/src/system/locals.h b/src/system/locals.h index 24640fe80..c0c83271c 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1879,6 +1879,7 @@ typedef enum LOCALE_TIMING_INFOBAR_RADIO, LOCALE_TIMING_MENU, LOCALE_TIMING_NUMERICZAP, + LOCALE_TIMING_VOLUMEBAR, LOCALE_UNICABLE_LNB, LOCALE_UNICABLE_QRG, LOCALE_UNICABLE_SCR, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index da73becf4..f3fba11cc 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1879,6 +1879,7 @@ const char * locale_real_names[] = "timing.infobar_radio", "timing.menu", "timing.numericzap", + "timing.volumebar", "unicable.lnb", "unicable.qrg", "unicable.scr", diff --git a/src/system/settings.h b/src/system/settings.h index d1d2fc516..8df207ac6 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -233,15 +233,15 @@ struct SNeutrinoSettings //timing enum TIMING_SETTINGS { - TIMING_MENU = 0, - TIMING_CHANLIST = 1, - TIMING_EPG = 2, - TIMING_INFOBAR = 3, - TIMING_INFOBAR_RADIO = 4, - TIMING_INFOBAR_MOVIE = 5, -// TIMING_VOLUMEBAR, - TIMING_FILEBROWSER = 6, - TIMING_NUMERICZAP = 7, + TIMING_MENU = 0, + TIMING_CHANLIST = 1, + TIMING_EPG = 2, + TIMING_INFOBAR = 3, + TIMING_INFOBAR_RADIO = 4, + TIMING_INFOBAR_MOVIE = 5, + TIMING_VOLUMEBAR = 6, + TIMING_FILEBROWSER = 7, + TIMING_NUMERICZAP = 8, TIMING_SETTING_COUNT }; @@ -649,7 +649,7 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO { 6, LOCALE_TIMING_INFOBAR }, { 0, LOCALE_TIMING_INFOBAR_RADIO }, { 6, LOCALE_TIMING_INFOBAR_MOVIEPLAYER}, -// { 3, LOCALE_TIMING_VOLUMEBAR }, + { 3, LOCALE_TIMING_VOLUMEBAR }, { 60, LOCALE_TIMING_FILEBROWSER }, { 3, LOCALE_TIMING_NUMERICZAP } };