Remove use of i18n macros in headers. Prevents our gettext.h being included before...
[ardour.git] / gtk2_ardour / export_dialog.h
1 /*
2     Copyright (C) 2008 Paul Davis
3     Author: Sakari Bergen
4
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.
9
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.
14
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.
18
19 */
20
21 #ifndef __export_dialog_h__
22 #define __export_dialog_h__
23
24 #include <boost/scoped_ptr.hpp>
25
26 #include "ardour/export_profile_manager.h"
27
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"
34
35 #include <gtkmm.h>
36
37 namespace ARDOUR {
38         class ExportStatus;
39         class ExportHandler;
40 }
41
42 class ExportTimespanSelector;
43 class ExportChannelSelector;
44
45 class ExportDialog : public ArdourDialog {
46
47   public:
48
49         explicit ExportDialog (PublicEditor & editor, Glib::ustring title);
50         ~ExportDialog ();
51
52         void set_session (ARDOUR::Session* s);
53
54         /* Responses */
55
56         enum Responses {
57                 RESPONSE_RT,
58                 RESPONSE_FAST,
59                 RESPONSE_CANCEL
60         };
61
62   protected:
63
64         typedef boost::shared_ptr<ARDOUR::ExportHandler> HandlerPtr;
65         typedef boost::shared_ptr<ARDOUR::ExportProfileManager> ManagerPtr;
66
67         HandlerPtr      handler;
68         ManagerPtr      profile_manager;
69
70         // initializes GUI layout
71         virtual void init_gui ();
72
73         // Must initialize all the shared_ptrs below
74         virtual void init_components ();
75
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;
80
81         Gtk::VBox                                 warning_widget;
82         Gtk::VBox                                 progress_widget;
83
84         Gtk::Label *                              timespan_label;
85         Gtk::Label *                              channels_label;
86
87   private:
88
89         void init ();
90
91         void notify_errors ();
92         void close_dialog ();
93
94         void sync_with_manager ();
95         void update_warnings ();
96         void show_conflicting_files ();
97
98         void export_rt ();
99         void export_fw ();
100
101         void show_progress ();
102         gint progress_timeout ();
103
104         typedef boost::shared_ptr<ARDOUR::ExportStatus> StatusPtr;
105
106         PublicEditor &  editor;
107         StatusPtr       status;
108         PBD::ScopedConnection abort_connection;
109
110         /*** GUI components ***/
111
112         /* Warning area */
113
114         Gtk::HBox           warn_hbox;
115         Gtk::Label          warn_label;
116         Glib::ustring       warn_string;
117
118         Gtk::HBox           list_files_hbox;
119         Gtk::Label          list_files_label;
120         Gtk::Button         list_files_button;
121         Glib::ustring       list_files_string;
122
123         void add_error (Glib::ustring const & text);
124         void add_warning (Glib::ustring const & text);
125
126         /* Progress bar */
127
128         Gtk::Label              progress_label;
129         Gtk::ProgressBar        progress_bar;
130         sigc::connection        progress_connection;
131
132         /* Buttons */
133
134         Gtk::Button *           cancel_button;
135         Gtk::Button *           rt_export_button;
136         Gtk::Button *           fast_export_button;
137
138 };
139
140 class ExportRangeDialog : public ExportDialog
141 {
142   public:
143         ExportRangeDialog (PublicEditor & editor, Glib::ustring range_id);
144
145   private:
146         void init_components ();
147
148         Glib::ustring range_id;
149 };
150
151 class ExportSelectionDialog : public ExportDialog
152 {
153   public:
154         ExportSelectionDialog (PublicEditor & editor);
155
156   private:
157         void init_components ();
158 };
159
160 class ExportRegionDialog : public ExportDialog
161 {
162         public:
163         ExportRegionDialog (PublicEditor & editor, ARDOUR::AudioRegion const & region, ARDOUR::AudioTrack & track);
164
165   private:
166         void init_gui ();
167         void init_components ();
168
169         ARDOUR::AudioRegion const & region;
170         ARDOUR::AudioTrack & track;
171 };
172
173 #endif /* __ardour_export_dialog_h__ */