From 0c585b0d70e29d21397e1442c6c23ae3b42baeda Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 28 Jun 2017 16:26:36 +0200 Subject: [PATCH] audioplayer: allow to load radio-favorites.xml via menu Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6a3fa8c4e75edf15c40907039b50161c18f433ea Author: vanhofen Date: 2017-06-28 (Wed, 28 Jun 2017) Origin message was: ------------------ - audioplayer: allow to load radio-favorites.xml via menu ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/audioplayer.cpp | 15 +++++++++++++-- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 32850895e..aa0c45103 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -155,6 +155,7 @@ audiomenu.volume_adjustment_pcm PCM-Tonspuren audiomenu.volume_start Einschaltlautstärke audiomenu.volume_step Lautstärke Schrittweite audioplayer.add Hinzufügen +audioplayer.add_fav Lokale Radiofavoriten audioplayer.add_ic Icecast audioplayer.add_loc Lokale Radioliste audioplayer.add_sc SHOUTcast diff --git a/data/locale/english.locale b/data/locale/english.locale index 28b74cf62..eefe40372 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -155,6 +155,7 @@ audiomenu.volume_adjustment_pcm PCM streams audiomenu.volume_start Start volume audiomenu.volume_step Volume step audioplayer.add Add +audioplayer.add_fav Local radio favorites audioplayer.add_ic Icecast audioplayer.add_loc Local radio list audioplayer.add_sc SHOUTcast diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 03f95656b..ef0d39ff2 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -708,6 +708,10 @@ int CAudioPlayerGui::show() CMenuSelectorTarget *InetRadioInputChanger = new CMenuSelectorTarget(&select); // -- setup menue for inetradio input sprintf(cnt, "%d", count); + InputSelector.addItem(new CMenuForwarder( + LOCALE_AUDIOPLAYER_ADD_FAV, true, NULL, InetRadioInputChanger, + cnt, CRCInput::convertDigitToKey(count + 1)), old_select == count); + sprintf(cnt, "%d", ++count); InputSelector.addItem(new CMenuForwarder( LOCALE_AUDIOPLAYER_ADD_LOC, true, NULL, InetRadioInputChanger, cnt, CRCInput::convertDigitToKey(count + 1)), old_select == count); @@ -731,21 +735,28 @@ int CAudioPlayerGui::show() switch (select) { case 0: - scanXmlFile(RADIO_STATION_XML_FILE); + scanXmlFile(RADIO_FAVORITES_XML_FILE); CVFD::getInstance()->setMode(CVFD::MODE_AUDIO); paintLCD(); break; case 1: - readDir_ic(); + scanXmlFile(RADIO_STATION_XML_FILE); CVFD::getInstance()->setMode(CVFD::MODE_AUDIO); paintLCD(); break; case 2: + readDir_ic(); + CVFD::getInstance()->setMode(CVFD::MODE_AUDIO); + paintLCD(); + break; + case 3: openSCbrowser(); break; default: break; } + m_current = 0; + m_selected = 0; update=true; } else if (shufflePlaylist()) diff --git a/src/system/locals.h b/src/system/locals.h index 7673ac49d..d335df81a 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -182,6 +182,7 @@ typedef enum LOCALE_AUDIOMENU_VOLUME_START, LOCALE_AUDIOMENU_VOLUME_STEP, LOCALE_AUDIOPLAYER_ADD, + LOCALE_AUDIOPLAYER_ADD_FAV, LOCALE_AUDIOPLAYER_ADD_IC, LOCALE_AUDIOPLAYER_ADD_LOC, LOCALE_AUDIOPLAYER_ADD_SC, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 67055ca4a..3b72a57d1 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -182,6 +182,7 @@ const char * locale_real_names[] = "audiomenu.volume_start", "audiomenu.volume_step", "audioplayer.add", + "audioplayer.add_fav", "audioplayer.add_ic", "audioplayer.add_loc", "audioplayer.add_sc",