Ardour  9.0-pre0-582-g084a23a80d
Mootcher Class Reference

#include <sfdb_freesound_mootcher.h>

Inheritance diagram for Mootcher:
[legend]

Public Member Functions

 Mootcher (const std::string &token)
 
 ~Mootcher ()
 
bool checkAudioFile (std::string originalFileName, std::string ID)
 
bool fetchAudioFile (std::string originalFileName, std::string ID, std::string audioURL, SoundFileBrowser *caller, std::string &token)
 
std::string searchText (std::string query, int page, std::string filter, enum sortMethod sort)
 
std::string searchSimilar (std::string id)
 
void * threadFunc ()
 
- Public Member Functions inherited from PBD::ScopedConnectionList
 ScopedConnectionList ()
 
 ScopedConnectionList (const ScopedConnectionList &)=delete
 
ScopedConnectionListoperator= (const ScopedConnectionList &)=delete
 
virtual ~ScopedConnectionList ()
 
void add_connection (const UnscopedConnection &c)
 
void drop_connections ()
 

Public Attributes

SoundFileBrowsersfb
 
std::string audioFileName
 
std::string ID
 
PBD::Signal< void(double, double)> Progress
 
PBD::Signal< void()> Finished
 

Private Member Functions

void ensureWorkingDir ()
 
bool get_oauth_token ()
 
std::string auth_code_to_oauth_token (const std::string &auth_code)
 
std::string doRequest (std::string uri, std::string params)
 
void setcUrlOptions ()
 
std::string sortMethodString (enum sortMethod sort)
 
std::string getSoundResourceFile (std::string ID)
 
void updateProgress (double dlnow, double dltotal)
 
void doneWithMootcher ()
 
void report_login_error (const std::string &msg)
 
void cancelDownload ()
 

Static Private Member Functions

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)
 

Private Attributes

CURL * curl
 
char errorBuffer [CURL_ERROR_SIZE]
 
FILE * theFile
 
Gtk::HBox progress_hbox
 
Gtk::ProgressBar progress_bar
 
Gtk::Button cancel_download_btn
 
bool cancel_download
 
std::string basePath
 
std::string xmlLocation
 
std::string oauth_token
 
struct curl_slist * custom_headers
 

Detailed Description

Definition at line 71 of file sfdb_freesound_mootcher.h.

Constructor & Destructor Documentation

◆ Mootcher()

Mootcher::Mootcher ( const std::string &  token)

◆ ~Mootcher()

Mootcher::~Mootcher ( )

Member Function Documentation

◆ auth_code_to_oauth_token()

std::string Mootcher::auth_code_to_oauth_token ( const std::string &  auth_code)
private

◆ cancelDownload()

void Mootcher::cancelDownload ( )
inlineprivate

Definition at line 122 of file sfdb_freesound_mootcher.h.

◆ checkAudioFile()

bool Mootcher::checkAudioFile ( std::string  originalFileName,
std::string  ID 
)

◆ doneWithMootcher()

void Mootcher::doneWithMootcher ( )
private

◆ doRequest()

std::string Mootcher::doRequest ( std::string  uri,
std::string  params 
)
private

◆ ensureWorkingDir()

void Mootcher::ensureWorkingDir ( )
private

◆ fetchAudioFile()

bool Mootcher::fetchAudioFile ( std::string  originalFileName,
std::string  ID,
std::string  audioURL,
SoundFileBrowser caller,
std::string &  token 
)

◆ get_oauth_token()

bool Mootcher::get_oauth_token ( )
private

◆ getSoundResourceFile()

std::string Mootcher::getSoundResourceFile ( std::string  ID)
private

◆ progress_callback()

static int Mootcher::progress_callback ( void *  clientp,
double  dltotal,
double  dlnow,
double  ultotal,
double  ulnow 
)
staticprivate

◆ report_login_error()

void Mootcher::report_login_error ( const std::string &  msg)
private

◆ searchSimilar()

std::string Mootcher::searchSimilar ( std::string  id)

◆ searchText()

std::string Mootcher::searchText ( std::string  query,
int  page,
std::string  filter,
enum sortMethod  sort 
)

◆ setcUrlOptions()

void Mootcher::setcUrlOptions ( )
private

◆ sortMethodString()

std::string Mootcher::sortMethodString ( enum sortMethod  sort)
private

◆ threadFunc()

void* Mootcher::threadFunc ( )

◆ updateProgress()

void Mootcher::updateProgress ( double  dlnow,
double  dltotal 
)
private

◆ WriteMemoryCallback()

static size_t Mootcher::WriteMemoryCallback ( void *  ptr,
size_t  size,
size_t  nmemb,
void *  data 
)
staticprivate

Member Data Documentation

◆ audioFileName

std::string Mootcher::audioFileName

Definition at line 83 of file sfdb_freesound_mootcher.h.

◆ basePath

std::string Mootcher::basePath
private

Definition at line 127 of file sfdb_freesound_mootcher.h.

◆ cancel_download

bool Mootcher::cancel_download
private

Definition at line 121 of file sfdb_freesound_mootcher.h.

◆ cancel_download_btn

Gtk::Button Mootcher::cancel_download_btn
private

Definition at line 119 of file sfdb_freesound_mootcher.h.

◆ curl

CURL* Mootcher::curl
private

Definition at line 108 of file sfdb_freesound_mootcher.h.

◆ custom_headers

struct curl_slist* Mootcher::custom_headers
private

Definition at line 130 of file sfdb_freesound_mootcher.h.

◆ errorBuffer

char Mootcher::errorBuffer[CURL_ERROR_SIZE]
private

Definition at line 109 of file sfdb_freesound_mootcher.h.

◆ Finished

PBD::Signal<void()> Mootcher::Finished

signal emitted when the mootcher has finished downloading.

Definition at line 91 of file sfdb_freesound_mootcher.h.

◆ ID

std::string Mootcher::ID

Definition at line 84 of file sfdb_freesound_mootcher.h.

◆ oauth_token

std::string Mootcher::oauth_token
private

Definition at line 129 of file sfdb_freesound_mootcher.h.

◆ Progress

PBD::Signal<void(double, double)> Mootcher::Progress

signal emitted when mootcher reports progress updates during download. The parameters are current and total numbers of bytes downloaded.

Definition at line 89 of file sfdb_freesound_mootcher.h.

◆ progress_bar

Gtk::ProgressBar Mootcher::progress_bar
private

Definition at line 118 of file sfdb_freesound_mootcher.h.

◆ progress_hbox

Gtk::HBox Mootcher::progress_hbox
private

Definition at line 117 of file sfdb_freesound_mootcher.h.

◆ sfb

SoundFileBrowser* Mootcher::sfb

Definition at line 82 of file sfdb_freesound_mootcher.h.

◆ theFile

FILE* Mootcher::theFile
private

Definition at line 111 of file sfdb_freesound_mootcher.h.

◆ xmlLocation

std::string Mootcher::xmlLocation
private

Definition at line 128 of file sfdb_freesound_mootcher.h.


The documentation for this class was generated from the following file: