2 * Copyright (C) 2005-2015 Paul Davis <paul@linuxaudiosystems.com>
3 * Copyright (C) 2005 Taybin Rutkin <taybin@taybin.com>
4 * Copyright (C) 2007-2011 David Robillard <d@drobilla.net>
5 * Copyright (C) 2008-2013 Sakari Bergen <sakari.bergen@beatwaves.net>
6 * Copyright (C) 2010-2012 Carl Hetherington <carl@carlh.net>
7 * Copyright (C) 2013-2014 Colin Fletcher <colin.m.fletcher@googlemail.com>
8 * Copyright (C) 2016-2017 Robin Gareus <robin@gareus.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #ifndef __export_dialog_h__
26 #define __export_dialog_h__
29 #include <boost/scoped_ptr.hpp>
31 #include <gtkmm/box.h>
32 #include <gtkmm/button.h>
33 #include <gtkmm/label.h>
34 #include <gtkmm/notebook.h>
35 #include <gtkmm/progressbar.h>
37 #include "ardour/export_profile_manager.h"
39 #include "public_editor.h"
40 #include "export_timespan_selector.h"
41 #include "export_channel_selector.h"
42 #include "export_file_notebook.h"
43 #include "export_preset_selector.h"
44 #include "ardour_dialog.h"
45 #include "soundcloud_export_selector.h"
52 class ExportTimespanSelector;
53 class ExportChannelSelector;
55 class ExportDialog : public ArdourDialog, public PBD::ScopedConnectionList
59 ExportDialog (PublicEditor & editor, std::string title, ARDOUR::ExportProfileManager::ExportType type);
62 void set_session (ARDOUR::Session* s);
74 void on_response (int response_id) {
75 Gtk::Dialog::on_response (response_id);
78 typedef boost::shared_ptr<ARDOUR::ExportHandler> HandlerPtr;
79 typedef boost::shared_ptr<ARDOUR::ExportProfileManager> ManagerPtr;
81 ARDOUR::ExportProfileManager::ExportType type;
83 ManagerPtr profile_manager;
85 // initializes GUI layout
86 virtual void init_gui ();
88 // Must initialize all the shared_ptrs below
89 virtual void init_components ();
91 boost::scoped_ptr<ExportPresetSelector> preset_selector;
92 boost::scoped_ptr<ExportTimespanSelector> timespan_selector;
93 boost::scoped_ptr<ExportChannelSelector> channel_selector;
94 boost::scoped_ptr<ExportFileNotebook> file_notebook;
96 boost::shared_ptr<SoundcloudExportSelector> soundcloud_selector;
98 Gtk::VBox warning_widget;
99 Gtk::VBox progress_widget;
101 /*** GUI components ***/
102 Gtk::Notebook export_notebook;
108 void notify_errors (bool force = false);
109 void close_dialog ();
111 void sync_with_manager ();
112 void update_warnings_and_example_filename ();
113 void show_conflicting_files ();
117 void update_realtime_selection ();
118 void parameter_changed (std::string const&);
120 void show_progress ();
121 gint progress_timeout ();
123 typedef boost::shared_ptr<ARDOUR::ExportStatus> StatusPtr;
125 PublicEditor & editor;
133 Gtk::Label warn_label;
134 std::string warn_string;
136 Gtk::HBox list_files_hbox;
137 Gtk::Label list_files_label;
138 Gtk::Button list_files_button;
139 std::string list_files_string;
141 void add_error (std::string const & text);
142 void add_warning (std::string const & text);
146 Gtk::ProgressBar progress_bar;
147 sigc::connection progress_connection;
149 float previous_progress; // Needed for gtk bug workaround
151 void soundcloud_upload_progress(double total, double now, std::string title);
155 Gtk::Button * cancel_button;
156 Gtk::Button * export_button;
160 class ExportRangeDialog : public ExportDialog
163 ExportRangeDialog (PublicEditor & editor, std::string range_id);
166 void init_components ();
168 std::string range_id;
171 class ExportSelectionDialog : public ExportDialog
174 ExportSelectionDialog (PublicEditor & editor);
177 void init_components ();
180 class ExportRegionDialog : public ExportDialog
183 ExportRegionDialog (PublicEditor & editor, ARDOUR::AudioRegion const & region, ARDOUR::AudioTrack & track);
187 void init_components ();
189 ARDOUR::AudioRegion const & region;
190 ARDOUR::AudioTrack & track;
193 class StemExportDialog : public ExportDialog
196 StemExportDialog (PublicEditor & editor);
199 void init_components ();
202 #endif /* __ardour_export_dialog_h__ */