summaryrefslogtreecommitdiff
path: root/gtk2_ardour/interthread_progress_window.h
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-04-14 22:16:46 +0000
committerCarl Hetherington <carl@carlh.net>2010-04-14 22:16:46 +0000
commit3d3e889dd61d8e513f78257ac770eabc8afe050c (patch)
tree4ab6ac91926136c05d1d80518d1e56cc771b671b /gtk2_ardour/interthread_progress_window.h
parent8783fc35f27b8583755d53d70efbf6cece27ca29 (diff)
Separate interthread progress window out into its own class and HIG-ify it a bit. Make the import progress bar report on the whole import rather than individual files.
git-svn-id: svn://localhost/ardour2/branches/3.0@6894 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/interthread_progress_window.h')
-rw-r--r--gtk2_ardour/interthread_progress_window.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/gtk2_ardour/interthread_progress_window.h b/gtk2_ardour/interthread_progress_window.h
new file mode 100644
index 0000000000..6c7f0f5bd5
--- /dev/null
+++ b/gtk2_ardour/interthread_progress_window.h
@@ -0,0 +1,69 @@
+/*
+ Copyright (C) 2010 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
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef __ardour_interthread_progress_window_h__
+#define __ardour_interthread_progress_window_h__
+
+#include <gtkmm/label.h>
+#include <gtkmm/progressbar.h>
+#include "ardour_dialog.h"
+
+namespace ARDOUR {
+ class InterThreadInfo;
+ class ImportStatus;
+}
+
+/** A progress dialogue which gets its status from an
+ * ARDOUR::InterThreadInfo struct. Displays a progress bar, which is
+ * automagically updated using a Glib timer, and a cancel button.
+ */
+
+class InterthreadProgressWindow : public ArdourDialog
+{
+public:
+ InterthreadProgressWindow (ARDOUR::InterThreadInfo *, std::string const &, std::string const &);
+
+protected:
+
+ virtual bool update ();
+
+ Gtk::Button _cancel_button;
+ Gtk::Label _cancel_label;
+ Gtk::ProgressBar _bar;
+
+private:
+ void cancel_clicked ();
+
+ ARDOUR::InterThreadInfo* _interthread_info;
+};
+
+/** Progress dialogue for importing sound files */
+class ImportProgressWindow : public InterthreadProgressWindow
+{
+public:
+ ImportProgressWindow (ARDOUR::ImportStatus *, std::string const &, std::string const &);
+
+private:
+ bool update ();
+
+ Gtk::Label _label;
+ ARDOUR::ImportStatus* _import_status;
+};
+
+#endif