Tone down canvas colours considerably, only use really meaningful colours on track...
[ardour.git] / gtk2_ardour / export_dialog.h
1 /*
2     Copyright (C) 2008 Paul Davis
3     Author: Sakari Bergen
4
5     This program is free software; you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation; either version 2 of the License, or
8     (at your option) any later version.
9
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14
15     You should have received a copy of the GNU General Public License
16     along with this program; if not, write to the Free Software
17     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19 */
20
21 #ifndef __export_dialog_h__
22 #define __export_dialog_h__
23
24 #include <boost/shared_ptr.hpp>
25
26 #include <ardour/export_handler.h>
27 #include <ardour/export_profile_manager.h>
28
29 #include "public_editor.h"
30 #include "export_timespan_selector.h"
31 #include "export_channel_selector.h"
32 #include "export_file_notebook.h"
33 #include "export_preset_selector.h"
34 #include "ardour_dialog.h"
35
36 #include <gtkmm.h>
37
38 #include "i18n.h"
39
40 namespace ARDOUR {
41         class ExportStatus;
42 }
43
44 class ExportTimespanSelector;
45 class ExportChannelSelector;
46
47 class ExportDialog : public ArdourDialog {
48
49   public:
50
51         explicit ExportDialog (PublicEditor & editor, Glib::ustring title = _("Export"));
52         ~ExportDialog ();
53         
54         void set_session (ARDOUR::Session* s);
55         
56         /* Responses */
57
58         enum Responses {
59                 RESPONSE_RT,
60                 RESPONSE_FAST,
61                 RESPONSE_CANCEL
62         };
63
64   protected:
65
66         // initializes GUI layout
67         virtual void init_gui ();
68
69         // Must initialize all the shared_ptrs below
70         virtual void init_components ();
71
72         boost::shared_ptr<ExportPresetSelector>   preset_selector;
73         boost::shared_ptr<ExportTimespanSelector> timespan_selector;
74         boost::shared_ptr<ExportChannelSelector>  channel_selector;
75         boost::shared_ptr<ExportFileNotebook>     file_notebook;
76         
77         Gtk::VBox                                 warning_widget;
78         Gtk::VBox                                 progress_widget;
79
80   private:
81
82         void init ();
83
84         void notify_errors ();
85         void close_dialog ();
86         
87         void sync_with_manager ();
88         void update_warnings ();
89         void show_conflicting_files ();
90
91         void export_rt ();
92         void export_fw ();
93         
94         void show_progress ();
95         gint progress_timeout ();
96         
97         typedef boost::shared_ptr<ARDOUR::ExportHandler> HandlerPtr;
98         typedef boost::shared_ptr<ARDOUR::ExportProfileManager> ManagerPtr;
99         typedef boost::shared_ptr<ARDOUR::ExportStatus> StatusPtr;
100         
101         PublicEditor &  editor;
102         HandlerPtr      handler;
103         ManagerPtr      profile_manager;
104         StatusPtr       status;
105         
106         /*** GUI components ***/
107         
108         /* Warning area */
109         
110         Gtk::HBox           warn_hbox;
111         Gtk::Label          warn_label;
112         Glib::ustring       warn_string;
113         
114         Gtk::HBox           list_files_hbox;
115         Gtk::Label          list_files_label;
116         Gtk::Button         list_files_button;
117         Glib::ustring       list_files_string;
118         
119         void add_error (Glib::ustring const & text);
120         void add_warning (Glib::ustring const & text);
121         
122         /* Progress bar */
123         
124         Gtk::Label              progress_label;
125         Gtk::ProgressBar        progress_bar;
126         sigc::connection        progress_connection;
127         
128         /* Buttons */
129         
130         Gtk::Button *           cancel_button;
131         Gtk::Button *           rt_export_button;
132         Gtk::Button *           fast_export_button;
133
134 };
135
136 class ExportRangeDialog : public ExportDialog
137 {
138   public:
139         ExportRangeDialog (PublicEditor & editor, Glib::ustring range_id);
140
141   private:
142         void init_components ();
143         
144         Glib::ustring range_id;
145 };
146
147 class ExportSelectionDialog : public ExportDialog
148 {
149   public:
150         ExportSelectionDialog (PublicEditor & editor);
151
152   private:
153         void init_components ();
154 };
155
156 #endif /* __ardour_export_dialog_h__ */