From 875fc958f7183d15048d444d34b599741d9ea91f Mon Sep 17 00:00:00 2001 From: striper Date: Wed, 2 Feb 2011 18:51:58 +0000 Subject: [PATCH] - update shoutcast API to Version 2.0 and disable shoutcast menu entry until cs-tech gets a proper shoutcast dev-id git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1104 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/audioplayer.cpp | 11 +++++------ src/gui/filebrowser.cpp | 8 ++++---- src/gui/filebrowser.h | 12 ++++++++++++ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 2d7c9fc21..f51f4b733 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -681,11 +681,11 @@ int CAudioPlayerGui::show() LOCALE_AUDIOPLAYER_ADD_LOC, true, NULL, InetRadioInputChanger, cnt, CRCInput::convertDigitToKey(count + 1)), old_select == count); - sprintf(cnt, "%d", ++count); +/* sprintf(cnt, "%d", ++count); InputSelector.addItem(new CMenuForwarder( LOCALE_AUDIOPLAYER_ADD_SC, true, NULL, InetRadioInputChanger, cnt, CRCInput::convertDigitToKey(count + 1)), old_select == count); - +*/ sprintf(cnt, "%d", ++count); InputSelector.addItem(new CMenuForwarder( LOCALE_AUDIOPLAYER_ADD_IC, true, NULL, InetRadioInputChanger, @@ -703,9 +703,9 @@ int CAudioPlayerGui::show() paintLCD(); break; case 1: - openSCbrowser(); +/* openSCbrowser(); break; - case 2: + case 2:*/ readDir_ic(); CVFD::getInstance()->setMode(CVFD::MODE_AUDIO); paintLCD(); @@ -1392,8 +1392,7 @@ bool CAudioPlayerGui::openFilebrowser(void) } //------------------------------------------------------------------------ -#define SC_BASE_DIR "http://www.shoutcast.com" -#define SC_INIT_DIR "/sbin/newxml.phtml" + bool CAudioPlayerGui::openSCbrowser(void) { bool result = false; diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 87c432a64..635fdb65e 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -708,7 +708,7 @@ printf("CFileBrowser::readDir_sc: read done, size %d\n", answer.size()); CFile file; file.Mode = S_IFDIR + 0777 ; file.Name = " Top500"; // use space to have it at the beginning of the list - file.Url = "/sbin/newxml.phtml?genre=Top500"; + file.Url = SC_GET_TOP500; file.Size = 0; file.Time = 0; flist->push_back(file); @@ -716,7 +716,7 @@ printf("CFileBrowser::readDir_sc: read done, size %d\n", answer.size()); CFile file2; file2.Mode = S_IFDIR + 0777 ; file2.Name = ".."; - file2.Url = "/sbin/newxml.phtml"; + file2.Url = SC_INIT_DIR; file2.Size = 0; file2.Time = 0; flist->push_back(file2); @@ -726,7 +726,7 @@ printf("CFileBrowser::readDir_sc: read done, size %d\n", answer.size()); if (xml_decode == 1) { file.Mode = S_IFDIR + 0777 ; file.Name = xmlGetAttribute(element, "name"); - file.Url = "/sbin/newxml.phtml?genre=" + file.Name; + file.Url = (std::string)SC_GET_GENRE + file.Name; file.Size = 0; file.Time = 0; flist->push_back(file); @@ -743,7 +743,7 @@ printf("CFileBrowser::readDir_sc: read done, size %d\n", answer.size()); if (ptr && (strcmp(ptr, "audio/mpeg")==0)) { file.Mode = S_IFREG + 0777 ; file.Name = xmlGetAttribute(element, "name"); - file.Url = base + tunein_base + (std::string)"?id=" + xmlGetAttribute(element, "id"); + file.Url = (std::string)SC_TUNE_IN_BASE + tunein_base + (std::string)"?id=" + xmlGetAttribute(element, "id") + (std::string)"&k=" + SC_DEV_ID; //printf("adding %s (%s)\n", file.Name.c_str(), file.Url.c_str()); ptr = xmlGetAttribute(element, "br"); if (ptr) { diff --git a/src/gui/filebrowser.h b/src/gui/filebrowser.h index 1ea43ee8a..fe448418c 100644 --- a/src/gui/filebrowser.h +++ b/src/gui/filebrowser.h @@ -56,6 +56,18 @@ #define ENABLE_INTERNETRADIO #define VLC_URI "vlc://" +#if 0 +#define SC_BASE_DIR "http://www.shoutcast.com" +#define SC_INIT_DIR "/sbin/newxml.phtml" +#else +#define SC_DEV_ID "XXXXXXXXXXXXXXXX" +#define SC_BASE_DIR "http://api.shoutcast.com" +#define SC_TUNE_IN_BASE "http://yp.shoutcast.com" +#define SC_INIT_DIR "/legacy/genrelist?k="SC_DEV_ID +#define SC_GET_GENRE "/legacy/stationsearch?k="SC_DEV_ID"&search=" +#define SC_GET_TOP500 "/legacy/Top500?k="SC_DEV_ID +#endif + bool chooserDir(std::string &setting_dir, bool test_dir, const char *action_str); bool chooserDir(char *setting_dir, bool test_dir, const char *action_str, size_t str_leng);