NO-OP whitespace & foratting of header files
[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/scoped_ptr.hpp>
25 #include <string>
26
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 #include "soundcloud_export_selector.h"
36
37 #include <gtkmm.h>
38
39 namespace ARDOUR {
40         class ExportStatus;
41         class ExportHandler;
42 }
43
44 class ExportTimespanSelector;
45 class ExportChannelSelector;
46
47 class ExportDialog : public ArdourDialog, public PBD::ScopedConnectionList
48 {
49 public:
50
51         ExportDialog (PublicEditor & editor, std::string title, ARDOUR::ExportProfileManager::ExportType type);
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         void on_response (int response_id) {
67                 Gtk::Dialog::on_response (response_id);
68         }
69
70         typedef boost::shared_ptr<ARDOUR::ExportHandler> HandlerPtr;
71         typedef boost::shared_ptr<ARDOUR::ExportProfileManager> ManagerPtr;
72
73         ARDOUR::ExportProfileManager::ExportType type;
74         HandlerPtr      handler;
75         ManagerPtr      profile_manager;
76
77         // initializes GUI layout
78         virtual void init_gui ();
79
80         // Must initialize all the shared_ptrs below
81         virtual void init_components ();
82
83         boost::scoped_ptr<ExportPresetSelector>   preset_selector;
84         boost::scoped_ptr<ExportTimespanSelector> timespan_selector;
85         boost::scoped_ptr<ExportChannelSelector>  channel_selector;
86         boost::scoped_ptr<ExportFileNotebook>     file_notebook;
87
88         boost::shared_ptr<SoundcloudExportSelector> soundcloud_selector;
89
90         Gtk::VBox                                 warning_widget;
91         Gtk::VBox                                 progress_widget;
92
93         /*** GUI components ***/
94         Gtk::Notebook export_notebook;
95
96 private:
97
98         void init ();
99
100         void notify_errors (bool force = false);
101         void close_dialog ();
102
103         void sync_with_manager ();
104         void update_warnings_and_example_filename ();
105         void show_conflicting_files ();
106
107         void do_export ();
108
109         void update_realtime_selection ();
110         void parameter_changed (std::string const&);
111
112         void show_progress ();
113         gint progress_timeout ();
114
115         typedef boost::shared_ptr<ARDOUR::ExportStatus> StatusPtr;
116
117         PublicEditor &  editor;
118         StatusPtr       status;
119
120
121
122         /* Warning area */
123
124         Gtk::HBox           warn_hbox;
125         Gtk::Label          warn_label;
126         std::string         warn_string;
127
128         Gtk::HBox           list_files_hbox;
129         Gtk::Label          list_files_label;
130         Gtk::Button         list_files_button;
131         std::string         list_files_string;
132
133         void add_error (std::string const & text);
134         void add_warning (std::string const & text);
135
136         /* Progress bar */
137
138         Gtk::ProgressBar        progress_bar;
139         sigc::connection        progress_connection;
140
141         float previous_progress; // Needed for gtk bug workaround
142
143         void soundcloud_upload_progress(double total, double now, std::string title);
144
145         /* Buttons */
146
147         Gtk::Button *           cancel_button;
148         Gtk::Button *           export_button;
149
150 };
151
152 class ExportRangeDialog : public ExportDialog
153 {
154   public:
155         ExportRangeDialog (PublicEditor & editor, std::string range_id);
156
157   private:
158         void init_components ();
159
160         std::string range_id;
161 };
162
163 class ExportSelectionDialog : public ExportDialog
164 {
165   public:
166         ExportSelectionDialog (PublicEditor & editor);
167
168   private:
169         void init_components ();
170 };
171
172 class ExportRegionDialog : public ExportDialog
173 {
174   public:
175         ExportRegionDialog (PublicEditor & editor, ARDOUR::AudioRegion const & region, ARDOUR::AudioTrack & track);
176
177   private:
178         void init_gui ();
179         void init_components ();
180
181         ARDOUR::AudioRegion const & region;
182         ARDOUR::AudioTrack & track;
183 };
184
185 class StemExportDialog : public ExportDialog
186 {
187   public:
188         StemExportDialog (PublicEditor & editor);
189
190   private:
191         void init_components ();
192 };
193
194 #endif /* __ardour_export_dialog_h__ */