summaryrefslogtreecommitdiff
path: root/gtk2_ardour/sfdb_freesound_mootcher.h
diff options
context:
space:
mode:
authorColin Fletcher <colin.m.fletcher@googlemail.com>2013-06-16 15:43:43 +0100
committerColin Fletcher <colin.m.fletcher@googlemail.com>2013-06-21 21:30:52 +0100
commit8ad4924b7f6d12037753e0a93b5f861b443614ae (patch)
treec42f03fc81fe5cb9090f3cd80d5dad1de28b2f1c /gtk2_ardour/sfdb_freesound_mootcher.h
parent0483803186c83e27db708f77189a4dc9974f1712 (diff)
Use connect(..., gui_thread()) rather than g_idle_add().
Use the proper functions to ensure things happen in the main gui thread, instead of fudging around with g_idle_add().
Diffstat (limited to 'gtk2_ardour/sfdb_freesound_mootcher.h')
-rw-r--r--gtk2_ardour/sfdb_freesound_mootcher.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/gtk2_ardour/sfdb_freesound_mootcher.h b/gtk2_ardour/sfdb_freesound_mootcher.h
index ee65020021..48fb11b638 100644
--- a/gtk2_ardour/sfdb_freesound_mootcher.h
+++ b/gtk2_ardour/sfdb_freesound_mootcher.h
@@ -65,7 +65,7 @@ enum sortMethod {
};
-class Mootcher
+class Mootcher: public sigc::trackable, public PBD::ScopedConnectionList
{
public:
Mootcher();
@@ -80,6 +80,14 @@ public:
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();
@@ -97,6 +105,9 @@ private:
FILE* theFile;
+ void updateProgress(double dlnow, double dltotal);
+ void doneWithMootcher();
+
Gtk::HBox progress_hbox;
Gtk::ProgressBar progress_bar;
Gtk::Button cancel_download_btn;