diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 0e62192ec..908ac3abe 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -200,6 +200,9 @@ audioplayer.select_title_by_name Titelsuche nach Name (SMS) audioplayer.show_playlist Playlist anzeigen audioplayer.shuffle Zufällig audioplayer.spectrum LCD Skala +audioplayer.streamripper_dir Streamripper-Verzeichnis +audioplayer.streamripper_start Streamripper starten +audioplayer.streamripper_stop Streamripper stoppen audioplayer.stop Stopp audioplayer.title_artist Titel, Interpret bookmarkmanager.delete Löschen @@ -1033,6 +1036,7 @@ menu.hint_audioplayer_order Ändern der Sortierreihenfolge der Wiedergabeliste menu.hint_audioplayer_playlist Aktiviert die Anzeige der Titel in der Wiedergabeliste menu.hint_audioplayer_repeat Aktiviert das Wiederholen der Wiedergabeliste, wenn das Ende erreicht ist menu.hint_audioplayer_sc_metadata Aktiviert das Anzeigen der Audio-Metadaten +menu.hint_audioplayer_streamripper_dir Wählen Sie das Aufnahmeverzeichnis für den Streamripper menu.hint_audioplayer_title Aktivieren Sie die Titelsuche (SMS-Stil) in der Playliste menu.hint_auto_lang Wählen Sie, ob automatisch ihre bevorzugte Tonspur ausgewählt wird, wenn sie vorhanden ist menu.hint_auto_subs Automatische Anzeige der Untertitel in Ihrer bevorzugten Sprache diff --git a/data/locale/english.locale b/data/locale/english.locale index 6cc46167f..07bd77549 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -200,6 +200,9 @@ audioplayer.select_title_by_name Search title by name (SMS) audioplayer.show_playlist Show playlist audioplayer.shuffle Shuffle audioplayer.spectrum LCD spectrum +audioplayer.streamripper_dir Streamripper directory +audioplayer.streamripper_start Start streamripper +audioplayer.streamripper_stop Stop streamripper audioplayer.stop Stop audioplayer.title_artist Title, artist bookmarkmanager.delete delete @@ -1033,6 +1036,7 @@ menu.hint_audioplayer_order Change playlist sort order menu.hint_audioplayer_playlist Show playlist items menu.hint_audioplayer_repeat Enable playlist repeat when end of list reached menu.hint_audioplayer_sc_metadata Enable streaming audio metadata parsing +menu.hint_audioplayer_streamripper_dir Default streamripper target directory menu.hint_audioplayer_title Enable SMS-style title search in playlist menu.hint_auto_lang Auto-switch audio to preferred language menu.hint_auto_subs Auto-start subtitles for preferred language diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 0b1f255e5..f683c3a2d 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -183,7 +183,7 @@ CAudioPlayerGui::~CAudioPlayerGui() delete m_titlebox; } -const struct button_label AudioPlayerButtons[][4] = +/*const*/ struct button_label AudioPlayerButtons[][4] = { { { NEUTRINO_ICON_BUTTON_STOP , LOCALE_AUDIOPLAYER_STOP }, @@ -216,6 +216,7 @@ const struct button_label AudioPlayerButtons[][4] = { { NEUTRINO_ICON_BUTTON_STOP , LOCALE_AUDIOPLAYER_STOP }, { NEUTRINO_ICON_BUTTON_PAUSE , LOCALE_AUDIOPLAYER_PAUSE }, + { NEUTRINO_ICON_BUTTON_RECORD_ACTIVE, LOCALE_AUDIOPLAYER_STREAMRIPPER_START }, }, { { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_ADD }, @@ -284,6 +285,9 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_cover.clear(); m_stationlogo = false; + m_streamripper_available = !find_executable("streamripper").empty() && !find_executable("streamripper.sh").empty(); + m_streamripper_active = false; + if (parent) parent->hide(); @@ -792,6 +796,32 @@ int CAudioPlayerGui::show() update = true; } } + else if (msg == (neutrino_msg_t) g_settings.key_record) + { + if (m_key_level == 1) + { + if (m_curr_audiofile.FileType == CFile::STREAM_AUDIO && m_streamripper_available) + { + if (m_streamripper_active) + { + ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_AUDIOPLAYER_STREAMRIPPER_STOP, HINTBOX_MIN_WIDTH, 2); + my_system(2, "streamripper.sh", "stop"); + m_streamripper_active = false; + } + else + { + ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_AUDIOPLAYER_STREAMRIPPER_START, HINTBOX_MIN_WIDTH, 2); + printf("streamripper.sh start \"%s\"\n", m_playlist[m_current].MetaData.url.c_str()); + puts("[audioplayer.cpp] executing streamripper"); + if (my_system(3, "streamripper.sh", "start", m_playlist[m_current].MetaData.url.c_str()) != 0) + perror("[audioplayer.cpp]: streamripper.sh failed\n"); + else + m_streamripper_active = true; + } + update = true; + } + } + } else if (CRCInput::isNumeric(msg) && !(m_playlist.empty())) { //numeric zap or SMS zap if (m_select_title_by_name) @@ -1681,7 +1711,18 @@ void CAudioPlayerGui::paintFoot() if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO) ::paintButtons(button_x, button_y, button_width, 4, AudioPlayerButtons[0], button_width, m_button_height); else - ::paintButtons(button_x, button_y, button_width, 2, AudioPlayerButtons[6], button_width, m_button_height); + { + int b = 2; + if (m_streamripper_available) + { + b = 3; + if (m_streamripper_active) + AudioPlayerButtons[6][2].locale = LOCALE_AUDIOPLAYER_STREAMRIPPER_STOP; + else + AudioPlayerButtons[6][2].locale = LOCALE_AUDIOPLAYER_STREAMRIPPER_START; + } + ::paintButtons(button_x, button_y, button_width, b, AudioPlayerButtons[6], button_width, m_button_height); + } } else // key_level == 2 { @@ -1960,6 +2001,13 @@ void CAudioPlayerGui::stop() CAudioPlayer::getInstance()->stop(); cleanupCovers(); + + if (m_streamripper_active) + { + ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_AUDIOPLAYER_STREAMRIPPER_STOP, HINTBOX_MIN_WIDTH, 2); + my_system(2, "streamripper.sh", "stop"); + m_streamripper_active = false; + } } void CAudioPlayerGui::pause() diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index e62aa1422..cb0a07e22 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -111,6 +111,8 @@ class CAudioPlayerGui : public CMenuTarget bool m_playlistHasChanged; std::string m_cover; bool m_stationlogo; + bool m_streamripper_available; + bool m_streamripper_active; CAudioPlayList m_playlist; CAudioPlayList m_radiolist; diff --git a/src/gui/audioplayer_setup.cpp b/src/gui/audioplayer_setup.cpp index ed10615c5..4066eb4af 100644 --- a/src/gui/audioplayer_setup.cpp +++ b/src/gui/audioplayer_setup.cpp @@ -80,6 +80,15 @@ int CAudioPlayerSetup::exec(CMenuTarget* parent, const std::string &actionKey) return res; } + if(actionKey == "streamripperdir") + { + CFileBrowser b; + b.Dir_Mode=true; + if (b.exec(g_settings.network_nfs_streamripperdir.c_str())) + g_settings.network_nfs_streamripperdir = b.getSelectedFile()->Name; + return res; + } + res = showAudioPlayerSetup(); return res; @@ -136,6 +145,10 @@ int CAudioPlayerSetup::showAudioPlayerSetup() mf->setHint("", LOCALE_MENU_HINT_AUDIOPLAYER_DEFDIR); audioplayerSetup->addItem(mf); + mf = new CMenuForwarder(LOCALE_AUDIOPLAYER_STREAMRIPPER_DIR, true, g_settings.network_nfs_streamripperdir, this, "streamripperdir"); + mf->setHint("", LOCALE_MENU_HINT_AUDIOPLAYER_STREAMRIPPER_DIR); + audioplayerSetup->addItem(mf); + 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/neutrino.cpp b/src/neutrino.cpp index 1a941fe0c..ec74306b8 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -616,6 +616,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.network_nfs[i].mac = configfile.getString("network_nfs_mac_" + i_str, "11:22:33:44:55:66"); } g_settings.network_nfs_audioplayerdir = configfile.getString( "network_nfs_audioplayerdir", "/media/sda1/music" ); + g_settings.network_nfs_streamripperdir = configfile.getString( "network_nfs_streamripperdir", "/media/sda1/music/streamripper" ); g_settings.network_nfs_picturedir = configfile.getString( "network_nfs_picturedir", "/media/sda1/pictures" ); g_settings.network_nfs_moviedir = configfile.getString( "network_nfs_moviedir", "/media/sda1/movies" ); g_settings.network_nfs_recordingdir = configfile.getString( "network_nfs_recordingdir", "/media/sda1/movies" ); @@ -917,6 +918,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.audioplayer_repeat_on = configfile.getInt32("audioplayer_repeat_on",0); g_settings.audioplayer_show_playlist = configfile.getInt32("audioplayer_show_playlist",1); g_settings.audioplayer_enable_sc_metadata = configfile.getInt32("audioplayer_enable_sc_metadata",1); + g_settings.audioplayer_cover_as_screensaver = configfile.getInt32("audioplayer_cover_as_screensaver",1); //Movie-Player g_settings.movieplayer_repeat_on = configfile.getInt32("movieplayer_repeat_on", CMoviePlayerGui::REPEAT_OFF); @@ -1406,6 +1408,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setString(cfg_key, g_settings.network_nfs[i].mac); } configfile.setString( "network_nfs_audioplayerdir", g_settings.network_nfs_audioplayerdir); + configfile.setString( "network_nfs_streamripperdir", g_settings.network_nfs_streamripperdir); configfile.setString( "network_nfs_picturedir", g_settings.network_nfs_picturedir); configfile.setString( "network_nfs_moviedir", g_settings.network_nfs_moviedir); configfile.setString( "network_nfs_recordingdir", g_settings.network_nfs_recordingdir); @@ -1599,6 +1602,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "audioplayer_repeat_on", g_settings.audioplayer_repeat_on ); configfile.setInt32( "audioplayer_show_playlist", g_settings.audioplayer_show_playlist ); configfile.setInt32( "audioplayer_enable_sc_metadata", g_settings.audioplayer_enable_sc_metadata ); + configfile.setInt32( "audioplayer_cover_as_screensaver", g_settings.audioplayer_cover_as_screensaver ); //Movie-Player configfile.setInt32( "movieplayer_repeat_on", g_settings.movieplayer_repeat_on ); diff --git a/src/system/locals.h b/src/system/locals.h index 74f91a5e6..12c174ce4 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -227,6 +227,9 @@ typedef enum LOCALE_AUDIOPLAYER_SHOW_PLAYLIST, LOCALE_AUDIOPLAYER_SHUFFLE, LOCALE_AUDIOPLAYER_SPECTRUM, + LOCALE_AUDIOPLAYER_STREAMRIPPER_DIR, + LOCALE_AUDIOPLAYER_STREAMRIPPER_START, + LOCALE_AUDIOPLAYER_STREAMRIPPER_STOP, LOCALE_AUDIOPLAYER_STOP, LOCALE_AUDIOPLAYER_TITLE_ARTIST, LOCALE_BOOKMARKMANAGER_DELETE, @@ -1060,6 +1063,7 @@ typedef enum LOCALE_MENU_HINT_AUDIOPLAYER_PLAYLIST, LOCALE_MENU_HINT_AUDIOPLAYER_REPEAT, LOCALE_MENU_HINT_AUDIOPLAYER_SC_METADATA, + LOCALE_MENU_HINT_AUDIOPLAYER_STREAMRIPPER_DIR, LOCALE_MENU_HINT_AUDIOPLAYER_TITLE, LOCALE_MENU_HINT_AUTO_LANG, LOCALE_MENU_HINT_AUTO_SUBS, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 85a5b7ad3..e7ea4042c 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -227,6 +227,9 @@ const char * locale_real_names[] = "audioplayer.show_playlist", "audioplayer.shuffle", "audioplayer.spectrum", + "audioplayer.streamripper_dir", + "audioplayer.streamripper_start", + "audioplayer.streamripper_stop", "audioplayer.stop", "audioplayer.title_artist", "bookmarkmanager.delete", @@ -1060,6 +1063,7 @@ const char * locale_real_names[] = "menu.hint_audioplayer_playlist", "menu.hint_audioplayer_repeat", "menu.hint_audioplayer_sc_metadata", + "menu.hint_audioplayer_streamripper_dir", "menu.hint_audioplayer_title", "menu.hint_auto_lang", "menu.hint_auto_subs", diff --git a/src/system/settings.h b/src/system/settings.h index 3491c21ed..fbb753857 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -481,6 +481,7 @@ struct SNeutrinoSettings std::string password; } network_nfs[NETWORK_NFS_NR_OF_ENTRIES]; std::string network_nfs_audioplayerdir; + std::string network_nfs_streamripperdir; std::string network_nfs_picturedir; std::string network_nfs_moviedir; std::string network_nfs_recordingdir; @@ -806,6 +807,7 @@ struct SNeutrinoSettings int audioplayer_repeat_on; int audioplayer_show_playlist; int audioplayer_enable_sc_metadata; + int audioplayer_cover_as_screensaver; //Filebrowser int filebrowser_showrights;