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 <ardour/export_handler.h>
25 #include <ardour/export_profile_manager.h>
27 #include "public_editor.h"
28 #include "export_timespan_selector.h"
29 #include "export_channel_selector.h"
30 #include "export_format_selector.h"
31 #include "export_filename_selector.h"
32 #include "ardour_dialog.h"
38 class ExportFormatSpecification;
39 class ExportChannelConfiguration;
42 class ExportTimespanSelector;
43 class ExportChannelSelector;
44 class ExportFormatSelector;
45 class ExportFilenameSelector;
47 class ExportMainDialog : public ArdourDialog {
51 explicit ExportMainDialog (PublicEditor & editor);
54 void set_session (ARDOUR::Session* s);
56 void select_timespan (Glib::ustring id);
70 void sync_with_manager ();
71 void update_warnings ();
72 void show_conflicting_files ();
74 typedef boost::shared_ptr<ARDOUR::ExportTimespan> TimespanPtr;
75 typedef boost::shared_ptr<std::list<TimespanPtr> > TimespanList;
77 typedef boost::shared_ptr<ARDOUR::ExportChannelConfiguration> ChannelConfigPtr;
78 typedef std::list<ChannelConfigPtr> ChannelConfigList;
80 typedef boost::shared_ptr<ARDOUR::ExportFilename> FilenamePtr;
82 typedef boost::shared_ptr<ARDOUR::ExportHandler> HandlerPtr;
83 typedef boost::shared_ptr<ARDOUR::ExportFormatSpecification> FormatPtr;
84 typedef boost::shared_ptr<ARDOUR::ExportProfileManager> ManagerPtr;
89 void show_progress ();
90 Glib::ustring get_nth_format_name (uint32_t n);
91 gint progress_timeout ();
95 PublicEditor & editor;
97 ManagerPtr profile_manager;
99 /*** GUI components ***/
101 Gtk::Table main_table;
105 typedef ARDOUR::ExportProfileManager::PresetPtr PresetPtr;
106 typedef ARDOUR::ExportProfileManager::PresetList PresetList;
108 sigc::connection preset_select_connection;
110 void select_preset ();
111 void save_current_preset ();
112 void remove_current_preset ();
114 struct PresetCols : public Gtk::TreeModelColumnRecord
117 Gtk::TreeModelColumn<PresetPtr> preset;
118 Gtk::TreeModelColumn<Glib::ustring> label;
120 PresetCols () { add (preset); add (label); }
122 PresetCols preset_cols;
123 Glib::RefPtr<Gtk::ListStore> preset_list;
124 PresetPtr current_preset;
125 PresetPtr previous_preset;
127 Gtk::Alignment preset_align;
128 Gtk::HBox preset_hbox;
129 Gtk::Label preset_label;
130 Gtk::ComboBoxEntry preset_entry;
132 Gtk::Button preset_save_button;
133 Gtk::Button preset_remove_button;
134 Gtk::Button preset_new_button;
138 class FilePage : public Gtk::VBox {
140 FilePage (ARDOUR::Session * s, ManagerPtr profile_manager, ExportMainDialog * parent, uint32_t number,
141 ARDOUR::ExportProfileManager::FormatStatePtr format_state,
142 ARDOUR::ExportProfileManager::FilenameStatePtr filename_state);
144 virtual ~FilePage ();
146 Gtk::Widget & get_tab_widget () { return tab_widget; }
147 void set_remove_sensitive (bool value);
148 Glib::ustring get_format_name () const;
150 ARDOUR::ExportProfileManager::FormatStatePtr get_format_state () const { return format_state; }
151 ARDOUR::ExportProfileManager::FilenameStatePtr get_filename_state () const { return filename_state; }
153 sigc::signal<void> CriticalSelectionChanged;
156 void save_format_to_manager (FormatPtr format);
157 void update_tab_label ();
159 ARDOUR::ExportProfileManager::FormatStatePtr format_state;
160 ARDOUR::ExportProfileManager::FilenameStatePtr filename_state;
161 ManagerPtr profile_manager;
165 Gtk::Label format_label;
166 Gtk::Alignment format_align;
167 ExportFormatSelector format_selector;
169 Gtk::Label filename_label;
170 Gtk::Alignment filename_align;
171 ExportFilenameSelector filename_selector;
173 Gtk::HBox tab_widget;
174 Gtk::Label tab_label;
175 Gtk::Alignment tab_close_alignment;
176 Gtk::Button tab_close_button;
180 void add_new_file_page ();
181 void add_file_page (ARDOUR::ExportProfileManager::FormatStatePtr format_state, ARDOUR::ExportProfileManager::FilenameStatePtr filename_state);
182 void remove_file_page (FilePage * page);
183 void update_remove_file_page_sensitivity ();
185 sigc::connection page_change_connection;
186 void handle_page_change (GtkNotebookPage*, uint32_t page);
188 uint32_t last_visible_page;
189 uint32_t page_counter;
193 Gtk::VBox warn_container;
196 Gtk::Label warn_label;
197 Glib::ustring warn_string;
199 Gtk::HBox list_files_hbox;
200 Gtk::Label list_files_label;
201 Gtk::Button list_files_button;
202 Glib::ustring list_files_string;
204 void add_error (Glib::ustring const & text);
205 void add_warning (Glib::ustring const & text);
209 Gtk::VBox progress_container;
210 Gtk::Label progress_label;
211 Gtk::ProgressBar progress_bar;
212 sigc::connection progress_connection;
214 /* Everything else */
216 Gtk::Label timespan_label;
217 Gtk::Alignment timespan_align;
218 ExportTimespanSelector timespan_selector;
220 Gtk::Label channels_label;
221 Gtk::Alignment channels_align;
222 ExportChannelSelector channel_selector;
224 Gtk::Notebook file_notebook;
226 Gtk::HBox new_file_hbox;
227 Gtk::Button new_file_button;
228 Gtk::VBox new_file_dummy;
230 Gtk::Button * cancel_button;
231 Gtk::Button * rt_export_button;
232 Gtk::Button * fast_export_button;
236 #endif /* __ardour_export_main_dialog_h__ */