From ca470f632383e4dcb51b5334e6465681837eae9c Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 26 Jun 2013 23:14:30 +0200 Subject: [PATCH] CVolumeBar: add enums for volume bar pos Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2a63a855847a836080566caa8d3acbc43d1174c6 Author: Michael Liebmann Date: 2013-06-26 (Wed, 26 Jun 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/osd_setup.cpp | 14 +++++++------- src/gui/volumebar.cpp | 14 +++++++------- src/gui/volumebar.h | 11 +++++++++++ src/neutrino.cpp | 2 +- 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index d85eaf9f0..3a07ef112 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -335,13 +335,13 @@ const CMenuOptionChooser::keyval INFOBAR_SUBCHAN_DISP_POS_OPTIONS[INFOBAR_SUBCH #define VOLUMEBAR_DISP_POS_OPTIONS_COUNT 7 const CMenuOptionChooser::keyval VOLUMEBAR_DISP_POS_OPTIONS[VOLUMEBAR_DISP_POS_OPTIONS_COUNT]= { - { 0 , LOCALE_SETTINGS_POS_TOP_RIGHT }, - { 1 , LOCALE_SETTINGS_POS_TOP_LEFT }, - { 2 , LOCALE_SETTINGS_POS_BOTTOM_LEFT }, - { 3 , LOCALE_SETTINGS_POS_BOTTOM_RIGHT }, - { 4 , LOCALE_SETTINGS_POS_TOP_CENTER }, - { 5 , LOCALE_SETTINGS_POS_BOTTOM_CENTER }, - { 6 , LOCALE_SETTINGS_POS_HIGHER_CENTER } + { CVolumeBar::VOLUMEBAR_POS_TOP_RIGHT , LOCALE_SETTINGS_POS_TOP_RIGHT }, + { CVolumeBar::VOLUMEBAR_POS_TOP_LEFT , LOCALE_SETTINGS_POS_TOP_LEFT }, + { CVolumeBar::VOLUMEBAR_POS_BOTTOM_LEFT , LOCALE_SETTINGS_POS_BOTTOM_LEFT }, + { CVolumeBar::VOLUMEBAR_POS_BOTTOM_RIGHT , LOCALE_SETTINGS_POS_BOTTOM_RIGHT }, + { CVolumeBar::VOLUMEBAR_POS_TOP_CENTER , LOCALE_SETTINGS_POS_TOP_CENTER }, + { CVolumeBar::VOLUMEBAR_POS_BOTTOM_CENTER, LOCALE_SETTINGS_POS_BOTTOM_CENTER }, + { CVolumeBar::VOLUMEBAR_POS_HIGHER_CENTER, LOCALE_SETTINGS_POS_HIGHER_CENTER } }; #define MENU_DISP_POS_OPTIONS_COUNT 5 diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 446d7504b..6330ef150 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -121,7 +121,7 @@ void CVolumeBar::initVolumeBarPosition() switch (g_settings.volume_pos) { - case 0:{// upper right + case VOLUMEBAR_POS_TOP_RIGHT:{ int x_corr = 0; if (( neutrino->getMode() != CNeutrinoApp::mode_scart ) && ( neutrino->getMode() != CNeutrinoApp::mode_audio) && ( neutrino->getMode() != CNeutrinoApp::mode_pic)) { if ((neutrino->isMuted()) && (!g_settings.mode_clock)) @@ -132,23 +132,23 @@ void CVolumeBar::initVolumeBarPosition() x = sw - width - x_corr; break; } - case 1:// upper left + case VOLUMEBAR_POS_TOP_LEFT: break; - case 2:// bottom left + case VOLUMEBAR_POS_BOTTOM_LEFT: y = (sh + frameBuffer->getScreenY()) - height - v_spacer; break; - case 3:// bottom right + case VOLUMEBAR_POS_BOTTOM_RIGHT: x = sw - width; y = (sh + frameBuffer->getScreenY()) - height - v_spacer; break; - case 4:// upper center + case VOLUMEBAR_POS_TOP_CENTER: x = ((sw - width) / 2) + x - h_spacer/2; break; - case 5:// bottom center + case VOLUMEBAR_POS_BOTTOM_CENTER: x = ((sw - width) / 2) + x - h_spacer/2; y = (sh + frameBuffer->getScreenY()) - height - v_spacer; break; - case 6:// higher center + case VOLUMEBAR_POS_HIGHER_CENTER: x = ((sw - width) / 2) + x - h_spacer/2; y = (sh + frameBuffer->getScreenY()) - sh/10; break; diff --git a/src/gui/volumebar.h b/src/gui/volumebar.h index ce1903ae6..af44efef0 100644 --- a/src/gui/volumebar.h +++ b/src/gui/volumebar.h @@ -80,6 +80,17 @@ class CVolumeBar : public CComponentsForm public: + enum + { + VOLUMEBAR_POS_TOP_RIGHT = 0, + VOLUMEBAR_POS_TOP_LEFT = 1, + VOLUMEBAR_POS_BOTTOM_LEFT = 2, + VOLUMEBAR_POS_BOTTOM_RIGHT = 3, + VOLUMEBAR_POS_TOP_CENTER = 4, + VOLUMEBAR_POS_BOTTOM_CENTER = 5, + VOLUMEBAR_POS_HIGHER_CENTER = 6 + }; + CVolumeBar(/*int current_volume*/); // ~CVolumeBar(); inherited from CComponentsForm diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d2355a0b6..86e8d6a76 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -398,7 +398,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.infobar_progressbar = configfile.getInt32("infobar_progressbar" , 1 ); // below channel name g_settings.casystem_display = configfile.getInt32("casystem_display", 1 );//discreet ca mode default g_settings.scrambled_message = configfile.getBool("scrambled_message", true ); - g_settings.volume_pos = configfile.getInt32("volume_pos", 0 ); + g_settings.volume_pos = configfile.getInt32("volume_pos", CVolumeBar::VOLUMEBAR_POS_TOP_RIGHT ); 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);