fix up file renaming code a little bit
[ArdourMidi.git] / gtk2_ardour / export_dialog.h
blob93d3b21654b86c4ba037309a8b5d2c87387317d6
1 /*
2 Copyright (C) 2008 Paul Davis
3 Author: Sakari Bergen
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>
26 #include "ardour/export_profile_manager.h"
28 #include "public_editor.h"
29 #include "export_timespan_selector.h"
30 #include "export_channel_selector.h"
31 #include "export_file_notebook.h"
32 #include "export_preset_selector.h"
33 #include "ardour_dialog.h"
35 #include <gtkmm.h>
37 namespace ARDOUR {
38 class ExportStatus;
39 class ExportHandler;
42 class ExportTimespanSelector;
43 class ExportChannelSelector;
45 class ExportDialog : public ArdourDialog {
47 public:
49 explicit ExportDialog (PublicEditor & editor, Glib::ustring title);
50 ~ExportDialog ();
52 void set_session (ARDOUR::Session* s);
54 /* Responses */
56 enum Responses {
57 RESPONSE_RT,
58 RESPONSE_FAST,
59 RESPONSE_CANCEL
62 protected:
64 typedef boost::shared_ptr<ARDOUR::ExportHandler> HandlerPtr;
65 typedef boost::shared_ptr<ARDOUR::ExportProfileManager> ManagerPtr;
67 HandlerPtr handler;
68 ManagerPtr profile_manager;
70 // initializes GUI layout
71 virtual void init_gui ();
73 // Must initialize all the shared_ptrs below
74 virtual void init_components ();
76 boost::scoped_ptr<ExportPresetSelector> preset_selector;
77 boost::scoped_ptr<ExportTimespanSelector> timespan_selector;
78 boost::scoped_ptr<ExportChannelSelector> channel_selector;
79 boost::scoped_ptr<ExportFileNotebook> file_notebook;
81 Gtk::VBox warning_widget;
82 Gtk::VBox progress_widget;
84 Gtk::Label * timespan_label;
85 Gtk::Label * channels_label;
87 private:
89 void init ();
91 void notify_errors ();
92 void close_dialog ();
94 void sync_with_manager ();
95 void update_warnings ();
96 void show_conflicting_files ();
98 void export_rt ();
99 void export_fw ();
101 void show_progress ();
102 gint progress_timeout ();
104 typedef boost::shared_ptr<ARDOUR::ExportStatus> StatusPtr;
106 PublicEditor & editor;
107 StatusPtr status;
108 PBD::ScopedConnection abort_connection;
110 /*** GUI components ***/
112 /* Warning area */
114 Gtk::HBox warn_hbox;
115 Gtk::Label warn_label;
116 Glib::ustring warn_string;
118 Gtk::HBox list_files_hbox;
119 Gtk::Label list_files_label;
120 Gtk::Button list_files_button;
121 Glib::ustring list_files_string;
123 void add_error (Glib::ustring const & text);
124 void add_warning (Glib::ustring const & text);
126 /* Progress bar */
128 Gtk::Label progress_label;
129 Gtk::ProgressBar progress_bar;
130 sigc::connection progress_connection;
132 /* Buttons */
134 Gtk::Button * cancel_button;
135 Gtk::Button * rt_export_button;
136 Gtk::Button * fast_export_button;
140 class ExportRangeDialog : public ExportDialog
142 public:
143 ExportRangeDialog (PublicEditor & editor, Glib::ustring range_id);
145 private:
146 void init_components ();
148 Glib::ustring range_id;
151 class ExportSelectionDialog : public ExportDialog
153 public:
154 ExportSelectionDialog (PublicEditor & editor);
156 private:
157 void init_components ();
160 class ExportRegionDialog : public ExportDialog
162 public:
163 ExportRegionDialog (PublicEditor & editor, ARDOUR::AudioRegion const & region, ARDOUR::AudioTrack & track);
165 private:
166 void init_gui ();
167 void init_components ();
169 ARDOUR::AudioRegion const & region;
170 ARDOUR::AudioTrack & track;
173 #endif /* __ardour_export_dialog_h__ */