X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fsfdb_freesound_mootcher.cc;h=5f1711d3c8c67a679a61bb0787310bf4ba09618a;hb=5f4bdb233a53932986e07fca1cd6c87d22c2886f;hp=7daecfc5935f10a740518e04bb76d3f4740aa664;hpb=c944de1d3e23077abd5bbd5b6432df74c0d8fefa;p=ardour.git diff --git a/gtk2_ardour/sfdb_freesound_mootcher.cc b/gtk2_ardour/sfdb_freesound_mootcher.cc index 7daecfc593..5f1711d3c8 100644 --- a/gtk2_ardour/sfdb_freesound_mootcher.cc +++ b/gtk2_ardour/sfdb_freesound_mootcher.cc @@ -39,12 +39,12 @@ *************************************************************************************/ #include "sfdb_freesound_mootcher.h" -#include +#include "pbd/xml++.h" #include #include -#include +#include "ardour/audio_library.h" #define TRUE 1 @@ -221,6 +221,28 @@ std::string Mootcher::searchText(std::string word) postMessage += tempPointer; sprintf( tempPointer, "&searchtags=1"); postMessage += tempPointer; + + // Ref: http://www.freesound.org/forum/viewtopic.php?p=19081 + // const ORDER_DEFAULT = 0; + // const ORDER_DOWNLOADS_DESC = 1; + // const ORDER_DOWNLOADS_ASC = 2; + // const ORDER_USERNAME_DESC = 3; + // const ORDER_USERNAME_ASC = 4; + // const ORDER_DATE_DESC = 5; + // const ORDER_DATE_ASC = 6; + // const ORDER_DURATION_DESC = 7; + // const ORDER_DURATION_ASC = 8; + // const ORDER_FILEFORMAT_DESC = 9; + // const ORDER_FILEFORMAT_ASC = 10; + sprintf( tempPointer, "&order=1"); + postMessage += tempPointer; + sprintf( tempPointer, "&start=0"); + postMessage += tempPointer; + sprintf( tempPointer, "&limit=10"); + postMessage += tempPointer; + // The limit of 10 samples is arbitrary, but seems + // reasonable in light of the fact that all of the returned + // samples get downloaded, and downloads are s-l-o-w. if(curl) { @@ -383,7 +405,7 @@ std::string Mootcher::getXmlFile(std::string ID, int &length) if (tags) { XMLNodeList children = tags->children(); XMLNodeConstIterator niter; - vector strings; + std::vector strings; for (niter = children.begin(); niter != children.end(); ++niter) { XMLNode *node = *niter; if( strcmp( node->name().c_str(), "tag") == 0 ) { @@ -391,7 +413,7 @@ std::string Mootcher::getXmlFile(std::string ID, int &length) if (text) strings.push_back(text->content()); } } - ARDOUR::Library->set_tags (string("//")+filename, strings); + ARDOUR::Library->set_tags (std::string("//")+filename, strings); ARDOUR::Library->save_changes (); } }