diff options
author | Colin Fletcher <colin.m.fletcher@googlemail.com> | 2013-06-14 19:17:24 +0100 |
---|---|---|
committer | Colin Fletcher <colin.m.fletcher@googlemail.com> | 2013-06-21 21:30:52 +0100 |
commit | 0483803186c83e27db708f77189a4dc9974f1712 (patch) | |
tree | 23554536a603008bce83b4bbe2ab3f94c417db39 /gtk2_ardour/sfdb_freesound_mootcher.h | |
parent | 1eff5a8215319c680ea511e90eba7fd5e4e66edd (diff) |
Further Freesound tweaks.
Make download of sound files multi-threaded. Each sound file download takes
place in its own thread, and has its own progress bar and cancel button,
which stack up from the bottom of the list of results.
Sound files download into a file with a '.part' suffix, which is then
renamed to the intended name on success.
Add a 'Similar' button, which searches Freesound for sounds similar to the
currently-selected sound in the results list.
Diffstat (limited to 'gtk2_ardour/sfdb_freesound_mootcher.h')
-rw-r--r-- | gtk2_ardour/sfdb_freesound_mootcher.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gtk2_ardour/sfdb_freesound_mootcher.h b/gtk2_ardour/sfdb_freesound_mootcher.h index 8956e349eb..ee65020021 100644 --- a/gtk2_ardour/sfdb_freesound_mootcher.h +++ b/gtk2_ardour/sfdb_freesound_mootcher.h @@ -71,8 +71,14 @@ public: Mootcher(); ~Mootcher(); - std::string getAudioFile(std::string originalFileName, std::string ID, std::string audioURL, SoundFileBrowser *caller); + bool checkAudioFile(std::string originalFileName, std::string ID); + bool fetchAudioFile(std::string originalFileName, std::string ID, std::string audioURL, SoundFileBrowser *caller); std::string searchText(std::string query, int page, std::string filter, enum sortMethod sort); + std::string searchSimilar(std::string id); + void * threadFunc(); + SoundFileBrowser *sfb; + std::string audioFileName; + std::string ID; private: @@ -89,6 +95,18 @@ private: CURL *curl; char errorBuffer[CURL_ERROR_SIZE]; // storage for cUrl error message + FILE* theFile; + + Gtk::HBox progress_hbox; + Gtk::ProgressBar progress_bar; + Gtk::Button cancel_download_btn; + + bool cancel_download; + void cancelDownload() { + cancel_download = true; + progress_hbox.hide(); + } + std::string basePath; std::string xmlLocation; }; |