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_main_dialog_h__
22 #define __export_main_dialog_h__
24 #include <boost/shared_ptr.hpp>
26 #include <ardour/export_handler.h>
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_format_selector.h"
33 #include "export_filename_selector.h"
34 #include "ardour_dialog.h"
40 class ExportFormatSpecification;
41 class ExportChannelConfiguration;
45 class ExportTimespanSelector;
46 class ExportChannelSelector;
47 class ExportFormatSelector;
48 class ExportFilenameSelector;
50 class ExportMainDialog : public ArdourDialog {
54 explicit ExportMainDialog (PublicEditor & editor);
57 void set_session (ARDOUR::Session* s);
59 void select_timespan (Glib::ustring id);
71 void notify_errors ();
74 void sync_with_manager ();
75 void update_warnings ();
76 void show_conflicting_files ();
78 typedef boost::shared_ptr<ARDOUR::ExportTimespan> TimespanPtr;
79 typedef boost::shared_ptr<std::list<TimespanPtr> > TimespanList;
81 typedef boost::shared_ptr<ARDOUR::ExportChannelConfiguration> ChannelConfigPtr;
82 typedef std::list<ChannelConfigPtr> ChannelConfigList;
84 typedef boost::shared_ptr<ARDOUR::ExportFilename> FilenamePtr;
86 typedef boost::shared_ptr<ARDOUR::ExportHandler> HandlerPtr;
87 typedef boost::shared_ptr<ARDOUR::ExportFormatSpecification> FormatPtr;
88 typedef boost::shared_ptr<ARDOUR::ExportProfileManager> ManagerPtr;
89 typedef boost::shared_ptr<ARDOUR::ExportStatus> StatusPtr;
94 void show_progress ();
95 Glib::ustring get_nth_format_name (uint32_t n);
96 gint progress_timeout ();
100 PublicEditor & editor;
102 ManagerPtr profile_manager;
105 /*** GUI components ***/
107 Gtk::Table main_table;
111 typedef ARDOUR::ExportProfileManager::PresetPtr PresetPtr;
112 typedef ARDOUR::ExportProfileManager::PresetList PresetList;
114 sigc::connection preset_select_connection;
116 void select_preset ();
117 void save_current_preset ();
118 void remove_current_preset ();
120 struct PresetCols : public Gtk::TreeModelColumnRecord
123 Gtk::TreeModelColumn<PresetPtr> preset;
124 Gtk::TreeModelColumn<Glib::ustring> label;
126 PresetCols () { add (preset); add (label); }
128 PresetCols preset_cols;
129 Glib::RefPtr<Gtk::ListStore> preset_list;
130 PresetPtr current_preset;
131 PresetPtr previous_preset;
133 Gtk::Alignment preset_align;
134 Gtk::HBox preset_hbox;
135 Gtk::Label preset_label;
136 Gtk::ComboBoxEntry preset_entry;
138 Gtk::Button preset_save_button;
139 Gtk::Button preset_remove_button;
140 Gtk::Button preset_new_button;
144 class FilePage : public Gtk::VBox {
146 FilePage (ARDOUR::Session * s, ManagerPtr profile_manager, ExportMainDialog * parent, uint32_t number,
147 ARDOUR::ExportProfileManager::FormatStatePtr format_state,
148 ARDOUR::ExportProfileManager::FilenameStatePtr filename_state);
150 virtual ~FilePage ();
152 Gtk::Widget & get_tab_widget () { return tab_widget; }
153 void set_remove_sensitive (bool value);
154 Glib::ustring get_format_name () const;
156 ARDOUR::ExportProfileManager::FormatStatePtr get_format_state () const { return format_state; }
157 ARDOUR::ExportProfileManager::FilenameStatePtr get_filename_state () const { return filename_state; }
159 sigc::signal<void> CriticalSelectionChanged;
162 void save_format_to_manager (FormatPtr format);
163 void update_tab_label ();
165 ARDOUR::ExportProfileManager::FormatStatePtr format_state;
166 ARDOUR::ExportProfileManager::FilenameStatePtr filename_state;
167 ManagerPtr profile_manager;
171 Gtk::Label format_label;
172 Gtk::Alignment format_align;
173 ExportFormatSelector format_selector;
175 Gtk::Label filename_label;
176 Gtk::Alignment filename_align;
177 ExportFilenameSelector filename_selector;
179 Gtk::HBox tab_widget;
180 Gtk::Label tab_label;
181 Gtk::Alignment tab_close_alignment;
182 Gtk::Button tab_close_button;
186 void add_new_file_page ();
187 void add_file_page (ARDOUR::ExportProfileManager::FormatStatePtr format_state, ARDOUR::ExportProfileManager::FilenameStatePtr filename_state);
188 void remove_file_page (FilePage * page);
189 void update_remove_file_page_sensitivity ();
191 sigc::connection page_change_connection;
192 void handle_page_change (GtkNotebookPage*, uint32_t page);
194 uint32_t last_visible_page;
195 uint32_t page_counter;
199 Gtk::VBox warn_container;
202 Gtk::Label warn_label;
203 Glib::ustring warn_string;
205 Gtk::HBox list_files_hbox;
206 Gtk::Label list_files_label;
207 Gtk::Button list_files_button;
208 Glib::ustring list_files_string;
210 void add_error (Glib::ustring const & text);
211 void add_warning (Glib::ustring const & text);
215 Gtk::VBox progress_container;
216 Gtk::Label progress_label;
217 Gtk::ProgressBar progress_bar;
218 sigc::connection progress_connection;
220 /* Everything else */
222 Gtk::Label timespan_label;
223 Gtk::Alignment timespan_align;
224 ExportTimespanSelector timespan_selector;
226 Gtk::Label channels_label;
227 Gtk::Alignment channels_align;
228 ExportChannelSelector channel_selector;
230 Gtk::Notebook file_notebook;
232 Gtk::HBox new_file_hbox;
233 Gtk::Button new_file_button;
234 Gtk::VBox new_file_dummy;
236 Gtk::Button * cancel_button;
237 Gtk::Button * rt_export_button;
238 Gtk::Button * fast_export_button;
242 #endif /* __ardour_export_main_dialog_h__ */