From 6bef3aaaa924b7451f495121ebe2d9b0cfaa14ca Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 31 May 2012 16:25:11 +0400 Subject: [PATCH] gui/osd_setup.cpp: add notify code for radiotext Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/39a297e8b261e9162971f1660d24e5a082d82991 Author: [CST] Focus Date: 2012-05-31 (Thu, 31 May 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/osd_setup.cpp | 25 +++++++++++++++++-------- src/gui/osd_setup.h | 1 - 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index e0526b61e..749637ec4 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -57,6 +57,8 @@ #include +extern CRemoteControl * g_RemoteControl; + static CTimingSettingsNotifier timingsettingsnotifier; extern const char * locale_real_names[]; @@ -68,7 +70,6 @@ COsdSetup::COsdSetup(bool wizard_mode) colorSetupNotifier->changeNotify(NONEXISTANT_LOCALE, NULL); fontsizenotifier = new CFontSizeNotifier; - radiotextNotifier = NULL; osd_menu = NULL; is_wizard = wizard_mode; @@ -385,8 +386,6 @@ int COsdSetup::showOsdSetup() osd_menu = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_COLORS, width, MN_WIDGET_ID_OSDSETUP); osd_menu->setWizardMode(is_wizard); - radiotextNotifier = new CRadiotextNotifier(); - //menu colors CMenuWidget osd_menu_colors(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_COLORS, width, MN_WIDGET_ID_OSDSETUP_MENUCOLORS); @@ -427,8 +426,6 @@ int COsdSetup::showOsdSetup() osd_menu->addItem( new CMenuForwarder(LOCALE_SCREENSHOT_MENU, true, NULL, &osd_menu_screenshot, NULL, CRCInput::RC_3)); //monitor - //CScreenPresetNotifier * presetNotify = new CScreenPresetNotifier(); - //osd_menu->addItem(new CMenuOptionChooser(LOCALE_COLORMENU_OSD_PRESET, &g_settings.screen_preset, OSD_PRESET_OPTIONS, OSD_PRESET_OPTIONS_COUNT, true, presetNotify)); osd_menu->addItem(new CMenuOptionChooser(LOCALE_COLORMENU_OSD_PRESET, &g_settings.screen_preset, OSD_PRESET_OPTIONS, OSD_PRESET_OPTIONS_COUNT, true, this)); osd_menu->addItem(GenericMenuSeparatorLine); @@ -446,7 +443,6 @@ int COsdSetup::showOsdSetup() int res = osd_menu->exec(NULL, ""); delete osd_menu; - delete radiotextNotifier; return res; } @@ -624,7 +620,7 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar) menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW_TUNER, &g_settings.infobar_show_tuner, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW, &g_settings.infobar_show, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_COLORED_EVENTS, &g_settings.colored_events_infobar, OPTIONS_COLORED_EVENTS_OPTIONS, OPTIONS_COLORED_EVENTS_OPTION_COUNT, true)); - menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_RADIOTEXT, &g_settings.radiotext_enable, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, radiotextNotifier)); + menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_RADIOTEXT, &g_settings.radiotext_enable, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); } //channellist @@ -651,7 +647,7 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) if (g_InfoViewer == NULL) g_InfoViewer = new CInfoViewer; g_InfoViewer->changePB(); - return true; + return false; } else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_COLORMENU_OSD_PRESET)) { int preset = * (int *) data; @@ -672,6 +668,19 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) CVolume::getInstance()->Init(); return true; } + else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_RADIOTEXT)) { + if (g_settings.radiotext_enable) { + if (g_Radiotext == NULL) + g_Radiotext = new CRadioText; + if (g_Radiotext && ((CNeutrinoApp::getInstance()->getMode()) == NeutrinoMessages::mode_radio)) + g_Radiotext->setPid(g_RemoteControl->current_PIDs.APIDs[g_RemoteControl->current_PIDs.PIDs.selected_apid].pid); + } else { + if (g_Radiotext) + g_Radiotext->radiotext_stop(); + delete g_Radiotext; + g_Radiotext = NULL; + } + } return false; } diff --git a/src/gui/osd_setup.h b/src/gui/osd_setup.h index 7d6567990..7690f41c9 100644 --- a/src/gui/osd_setup.h +++ b/src/gui/osd_setup.h @@ -45,7 +45,6 @@ class COsdSetup : public CMenuTarget, public CChangeObserver private: CColorSetupNotifier *colorSetupNotifier; CFontSizeNotifier *fontsizenotifier; - CRadiotextNotifier *radiotextNotifier; CMenuWidget *osd_menu; int width;