mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
merge 3.0 from 2.0-ongoing@3243
git-svn-id: svn://localhost/ardour2/branches/3.0@3248 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
9aa8af5a28
commit
cb41314642
100 changed files with 17534 additions and 4036 deletions
78
gtk2_ardour/sfdb_freesound_mootcher.h
Normal file
78
gtk2_ardour/sfdb_freesound_mootcher.h
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
/*sfdb_freesound_mootcher.h****************************************************************************
|
||||
|
||||
Adapted for Ardour by Ben Loftis, March 2008
|
||||
|
||||
Mootcher Online Access to thefreesoundproject website
|
||||
http://freesound.iua.upf.edu/
|
||||
|
||||
GPL 2005 Jorn Lemon
|
||||
mail for questions/remarks: mootcher@twistedlemon.nl
|
||||
or go to the freesound website forum
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
//#include <ctime>
|
||||
|
||||
#include "curl/curl.h"
|
||||
|
||||
|
||||
// mootcher version
|
||||
#define ___VERSION___ 1.3
|
||||
|
||||
//--- struct to store XML file
|
||||
struct MemoryStruct {
|
||||
char *memory;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
//--- for download process viewing
|
||||
struct dlprocess {
|
||||
double dltotalMoo;
|
||||
double dlnowMoo;
|
||||
};
|
||||
|
||||
class Mootcher
|
||||
{
|
||||
public:
|
||||
Mootcher(const char *saveLocation);
|
||||
~Mootcher();
|
||||
|
||||
int doLogin(std::string login, std::string password);
|
||||
std::string getFile(std::string ID);
|
||||
std::string searchText(std::string word);
|
||||
|
||||
|
||||
struct dlprocess bar;
|
||||
|
||||
private:
|
||||
|
||||
const char* changeWorkingDir(const char *saveLocation);
|
||||
|
||||
std::string getXmlFile(std::string ID, int &length);
|
||||
void GetXml(std::string ID, struct MemoryStruct &xml_page);
|
||||
std::string changeExtension(std::string filename);
|
||||
|
||||
void toLog(std::string input);
|
||||
|
||||
void setcUrlOptions();
|
||||
|
||||
static size_t WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data);
|
||||
static int progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);
|
||||
|
||||
CURL *curl;
|
||||
char errorBuffer[CURL_ERROR_SIZE]; // storage for cUrl error message
|
||||
|
||||
int connection; // is 0 if no connection
|
||||
char message[128]; // storage for messages that are send to the logfile
|
||||
|
||||
std::string basePath;
|
||||
std::string xmlLocation;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue