1 /*sfdb_freesound_mootcher.h****************************************************************************
\r
3 Adapted for Ardour by Ben Loftis, March 2008
\r
5 Mootcher Online Access to thefreesoundproject website
\r
6 http://freesound.iua.upf.edu/
\r
9 mail for questions/remarks: mootcher@twistedlemon.nl
\r
10 or go to the freesound website forum
\r
12 *****************************************************************************/
\r
24 #include "curl/curl.h"
\r
28 #define ___VERSION___ 1.3
\r
30 //--- struct to store XML file
\r
31 struct MemoryStruct {
\r
36 //--- for download process viewing
\r
45 Mootcher(const char *saveLocation);
\r
48 int doLogin(std::string login, std::string password);
\r
49 std::string getFile(std::string ID);
\r
50 std::string searchText(std::string word);
\r
53 struct dlprocess bar;
\r
57 const char* changeWorkingDir(const char *saveLocation);
\r
59 std::string getXmlFile(std::string ID, int &length);
\r
60 void GetXml(std::string ID, struct MemoryStruct &xml_page);
\r
61 std::string changeExtension(std::string filename);
\r
63 void toLog(std::string input);
\r
65 void setcUrlOptions();
\r
67 static size_t WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data);
\r
68 static int progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);
\r
71 char errorBuffer[CURL_ERROR_SIZE]; // storage for cUrl error message
\r
73 int connection; // is 0 if no connection
\r
74 char message[128]; // storage for messages that are send to the logfile
\r
76 std::string basePath;
\r
77 std::string xmlLocation;
\r