From 7128a742763393c24e34333bbb59c9608a0619e6 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 7 Feb 2011 18:53:26 +0000 Subject: [PATCH] add menu for led record git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1116 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d00ac262ae64e99a224beb4f9e2db65049cdb9e3 Author: Jacek Jendrzej Date: 2011-02-07 (Mon, 07 Feb 2011) Origin message was: ------------------ -add menu for led record git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1116 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/driver/vfd.cpp | 33 ++++++++++++++++++++++++++++++--- src/driver/vfd.h | 1 + src/gui/vfd_setup.cpp | 1 + src/neutrino.cpp | 2 ++ src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 1 + 9 files changed, 39 insertions(+), 3 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 0cf8f240d..1601e0a34 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -664,6 +664,7 @@ lcdmenu.statusline.volume Lautstärke ledcontroler.menu Power Button LEDs ledcontroler.mode.tv TV Betrieb ledcontroler.mode.deepstandby Deep-Standby +ledcontroler.mode.record Blinke bei Aufnahme ledcontroler.mode.standby Standby ledcontroler.off LED1 & LED2 aus ledcontroler.on.all LED1 & LED2 an diff --git a/data/locale/english.locale b/data/locale/english.locale index 15583dda2..2d0cb5b65 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -499,6 +499,7 @@ lcdmenu.statusline.volume volume ledcontroler.menu Power Button LED�s ledcontroler.mode.tv TV Mode ledcontroler.mode.deepstandby Deep Standby +ledcontroler.mode.record Blinke in Record ledcontroler.mode.standby Standby ledcontroler.off Led1 & Led2 off ledcontroler.on.all Led1 & Led2 on diff --git a/src/driver/vfd.cpp b/src/driver/vfd.cpp index f2c816771..85ba9195b 100644 --- a/src/driver/vfd.cpp +++ b/src/driver/vfd.cpp @@ -176,11 +176,38 @@ void CVFD::setled(int led1, int led2){ perror("IOC_VFD_LED_CTRL"); } +void CVFD::setled(bool on_off) +{ + if(g_settings.led_rec_mode == 0) + return; + + int led1 = VFD_LED_1_OFF, led2 = VFD_LED_2_OFF; + if(on_off){//on + switch(g_settings.led_rec_mode){ + case 1: + led1 = VFD_LED_1_ON; led2 = VFD_LED_2_ON; + break; + case 2: + led1 = VFD_LED_1_ON; led2 = VFD_LED_2_OFF; + break; + case 3: + led1 = VFD_LED_1_OFF; led2 = VFD_LED_2_ON; + break; + default: + break; + } + } + else {//off + led1 = VFD_LED_1_OFF; led2 = VFD_LED_2_OFF; + } + setled(led1, led2); +} + void CVFD::setled(void) { if(!has_lcd) return; - int led1 = 0, led2 = 0; + int led1 = VFD_LED_1_OFF, led2 = VFD_LED_2_OFF; int select = 0; if(mode == MODE_MENU_UTF8 || mode == MODE_TVRADIO ) @@ -255,12 +282,12 @@ void CVFD::showTime(bool force) clearClock = 0; if(has_lcd) ShowIcon(VFD_ICON_CAM1, false); - setled(VFD_LED_1_OFF, VFD_LED_2_OFF); + setled(false);//off } else { clearClock = 1; if(has_lcd) ShowIcon(VFD_ICON_CAM1, true); - setled(VFD_LED_1_ON, VFD_LED_2_ON); + setled(true);//on } } else if(clearClock || (recstatus != CNeutrinoApp::getInstance ()->recordingstatus)) { // in case icon ON after record stopped clearClock = 0; diff --git a/src/driver/vfd.h b/src/driver/vfd.h index f01555fd9..fcc0c7420 100644 --- a/src/driver/vfd.h +++ b/src/driver/vfd.h @@ -104,6 +104,7 @@ class CVFD bool has_lcd; void setlcdparameter(void); void setled(void); + void setled(bool on_off); static CVFD* getInstance(); void init(const char * fontfile, const char * fontname); diff --git a/src/gui/vfd_setup.cpp b/src/gui/vfd_setup.cpp index 517dfe10f..7021239c3 100644 --- a/src/gui/vfd_setup.cpp +++ b/src/gui/vfd_setup.cpp @@ -127,6 +127,7 @@ void CVfdSetup::showSetup() ledMenu->addItem(new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_TV, &g_settings.led_tv_mode, LEDMENU_OPTIONS, LEDMENU_OPTION_COUNT, true, new CLedControlNotifier())); ledMenu->addItem(new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_STANDBY, &g_settings.led_standby_mode, LEDMENU_OPTIONS, LEDMENU_OPTION_COUNT, true)); ledMenu->addItem(new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_DEEPSTANDBY, &g_settings.led_deep_mode, LEDMENU_OPTIONS, LEDMENU_OPTION_COUNT, true)); + ledMenu->addItem(new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_RECORD, &g_settings.led_rec_mode, LEDMENU_OPTIONS, LEDMENU_OPTION_COUNT, true)); ledMenu->addItem(new CMenuOptionChooser(LOCALE_LEDCONTROLER_BLINK, &g_settings.led_blink, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); vfds->addItem(new CMenuForwarder(LOCALE_LEDCONTROLER_MENU, true, NULL, ledMenu, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN)); } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 63e2b18c6..208d79c1d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -462,6 +462,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.led_tv_mode = configfile.getInt32( "led_tv_mode", 1); g_settings.led_standby_mode = configfile.getInt32( "led_standby_mode", 1); g_settings.led_deep_mode = configfile.getInt32( "led_deep_mode", 1); + g_settings.led_rec_mode = configfile.getInt32( "led_rec_mode", 1); g_settings.led_blink = configfile.getInt32( "led_blink", 1); g_settings.hdd_fs = configfile.getInt32( "hdd_fs", 0); @@ -999,6 +1000,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "led_tv_mode", g_settings.led_tv_mode); configfile.setInt32( "led_standby_mode", g_settings.led_standby_mode); configfile.setInt32( "led_deep_mode", g_settings.led_deep_mode); + configfile.setInt32( "led_rec_mode", g_settings.led_rec_mode); configfile.setInt32( "led_blink", g_settings.led_blink); //misc diff --git a/src/system/locals.h b/src/system/locals.h index 2290c9f88..6e4b53985 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -533,6 +533,7 @@ typedef enum { LOCALE_LEDCONTROLER_MENU, LOCALE_LEDCONTROLER_MODE_TV, LOCALE_LEDCONTROLER_MODE_DEEPSTANDBY, + LOCALE_LEDCONTROLER_MODE_RECORD, LOCALE_LEDCONTROLER_MODE_STANDBY, LOCALE_LEDCONTROLER_OFF, LOCALE_LEDCONTROLER_ON_ALL, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 52207f7ca..864440002 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -533,6 +533,7 @@ const char *locale_real_names[] = { "ledcontroler.menu", "ledcontroler.mode.tv", "ledcontroler.mode.deepstandby", + "ledcontroler.mode.record", "ledcontroler.mode.standby", "ledcontroler.off", "ledcontroler.on.all", diff --git a/src/system/settings.h b/src/system/settings.h index f9aea2939..dfeb97081 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -397,6 +397,7 @@ struct SNeutrinoSettings int led_tv_mode; int led_standby_mode; int led_deep_mode; + int led_rec_mode; int led_blink; #define FILESYSTEM_ENCODING_TO_UTF8(a) (g_settings.filesystem_is_utf8 ? (a) : ZapitTools::Latin1_to_UTF8(a).c_str()) #define UTF8_TO_FILESYSTEM_ENCODING(a) (g_settings.filesystem_is_utf8 ? (a) : ZapitTools::UTF8_to_Latin1(a).c_str())