2 Copyright (C) 1999-2002 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_export_dialog_h__
21 #define __ardour_export_dialog_h__
23 #include <gtkmm/alignment.h>
24 #include <gtkmm/box.h>
25 #include <gtkmm/table.h>
26 #include <gtkmm/frame.h>
27 #include <gtkmm/frame.h>
28 #include <gtkmm/button.h>
29 #include <gtkmm/progressbar.h>
30 #include <gtkmm/scrolledwindow.h>
31 #include <gtkmm/fileselection.h>
32 #include <gtkmm/comboboxtext.h>
33 #include <gtkmm/treeview.h>
34 #include <gtkmm/liststore.h>
36 #include <ardour/export.h>
37 #include <ardour/location.h>
39 #include "ardour_dialog.h"
49 class ExportDialog : public ArdourDialog
52 ExportDialog (PublicEditor&, ARDOUR::AudioRegion* r = 0);
55 void connect_to_session (ARDOUR::Session*);
56 void set_range (jack_nframes_t start, jack_nframes_t end);
60 struct ExportModelColumns : public Gtk::TreeModel::ColumnRecord
63 Gtk::TreeModelColumn<std::string> output;
64 Gtk::TreeModelColumn<bool> left;
65 Gtk::TreeModelColumn<bool> right;
66 Gtk::TreeModelColumn<ARDOUR::Port*> port;
68 ExportModelColumns() { add(output); add(left); add(right); add(port);}
71 ExportModelColumns exp_cols;
75 ARDOUR::Session* session;
76 ARDOUR::AudioRegion* audio_region;
77 Gtk::VBox track_vpacker;
81 Gtk::Table format_table;
82 Gtk::Frame format_frame;
84 Gtk::Label channel_count_label;
85 Gtk::Alignment channel_count_align;
86 Gtk::ComboBoxText channel_count_combo;
88 Gtk::Label header_format_label;
89 Gtk::Alignment header_format_align;
90 Gtk::ComboBoxText header_format_combo;
92 Gtk::Label bitdepth_format_label;
93 Gtk::Alignment bitdepth_format_align;
94 Gtk::ComboBoxText bitdepth_format_combo;
96 Gtk::Label endian_format_label;
97 Gtk::Alignment endian_format_align;
98 Gtk::ComboBoxText endian_format_combo;
100 Gtk::Label sample_rate_label;
101 Gtk::Alignment sample_rate_align;
102 Gtk::ComboBoxText sample_rate_combo;
104 Gtk::Label src_quality_label;
105 Gtk::Alignment src_quality_align;
106 Gtk::ComboBoxText src_quality_combo;
108 Gtk::Label dither_type_label;
109 Gtk::Alignment dither_type_align;
110 Gtk::ComboBoxText dither_type_combo;
112 Gtk::Label cue_file_label;
113 Gtk::Alignment cue_file_align;
114 Gtk::ComboBoxText cue_file_combo;
116 Gtk::CheckButton cuefile_only_checkbox;
118 Gtk::Frame file_frame;
119 Gtk::Entry file_entry;
121 Gtk::Button file_browse_button;
123 Gtk::Button ok_button;
124 Gtk::Button cancel_button;
125 Gtk::Label cancel_label;
126 Gtk::ProgressBar progress_bar;
127 Gtk::ScrolledWindow track_scroll;
128 Gtk::ScrolledWindow master_scroll;
129 Gtk::Button track_selector_button;
130 Gtk::TreeView track_selector;
131 Glib::RefPtr<Gtk::ListStore> track_list;
132 Gtk::TreeView master_selector;
133 Glib::RefPtr<Gtk::ListStore> master_list;
134 Gtk::FileSelection *file_selector;
135 ARDOUR::AudioExportSpecification spec;
137 static void *_thread (void *arg);
138 gint progress_timeout ();
139 sigc::connection progress_connection;
140 void build_window ();
142 void header_chosen ();
143 void channels_chosen ();
144 void bitdepth_chosen ();
145 void sample_rate_chosen ();
146 void cue_file_type_chosen();
150 void do_export_cd_markers (const string& path, const string& cuefile_type);
151 void export_cue_file (ARDOUR::Locations::LocationList& locations, const string& path);
152 void export_toc_file (ARDOUR::Locations::LocationList& locations, const string& path);
154 gint window_closed (GdkEventAny *ignored);
156 void track_selector_button_click ();
158 void initiate_browse ();
159 void finish_browse (int status);
164 static void* _export_region_thread (void *);
165 void export_region ();
168 #endif // __ardour_export_dialog_h__