/*
- Copyright (C) 2012 Paul Davis
+ Copyright (C) 2012 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*****************************************************************************/
#include <string>
-#include <fstream>
-#include <iostream>
#include <stdio.h>
#include <cstring>
#include <string>
};
-class Mootcher
+class Mootcher: public sigc::trackable, public PBD::ScopedConnectionList
{
public:
Mootcher();
std::string searchText(std::string query, int page, std::string filter, enum sortMethod sort);
std::string searchSimilar(std::string id);
void * threadFunc();
- SoundFileBrowser *sfb;
+ SoundFileBrowser *sfb;
std::string audioFileName;
std::string ID;
+ /** signal emitted when mootcher reports progress updates during download.
+ * The parameters are current and total numbers of bytes downloaded.
+ */
+ PBD::Signal2<void, double, double> Progress;
+ /** signal emitted when the mootcher has finished downloading. */
+ PBD::Signal0<void> Finished;
+
+
private:
void ensureWorkingDir();
FILE* theFile;
+ void updateProgress(double dlnow, double dltotal);
+ void doneWithMootcher();
+
Gtk::HBox progress_hbox;
Gtk::ProgressBar progress_bar;
Gtk::Button cancel_download_btn;
bool cancel_download;
- void cancelDownload() {
+ void cancelDownload() {
cancel_download = true;
progress_hbox.hide();
}