mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 01:41:23 +02:00
osd_setup.cpp: outsource radio text notifier handling into own method
For usage with other functions.
This commit is contained in:
@@ -747,6 +747,8 @@ int COsdSetup::showOsdSetup()
|
||||
|
||||
int res = osd_menu->exec(NULL, "");
|
||||
|
||||
resetRadioText();
|
||||
|
||||
if (oldVolumeSize != g_settings.volume_size)
|
||||
CVolumeHelper::getInstance()->refresh();
|
||||
|
||||
@@ -1568,17 +1570,7 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data)
|
||||
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()) == NeutrinoModes::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;
|
||||
}
|
||||
resetRadioText();
|
||||
}
|
||||
else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_EXTRA_VOLUME_DIGITS)) {
|
||||
CVolumeHelper::getInstance()->refresh();
|
||||
@@ -1599,6 +1591,25 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void COsdSetup::resetRadioText()
|
||||
{
|
||||
if (g_settings.radiotext_enable) {
|
||||
if (g_Radiotext == NULL)
|
||||
g_Radiotext = new CRadioText;
|
||||
if (g_Radiotext && ((CNeutrinoApp::getInstance()->getMode()) == NeutrinoModes::mode_radio)){
|
||||
printf("\033[32m[COsdSetup] %s - %d: %d\033[0m\n", __func__, __LINE__, g_RemoteControl->current_PIDs.APIDs[g_RemoteControl->current_PIDs.PIDs.selected_apid].pid);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int COsdSetup::showContextChanlistMenu(CChannelList *parent_channellist)
|
||||
{
|
||||
static int cselected = -1;
|
||||
|
Reference in New Issue
Block a user