2 Copyright (C) 2008 Paul Davis
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.
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.
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.
21 #ifndef __export_dialog_h__
22 #define __export_dialog_h__
24 #include <boost/scoped_ptr.hpp>
27 #include "ardour/export_profile_manager.h"
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"
44 class ExportTimespanSelector;
45 class ExportChannelSelector;
47 class ExportDialog : public ArdourDialog, public PBD::ScopedConnectionList
52 ExportDialog (PublicEditor & editor, std::string title, ARDOUR::ExportProfileManager::ExportType type);
55 void set_session (ARDOUR::Session* s);
67 void on_response (int response_id) {
68 Gtk::Dialog::on_response (response_id);
71 typedef boost::shared_ptr<ARDOUR::ExportHandler> HandlerPtr;
72 typedef boost::shared_ptr<ARDOUR::ExportProfileManager> ManagerPtr;
74 ARDOUR::ExportProfileManager::ExportType type;
76 ManagerPtr profile_manager;
78 // initializes GUI layout
79 virtual void init_gui ();
81 // Must initialize all the shared_ptrs below
82 virtual void init_components ();
84 boost::scoped_ptr<ExportPresetSelector> preset_selector;
85 boost::scoped_ptr<ExportTimespanSelector> timespan_selector;
86 boost::scoped_ptr<ExportChannelSelector> channel_selector;
87 boost::scoped_ptr<ExportFileNotebook> file_notebook;
89 boost::shared_ptr<SoundcloudExportSelector> soundcloud_selector;
91 Gtk::VBox warning_widget;
92 Gtk::VBox progress_widget;
94 /*** GUI components ***/
95 Gtk::Notebook export_notebook;
101 void notify_errors (bool force = false);
102 void close_dialog ();
104 void sync_with_manager ();
105 void update_warnings_and_example_filename ();
106 void show_conflicting_files ();
110 void update_realtime_selection ();
111 void parameter_changed (std::string const&);
113 void show_progress ();
114 gint progress_timeout ();
116 typedef boost::shared_ptr<ARDOUR::ExportStatus> StatusPtr;
118 PublicEditor & editor;
126 Gtk::Label warn_label;
127 std::string warn_string;
129 Gtk::HBox list_files_hbox;
130 Gtk::Label list_files_label;
131 Gtk::Button list_files_button;
132 std::string list_files_string;
134 void add_error (std::string const & text);
135 void add_warning (std::string const & text);
139 Gtk::ProgressBar progress_bar;
140 sigc::connection progress_connection;
142 float previous_progress; // Needed for gtk bug workaround
144 void soundcloud_upload_progress(double total, double now, std::string title);
148 Gtk::Button * cancel_button;
149 Gtk::Button * export_button;
153 class ExportRangeDialog : public ExportDialog
156 ExportRangeDialog (PublicEditor & editor, std::string range_id);
159 void init_components ();
161 std::string range_id;
164 class ExportSelectionDialog : public ExportDialog
167 ExportSelectionDialog (PublicEditor & editor);
170 void init_components ();
173 class ExportRegionDialog : public ExportDialog
176 ExportRegionDialog (PublicEditor & editor, ARDOUR::AudioRegion const & region, ARDOUR::AudioTrack & track);
180 void init_components ();
182 ARDOUR::AudioRegion const & region;
183 ARDOUR::AudioTrack & track;
186 class StemExportDialog : public ExportDialog
189 StemExportDialog (PublicEditor & editor);
192 void init_components ();
195 #endif /* __ardour_export_dialog_h__ */