fix load+save of plugin parameter automation
[ardour.git] / gtk2_ardour / sfdb_freesound_mootcher.h
1 /*sfdb_freesound_mootcher.h****************************************************************************\r
2         \r
3         Adapted for Ardour by Ben Loftis, March 2008\r
4 \r
5         Mootcher Online Access to thefreesoundproject website\r
6         http://freesound.iua.upf.edu/\r
7 \r
8         GPL 2005 Jorn Lemon\r
9         mail for questions/remarks: mootcher@twistedlemon.nl\r
10         or go to the freesound website forum\r
11 \r
12 *****************************************************************************/\r
13 \r
14 #include <string>\r
15 #include <fstream>\r
16 #include <iostream>\r
17 #include <stdio.h>\r
18 #include <cstring>\r
19 #include <string>\r
20 #include <sstream>\r
21 #include <vector>\r
22 //#include <ctime>\r
23 \r
24 #include "curl/curl.h"\r
25 \r
26 \r
27 // mootcher version\r
28 #define ___VERSION___ 1.3\r
29 \r
30 //--- struct to store XML file \r
31 struct MemoryStruct {\r
32         char *memory;\r
33         size_t size;\r
34 };\r
35 \r
36 //--- for download process viewing\r
37 struct dlprocess {\r
38         double dltotalMoo;\r
39         double dlnowMoo;\r
40 };\r
41 \r
42 class Mootcher\r
43 {\r
44 public:\r
45         Mootcher(const char *saveLocation);\r
46         ~Mootcher();\r
47 \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
51 \r
52 \r
53         struct dlprocess bar;\r
54         \r
55 private:\r
56 \r
57         const char*     changeWorkingDir(const char *saveLocation);\r
58 \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
62 \r
63         void            toLog(std::string input);\r
64 \r
65         void            setcUrlOptions();\r
66 \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
69 \r
70         CURL *curl;\r
71         char errorBuffer[CURL_ERROR_SIZE];      // storage for cUrl error message\r
72 \r
73         int connection;         // is 0 if no connection\r
74         char message[128];      // storage for messages that are send to the logfile\r
75 \r
76         std::string basePath;\r
77         std::string xmlLocation;\r
78 };\r