Vkeybd: use ArdourWidgets for all GUI elements
[ardour.git] / gtk2_ardour / interthread_progress_window.h
1 /*
2  * Copyright (C) 2010 Carl Hetherington <carl@carlh.net>
3  * Copyright (C) 2011 David Robillard <d@drobilla.net>
4  * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20
21 #ifndef __ardour_interthread_progress_window_h__
22 #define __ardour_interthread_progress_window_h__
23
24 #include <gtkmm/label.h>
25 #include <gtkmm/progressbar.h>
26 #include "ardour_dialog.h"
27
28 namespace ARDOUR {
29         class InterThreadInfo;
30         class ImportStatus;
31 }
32
33 /** A progress dialogue which gets its status from an
34  *  ARDOUR::InterThreadInfo struct.  Displays a progress bar, which is
35  *  automagically updated using a Glib timer, and a cancel button.
36  */
37
38 class InterthreadProgressWindow : public ArdourDialog
39 {
40 public:
41         InterthreadProgressWindow (ARDOUR::InterThreadInfo *, std::string const &, std::string const &);
42
43 protected:
44
45         virtual bool update ();
46         virtual void on_hide ();
47
48         Gtk::Button _cancel_button;
49         Gtk::Label _cancel_label;
50         Gtk::ProgressBar _bar;
51
52 private:
53         void cancel_clicked ();
54
55         ARDOUR::InterThreadInfo* _interthread_info;
56 };
57
58 /** Progress dialogue for importing sound files */
59 class ImportProgressWindow : public InterthreadProgressWindow
60 {
61 public:
62         ImportProgressWindow (ARDOUR::ImportStatus *, std::string const &, std::string const &);
63
64 private:
65         bool update ();
66
67         Gtk::Label _label;
68         ARDOUR::ImportStatus* _import_status;
69 };
70
71 #endif