diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index fe064aa26..3413dc960 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -848,6 +848,7 @@ imdb.data_website Webseite imdb.data_writer Drehbuchautor imdb.info IMDb-Info imdb.info_save Bild speichern +inetradio.autostart Internetradio Auto-Start inetradio.name Internetradio infoviewer.epgnotload Informationen noch nicht geladen ... infoviewer.epgwait Warte auf EPG-Informationen ... @@ -1136,6 +1137,7 @@ menu.hint_inact_timer Ausschalten der Box nach Inaktivität in Minuten.\nDie Box menu.hint_inactive_back Ändern Sie die Hintergrundfarbe für deaktivierte Fensterinhalte menu.hint_inactive_textcolor Ändern Sie die Textfarbe für deaktivierte Fensterinhalte menu.hint_inet_radio Internetradio +menu.hint_inet_radio_autostart Spielt automatisch den ersten Eintrag der Favoriten-Liste ab menu.hint_info Systeminformationen anzeigen. menu.hint_infobar_back Ändern Sie die Hintergrundfarbe für die Infobar menu.hint_infobar_buttons_usertitle Erzwingt die benutzerdefinierten Titel der Farbtasten diff --git a/data/locale/english.locale b/data/locale/english.locale index 42ff6f743..b8def5b33 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -848,6 +848,7 @@ imdb.data_website Website imdb.data_writer Screenplay author imdb.info IMDb-Info imdb.info_save save Cover +inetradio.autostart Internetradio Auto-Start inetradio.name Internetradio infoviewer.epgnotload EPG not loaded ... infoviewer.epgwait waiting for EPG ... @@ -1136,6 +1137,7 @@ menu.hint_inact_timer Shutdown box after inactivity menu.hint_inactive_back Change inactive item background color menu.hint_inactive_textcolor Change inactive item text color menu.hint_inet_radio Internet radio +menu.hint_inet_radio_autostart Start play of first entry from favorites automatically menu.hint_info Show system informations. menu.hint_infobar_back Change infobar background color menu.hint_infobar_buttons_usertitle Forces userdefined titles for the color keys diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 834fa4e01..2f94fc9fc 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -37,8 +37,6 @@ #include #include #include -#include -#include #include @@ -95,8 +93,10 @@ extern cVideo * videoDecoder; #define AUDIOPLAYER_START_SCRIPT CONFIGDIR "/audioplayer.start" #define AUDIOPLAYER_END_SCRIPT CONFIGDIR "/audioplayer.end" #define DEFAULT_RADIOSTATIONS_XMLFILE CONFIGDIR "/radio-stations.xml" +#define DEFAULT_RADIOFAVORITES_XMLFILE CONFIGDIR "/radio-favorites.xml" const char RADIO_STATION_XML_FILE[] = {DEFAULT_RADIOSTATIONS_XMLFILE}; +const char RADIO_FAVORITES_XML_FILE[] = {DEFAULT_RADIOFAVORITES_XMLFILE}; CAudiofileExt::CAudiofileExt() : CAudiofile(), firstChar('\0') { @@ -253,6 +253,13 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_select_title_by_name = g_settings.audioplayer_select_title_by_name; } + //auto-load favorites + if ((m_inetmode) && (m_playlist.empty())) + { + if (access(RADIO_FAVORITES_XML_FILE, F_OK) == 0) + scanXmlFile(RADIO_FAVORITES_XML_FILE); + } + if (m_playlist.empty()) m_current = -1; else @@ -305,6 +312,10 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_LastMode = CNeutrinoApp::getInstance()->getMode(); CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE , NeutrinoModes::mode_audio); + // wake up hdd + printf("[audioplayer.cpp] wakeup_hdd(%s)\n", g_settings.network_nfs_audioplayerdir.c_str()); + wakeup_hdd(g_settings.network_nfs_audioplayerdir.c_str()/*,true*/); + puts("[audioplayer.cpp] executing " AUDIOPLAYER_START_SCRIPT "."); if (my_system(AUDIOPLAYER_START_SCRIPT) != 0) perror(AUDIOPLAYER_START_SCRIPT " failed"); @@ -352,10 +363,20 @@ int CAudioPlayerGui::show() bool clear_before_update = false; m_key_level = 0; + // auto-play first entry from favorites + if (g_settings.inetradio_autostart) + { + if ((m_inetmode) && (!m_playlist.empty())) + { + m_current = 0; + m_selected = 0; + play(m_selected); + } + } + while (loop) { updateMetaData(); - updateTimes(); // stop if mode was changed in another thread @@ -437,7 +458,7 @@ int CAudioPlayerGui::show() if (m_state != CAudioPlayerGui::STOP) stop(); } -#if 0 //add RC_favorites for internetradio + //add RC_favorites for internetradio else if ((msg == CRCInput::RC_favorites) && (m_inetmode)) { if (m_key_level == 0) @@ -453,7 +474,6 @@ int CAudioPlayerGui::show() } } } -#endif else if (msg == CRCInput::RC_left || msg == CRCInput::RC_previoussong) { if (m_key_level == 1) @@ -635,7 +655,7 @@ int CAudioPlayerGui::show() // keylevel 2 can only be reached if the currently played file // is no stream, so we do not have to test for this case int seconds=0; - CIntInput secondsInput(LOCALE_AUDIOPLAYER_JUMP_DIALOG_TITLE, + CIntInput secondsInput( LOCALE_AUDIOPLAYER_JUMP_DIALOG_TITLE, &seconds, 5, LOCALE_AUDIOPLAYER_JUMP_DIALOG_HINT1, @@ -685,6 +705,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); @@ -711,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()) @@ -745,7 +776,7 @@ int CAudioPlayerGui::show() // keylevel 2 can only be reached if the currently played file // is no stream, so we do not have to test for this case int seconds=0; - CIntInput secondsInput(LOCALE_AUDIOPLAYER_JUMP_DIALOG_TITLE, + CIntInput secondsInput( LOCALE_AUDIOPLAYER_JUMP_DIALOG_TITLE, &seconds, 5, LOCALE_AUDIOPLAYER_JUMP_DIALOG_HINT1, @@ -1032,7 +1063,7 @@ bool CAudioPlayerGui::shufflePlaylist(void) return(result); } -void CAudioPlayerGui::addUrl2Playlist(const char *url, const char *name, const time_t bitrate) +void CAudioPlayerGui::addUrl2Playlist(const char *url, const char *name, const char *logo, const time_t bitrate) { CAudiofileExt mp3(url, CFile::STREAM_AUDIO); //tmp = tmp.substr(0,tmp.length()-4); //remove .url @@ -1043,19 +1074,27 @@ void CAudioPlayerGui::addUrl2Playlist(const char *url, const char *name, const t } else { - std::string tmp = mp3.Filename.substr(mp3.Filename.rfind('/')+1); - mp3.MetaData.title = tmp; + std::string filename = mp3.Filename.substr(mp3.Filename.rfind('/') + 1); + mp3.MetaData.title = filename; } + + if (logo != NULL) + mp3.MetaData.logo = logo; + else + mp3.MetaData.logo.clear(); + if (bitrate) mp3.MetaData.total_time = bitrate; else mp3.MetaData.total_time = 0; + mp3.MetaData.url = url; + if (url[0] != '#') addToPlaylist(mp3); } -void CAudioPlayerGui::processPlaylistUrl(const char *url, const char *name, const time_t tim) +void CAudioPlayerGui::processPlaylistUrl(const char *url, const char *name, const char *logo, const time_t tim) { CURL *curl_handle; struct MemoryStruct chunk; @@ -1079,8 +1118,7 @@ void CAudioPlayerGui::processPlaylistUrl(const char *url, const char *name, cons /* we pass our 'chunk' struct to the callback function */ curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&chunk); - /* some servers don't like requests that are made without a user-agent - field, so we provide one */ + /* some servers don't like requests that are made without a user-agent field, so we provide one */ curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libcurl-agent/1.0"); /* don't use signal for timeout */ @@ -1093,15 +1131,15 @@ void CAudioPlayerGui::processPlaylistUrl(const char *url, const char *name, cons curl_easy_perform(curl_handle); /* - * Now, our chunk.memory points to a memory block that is chunk.size - * bytes big and contains the remote file. - * - * Do something nice with it! - * - * You should be aware of the fact that at this point we might have an - * allocated data block, and nothing has yet deallocated that data. So when - * you're done with it, you should free() it as a nice application. - */ + Now, our chunk.memory points to a memory block that is chunk.size + bytes big and contains the remote file. + + Do something nice with it! + + You should be aware of the fact that at this point we might have an + allocated data block, and nothing has yet deallocated that data. So when + you're done with it, you should free() it as a nice application. + */ long res_code; if (curl_easy_getinfo(curl_handle, CURLINFO_HTTP_CODE/*CURLINFO_RESPONSE_CODE*/, &res_code) == CURLE_OK) @@ -1134,7 +1172,7 @@ void CAudioPlayerGui::processPlaylistUrl(const char *url, const char *name, cons tmp = strchr(line, '\n'); if (tmp != NULL) *tmp = '\0'; - addUrl2Playlist(ptr, name, tim); + addUrl2Playlist(ptr, name, logo, tim); break; } } @@ -1192,7 +1230,7 @@ void CAudioPlayerGui::readDir_ic(void) { xmlDocPtr answer_parser = parseXml(answer.c_str()); scanBox->hide(); - scanXmlData(answer_parser, "listen_url", "server_name", "bitrate", true); + scanXmlData(answer_parser, "listen_url", "server_name", "", "bitrate", true); } else scanBox->hide(); @@ -1203,10 +1241,10 @@ void CAudioPlayerGui::readDir_ic(void) void CAudioPlayerGui::scanXmlFile(std::string filename) { xmlDocPtr answer_parser = parseXmlFile(filename.c_str()); - scanXmlData(answer_parser, "url", "name"); + scanXmlData(answer_parser, "url", "name", "logo"); } -void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *urltag, const char *nametag, const char *bitratetag, bool usechild) +void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *urltag, const char *nametag, const char *logotag, const char *bitratetag, bool usechild) { #define IC_typetag "server_type" @@ -1241,6 +1279,8 @@ void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *urltag, c const char *ptr = NULL; const char *name = NULL; const char *url = NULL; + const char *logo = NULL; + time_t bitrate = 0; bool skip = true; listPos++; @@ -1258,10 +1298,12 @@ void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *urltag, c xmlNodePtr child = xmlChildrenNode(element); while (child) { - if (strcmp(xmlGetName(child), nametag) == 0) - name = xmlGetData(child); - else if (strcmp(xmlGetName(child), urltag) == 0) + if (strcmp(xmlGetName(child), urltag) == 0) url = xmlGetData(child); + else if (strcmp(xmlGetName(child), nametag) == 0) + name = xmlGetData(child); + else if (strcmp(xmlGetName(child), logotag) == 0) + logo = xmlGetData(child); else if (strcmp(xmlGetName(child), IC_typetag) == 0) type = xmlGetData(child); else if (bitratetag && strcmp(xmlGetName(child), bitratetag) == 0) @@ -1284,6 +1326,7 @@ void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *urltag, c { url = xmlGetAttribute(element, urltag); name = xmlGetAttribute(element, nametag); + logo = xmlGetAttribute(element, logotag); if (bitratetag) { ptr = xmlGetAttribute(element, bitratetag); @@ -1298,9 +1341,9 @@ void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *urltag, c progress.showStatusMessageUTF(url); //printf("Processing %s, %s\n", url, name); if (strstr(url, ".m3u") || strstr(url, ".pls")) - processPlaylistUrl(url, name); + processPlaylistUrl(url, name, logo); else - addUrl2Playlist(url, name, bitrate); + addUrl2Playlist(url, name, logo, bitrate); } element = xmlNextNode(element); g_RCInput->getMsg(&msg, &data, 0); @@ -1357,7 +1400,7 @@ bool CAudioPlayerGui::openFilebrowser(void) #endif // LCD_UPDATE } if ( - (files->getType() == CFile::FILE_CDR) + (files->getType() == CFile::FILE_CDR) || (files->getType() == CFile::FILE_OGG) || (files->getType() == CFile::FILE_MP3) || (files->getType() == CFile::FILE_WAV) @@ -1417,7 +1460,7 @@ bool CAudioPlayerGui::openFilebrowser(void) if (strstr(url, ".m3u") || strstr(url, ".pls")) processPlaylistUrl(url); else - addUrl2Playlist(url, name, duration); + addUrl2Playlist(url, name, NULL, duration); } else if ((url = strstr(cLine, "icy://")) != NULL) { @@ -1458,7 +1501,7 @@ bool CAudioPlayerGui::openFilebrowser(void) playlistItem.Name = filename; CFile::FileType fileType = playlistItem.getType(); if ( - fileType == CFile::FILE_CDR + fileType == CFile::FILE_CDR || fileType == CFile::FILE_MP3 || fileType == CFile::FILE_OGG || fileType == CFile::FILE_WAV @@ -1561,7 +1604,7 @@ bool CAudioPlayerGui::openSCbrowser(void) #endif // LCD_UPDATE } //printf("processPlaylistUrl(%s, %s)\n", files->Url.c_str(), files->Name.c_str()); - processPlaylistUrl(files->Url.c_str(), files->Name.c_str(), files->Time); + processPlaylistUrl(files->Url.c_str(), files->Name.c_str(), NULL, files->Time); g_RCInput->getMsg(&msg, &data, 0); } if (m_select_title_by_name) @@ -1798,7 +1841,7 @@ void CAudioPlayerGui::paintCover() if (cover_object) { cover_object->doPaintBg(false); - cover_object->SetTransparent(CFrameBuffer::TM_BLACK); +// cover_object->SetTransparent(CFrameBuffer::TM_BLACK); cover_object->setHeight(m_title_height - 2*OFFSET_INNER_SMALL, true); cover_object->paint(); @@ -1952,32 +1995,43 @@ void CAudioPlayerGui::paintDetailsLine(int pos) m_infobox->forceTextPaint(false); } - //title - std::string text_info = m_playlist[m_selected].MetaData.title; + // first line + std::string text_info(""); + getFileInfoToDisplay(text_info, m_playlist[m_selected]); - //date, genre - if (m_playlist[m_selected].MetaData.genre.empty()) - text_info = m_playlist[m_selected].MetaData.date; - else if (m_playlist[m_selected].MetaData.date.empty()) - text_info = m_playlist[m_selected].MetaData.genre; + text_info += "\n"; + + // second line; url or date and genre + if (m_inetmode) + { + if (!m_playlist[m_selected].MetaData.url.empty()) + { + text_info += m_playlist[m_selected].MetaData.url; + } + else + text_info += " "; + } else { - text_info = m_playlist[m_selected].MetaData.genre; - text_info += " / "; - text_info += m_playlist[m_selected].MetaData.date; - } + bool got_date = false; + if (!m_playlist[m_selected].MetaData.date.empty()) + { + got_date = true; + text_info += m_playlist[m_selected].MetaData.date; + } - //artist, album - text_info = m_playlist[m_selected].MetaData.artist; - if (!(m_playlist[m_selected].MetaData.album.empty())) - { - text_info += " ("; - text_info += m_playlist[m_selected].MetaData.album; - text_info += ')'; - } + bool got_genre = false; + if (!m_playlist[m_selected].MetaData.genre.empty()) + { + got_genre = true; + if (got_date) + text_info += " / "; + text_info += m_playlist[m_selected].MetaData.genre; + } - // 'simulate' a second line; maybe usefull for some more informations e.g. url or so - text_info += "\n "; + if (!got_date && !got_genre) + text_info += " "; + } m_infobox->setText(text_info, CTextBox::AUTO_WIDTH, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], COL_MENUCONTENTDARK_TEXT); m_infobox->paint(false); @@ -2280,13 +2334,13 @@ void CAudioPlayerGui::updateTimes(const bool force) int x_total_time = m_x + m_width - OFFSET_INNER_MID - w_total_time - 2*m_titlebox->getFrameThickness(); // played time offset to align this value on the right side int o_played_time = std::max(w_faked_time - w_played_time, 0); - int x_faked_time = m_x + m_width - OFFSET_INNER_MID - w_total_time - w_faked_time; + int x_faked_time = x_total_time - w_faked_time; int x_played_time = x_faked_time + o_played_time; int y_times = m_y + OFFSET_INNER_SMALL; if (updateTotal && !m_inetmode) { - m_frameBuffer->paintBoxRel(x_total_time, y_times, w_total_time + OFFSET_INNER_MID, m_item_height, m_titlebox->getColorBody()); + m_frameBuffer->paintBoxRel(x_total_time, y_times, w_total_time, m_item_height, m_titlebox->getColorBody()); if (m_time_total > 0) { g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_total_time, y_times + m_item_height, w_total_time, total_time, COL_MENUHEAD_TEXT); //total time @@ -2444,26 +2498,29 @@ void CAudioPlayerGui::getFileInfoToDisplay(std::string &fileInfo, CAudiofileExt if (g_settings.audioplayer_display == TITLE_ARTIST) { fileInfo += title; - if (!title.empty() && !artist.empty()) fileInfo += ", "; + if (!title.empty() && !artist.empty()) + fileInfo += " - "; fileInfo += artist; } else //if (g_settings.audioplayer_display == ARTIST_TITLE) { fileInfo += artist; - if (!title.empty() && !artist.empty()) fileInfo += ", "; + if (!title.empty() && !artist.empty()) + fileInfo += " - "; fileInfo += title; } if (!file.MetaData.album.empty()) { - fileInfo += " ("; + fileInfo += " - "; fileInfo += file.MetaData.album; - fileInfo += ')'; } + if (fileInfo.empty()) { fileInfo += "Unknown"; } + file.firstChar = (char)tolower(fileInfo[0]); //info += fileInfo; } @@ -2473,7 +2530,7 @@ void CAudioPlayerGui::addToPlaylist(CAudiofileExt &file) //printf("add2Playlist: %s\n", file.Filename.c_str()); if (m_select_title_by_name) { - std::string t = ""; + std::string t(""); getFileInfoToDisplay(t,file); } else @@ -2655,8 +2712,8 @@ unsigned char CAudioPlayerGui::getFirstChar(CAudiofileExt &file) { if (file.firstChar == '\0') { - std::string info; - getFileInfoToDisplay(info,file); + std::string info(""); + getFileInfoToDisplay(info, file); } //printf("getFirstChar: %c\n",file.firstChar); return file.firstChar; @@ -2766,7 +2823,7 @@ void CAudioPlayerGui::savePlaylist() snprintf(msg, msgsize, "%s\n%s", g_Locale->getText(LOCALE_AUDIOPLAYER_PLAYLIST_FILEERROR_MSG), - absPlaylistFilename.c_str()); + absPlaylistFilename.c_str()); DisplayErrorMessage(msg); // refresh view @@ -2798,14 +2855,13 @@ bool CAudioPlayerGui::askToOverwriteFile(const std::string& filename) snprintf(msg, filename.length() + 126, "%s\n%s", g_Locale->getText(LOCALE_AUDIOPLAYER_PLAYLIST_FILEOVERWRITE_MSG), - filename.c_str()); + filename.c_str()); bool res = (ShowMsg(LOCALE_AUDIOPLAYER_PLAYLIST_FILEOVERWRITE_TITLE, msg, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes); this->paint(); return res; } -std::string CAudioPlayerGui::absPath2Rel(const std::string& fromDir, - const std::string& absFilename) +std::string CAudioPlayerGui::absPath2Rel(const std::string& fromDir, const std::string& absFilename) { std::string res = ""; diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index cb0a07e22..e5c6f41c5 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -167,12 +167,12 @@ class CAudioPlayerGui : public CMenuTarget /** * Adds an url (shoutcast, ...) to the to the audioplayer playlist */ - void addUrl2Playlist(const char *url, const char *name = NULL, const time_t bitrate = 0); + void addUrl2Playlist(const char *url, const char *name = NULL, const char *logo = NULL, const time_t bitrate = 0); /** * Adds a url which points to an .m3u format (playlist, ...) to the audioplayer playlist */ - void processPlaylistUrl(const char *url, const char *name = NULL, const time_t bitrate = 0); + void processPlaylistUrl(const char *url, const char *name = NULL, const char *logo = NULL, const time_t bitrate = 0); /** * Loads a given XML file of internet audiostreams or playlists and processes them @@ -182,7 +182,7 @@ class CAudioPlayerGui : public CMenuTarget /** * Processes a loaded XML file/data of internet audiostreams or playlists */ - void scanXmlData(xmlDocPtr answer_parser, const char *urltag, const char *nametag, const char *bitratetag = NULL, bool usechild = false); + void scanXmlData(xmlDocPtr answer_parser, const char *urltag, const char *nametag, const char *logotag = "", const char *bitratetag = NULL, bool usechild = false); /** * Reads the icecast directory (XML file) and calls scanXmlData diff --git a/src/gui/audioplayer_setup.cpp b/src/gui/audioplayer_setup.cpp index e32437041..ba3178117 100644 --- a/src/gui/audioplayer_setup.cpp +++ b/src/gui/audioplayer_setup.cpp @@ -150,12 +150,12 @@ int CAudioPlayerSetup::showAudioPlayerSetup() audioplayerSetup->addItem(mf); audioplayerSetup->addItem(GenericMenuSeparatorLine); -#if 0 + // internetradio autostart first entry from favorites mc = new CMenuOptionChooser(LOCALE_INETRADIO_AUTOSTART, &g_settings.inetradio_autostart, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, NULL); - mc->setHint(NEUTRINO_ICON_HINT_IMAGELOGO, LOCALE_MENU_HINT_INETRADIO_AUTOSTART); + mc->setHint("", LOCALE_MENU_HINT_INET_RADIO_AUTOSTART); audioplayerSetup->addItem(mc); -#endif + mc = new CMenuOptionChooser(LOCALE_AUDIOPLAYER_ENABLE_SC_METADATA, &g_settings.audioplayer_enable_sc_metadata, MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_AUDIOPLAYER_SC_METADATA); audioplayerSetup->addItem(mc); diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 9904afd57..a1dac9633 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -47,6 +47,9 @@ #include extern cVideo * videoDecoder; + + + using namespace std; CScreenSaver::CScreenSaver() @@ -56,6 +59,7 @@ CScreenSaver::CScreenSaver() index = 0; status_mute = CAudioMute::getInstance()->getStatus(); + scr_clock = NULL; clr.i_color = COL_DARK_GRAY; pip_channel_id = 0; @@ -94,6 +98,9 @@ void CScreenSaver::Start() if(!CInfoClock::getInstance()->isBlocked()) CInfoClock::getInstance()->disableInfoClock(); + + + #ifdef ENABLE_PIP pip_channel_id = CZapit::getInstance()->GetPipChannelID(); if (pip_channel_id) @@ -135,6 +142,7 @@ void CScreenSaver::Stop() m_frameBuffer->paintBackground(); //clear entire screen + CAudioMute::getInstance()->enableMuteIcon(status_mute); if (!OnAfterStop.empty()){ OnAfterStop(); @@ -195,6 +203,8 @@ bool CScreenSaver::ReadDir() string d; if (show_audiocover) d = COVERDIR_TMP; + else + d = g_settings.screensaver_dir; if (d.length() > 1) { //remove trailing slash @@ -299,8 +309,7 @@ void CScreenSaver::paint() } else{ if (!scr_clock){ - scr_clock = new CComponentsFrmClock(1, 1, NULL, "%H:%M:%S", "%H:%M %S", true, - 1, NULL, CC_SHADOW_OFF, COL_BLACK, COL_BLACK); + scr_clock = new CComponentsFrmClock(1, 1, NULL, "%H:%M:%S", "%H:%M %S", true, 1, NULL, CC_SHADOW_OFF, COL_BLACK, COL_BLACK); scr_clock->setCornerType(CORNER_NONE); scr_clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]); scr_clock->disableSaveBg(); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index ec74306b8..7b07941d6 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -353,6 +353,9 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.theme_name = configfile.getString("theme_name", !access(NEUTRINO_SETTINGS_FILE, F_OK) ? MIGRATE_THEME_NAME : ""); CThemes::getInstance()->getTheme(configfile); + // internet radio + g_settings.inetradio_autostart = configfile.getInt32("inetradio_autostart" , 0); + g_settings.softupdate_autocheck = configfile.getBool("softupdate_autocheck" , false); // video @@ -1198,6 +1201,9 @@ void CNeutrinoApp::saveSetup(const char * fname) CThemes::getInstance()->setTheme(configfile); configfile.setString( "theme_name", g_settings.theme_name ); + //internet radio + configfile.setInt32("inetradio_autostart" , g_settings.inetradio_autostart); + //video configfile.setInt32( "video_Mode", g_settings.video_Mode ); configfile.setInt32( "analog_mode1", g_settings.analog_mode1 ); diff --git a/src/system/locals.h b/src/system/locals.h index 3bad78e9e..d0c53b9eb 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -185,6 +185,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, @@ -875,6 +876,7 @@ typedef enum LOCALE_IMDB_DATA_WRITER, LOCALE_IMDB_INFO, LOCALE_IMDB_INFO_SAVE, + LOCALE_INETRADIO_AUTOSTART, LOCALE_INETRADIO_NAME, LOCALE_INFOVIEWER_EPGNOTLOAD, LOCALE_INFOVIEWER_EPGWAIT, @@ -1163,6 +1165,7 @@ typedef enum LOCALE_MENU_HINT_INACTIVE_BACK, LOCALE_MENU_HINT_INACTIVE_TEXTCOLOR, LOCALE_MENU_HINT_INET_RADIO, + LOCALE_MENU_HINT_INET_RADIO_AUTOSTART, LOCALE_MENU_HINT_INFO, LOCALE_MENU_HINT_INFOBAR_BACK, LOCALE_MENU_HINT_INFOBAR_BUTTONS_USERTITLE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index d27b3ed10..59c24bfc8 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -185,6 +185,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", @@ -875,6 +876,7 @@ const char * locale_real_names[] = "imdb.data_writer", "imdb.info", "imdb.info_save", + "inetradio.autostart", "inetradio.name", "infoviewer.epgnotload", "infoviewer.epgwait", @@ -1163,6 +1165,7 @@ const char * locale_real_names[] = "menu.hint_inactive_back", "menu.hint_inactive_textcolor", "menu.hint_inet_radio", + "menu.hint_inet_radio_autostart", "menu.hint_info", "menu.hint_infobar_back", "menu.hint_infobar_buttons_usertitle", diff --git a/src/system/settings.h b/src/system/settings.h index fbb753857..b4a5dc85f 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -809,6 +809,8 @@ struct SNeutrinoSettings int audioplayer_enable_sc_metadata; int audioplayer_cover_as_screensaver; + int inetradio_autostart; + //Filebrowser int filebrowser_showrights; int filebrowser_sortmethod;