*************************************************************************************/\r
#include "sfdb_freesound_mootcher.h"\r
\r
-#include <pbd/xml++.h>\r
+#include "pbd/xml++.h"\r
\r
#include <sys/stat.h>\r
#include <sys/types.h>\r
\r
-#include <ardour/audio_library.h>\r
+#include "ardour/audio_library.h"\r
\r
#define TRUE 1\r
\r
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, -1);\r
\r
// the url to get\r
- std::string login_url = "http://freesound.iua.upf.edu/forum/login.php";\r
+ std::string login_url = "http://www.freesound.org/forum/login.php";\r
curl_easy_setopt(curl, CURLOPT_URL, login_url.c_str() );\r
\r
// perform online request\r
postMessage += tempPointer;\r
sprintf( tempPointer, "&searchtags=1");\r
postMessage += tempPointer;\r
+\r
+ // Ref: http://www.freesound.org/forum/viewtopic.php?p=19081\r
+ // const ORDER_DEFAULT = 0;\r
+ // const ORDER_DOWNLOADS_DESC = 1;\r
+ // const ORDER_DOWNLOADS_ASC = 2;\r
+ // const ORDER_USERNAME_DESC = 3;\r
+ // const ORDER_USERNAME_ASC = 4;\r
+ // const ORDER_DATE_DESC = 5;\r
+ // const ORDER_DATE_ASC = 6;\r
+ // const ORDER_DURATION_DESC = 7;\r
+ // const ORDER_DURATION_ASC = 8;\r
+ // const ORDER_FILEFORMAT_DESC = 9;\r
+ // const ORDER_FILEFORMAT_ASC = 10;\r
+ sprintf( tempPointer, "&order=1");\r
+ postMessage += tempPointer;\r
+ sprintf( tempPointer, "&start=0");\r
+ postMessage += tempPointer;\r
+ sprintf( tempPointer, "&limit=10");\r
+ postMessage += tempPointer;\r
+ // The limit of 10 samples is arbitrary, but seems\r
+ // reasonable in light of the fact that all of the returned\r
+ // samples get downloaded, and downloads are s-l-o-w.\r
\r
if(curl)\r
{\r
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, -1);\r
\r
// the url to get\r
- std::string search_url = "http://freesound.iua.upf.edu/searchTextXML.php";\r
+ std::string search_url = "http://www.freesound.org/searchTextXML.php";\r
curl_easy_setopt(curl, CURLOPT_URL, search_url.c_str());\r
\r
// perform the online search \r
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&xml_page);\r
\r
// URL to get\r
- std::string getxml_url = "http://freesound.iua.upf.edu/samplesViewSingleXML.php?id=";\r
+ std::string getxml_url = "http://www.freesound.org/samplesViewSingleXML.php?id=";\r
getxml_url += ID;\r
\r
curl_easy_setopt(curl, CURLOPT_URL, getxml_url.c_str() );\r
if (tags) {\r
XMLNodeList children = tags->children();\r
XMLNodeConstIterator niter;\r
- vector<string> strings;\r
+ std::vector<std::string> strings;\r
for (niter = children.begin(); niter != children.end(); ++niter) {\r
XMLNode *node = *niter;\r
if( strcmp( node->name().c_str(), "tag") == 0 ) {\r
if (text) strings.push_back(text->content());\r
}\r
}\r
- ARDOUR::Library->set_tags (string("//")+filename, strings);\r
+ ARDOUR::Library->set_tags (std::string("//")+filename, strings);\r
ARDOUR::Library->save_changes ();\r
}\r
}\r
\r
// create the download url, this url will also update the download statics on the site\r
std::string audioURL;\r
- audioURL += "http://freesound.iua.upf.edu/samplesDownload.php?id=";\r
+ audioURL += "http://www.freesound.org/samplesDownload.php?id=";\r
audioURL += ID;\r
\r
setcUrlOptions();\r