#include <fstream>
#include <samplerate.h>
-
#include <pbd/convert.h>
#include <pbd/xml++.h>
#include <ardour/audioengine.h>
#include <ardour/gdither.h>
#include <ardour/utils.h>
+#include <ardour/profile.h>
#include "export_dialog.h"
#include "ardour_ui.h"
set_wmclass (X_("ardour_export"), "Ardour");
set_name ("ExportWindow");
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);
-
+
spec.running = false;
file_entry.set_name ("ExportFileNameEntry");
master_selector.append_column_editable(_("Left"), exp_cols.left);
master_selector.append_column_editable(_("Right"), exp_cols.right);
master_selector.get_column(0)->set_min_width(100);
-
+
master_selector.get_column(1)->set_min_width(40);
master_selector.get_column(1)->set_sizing(Gtk::TREE_VIEW_COLUMN_AUTOSIZE);
master_selector.get_column(2)->set_min_width(40);
format_table.set_col_spacings (5);
format_table.set_row_spacings (5);
- format_table.attach (channel_count_label, 0, 1, 0, 1);
- format_table.attach (channel_count_combo, 1, 2, 0, 1);
+ int row = 0;
+
+ format_table.attach (channel_count_label, 0, 1, row, row+1);
+ format_table.attach (channel_count_combo, 1, 2, row, row+1);
+
+ row++;
- format_table.attach (header_format_label, 0, 1, 1, 2);
- format_table.attach (header_format_combo, 1, 2, 1, 2);
+ format_table.attach (header_format_label, 0, 1, row, row+1);
+ format_table.attach (header_format_combo, 1, 2, row, row+1);
- format_table.attach (bitdepth_format_label, 0, 1, 2, 3);
- format_table.attach (bitdepth_format_combo, 1, 2, 2, 3);
+ row++;
- format_table.attach (endian_format_label, 0, 1, 3, 4);
- format_table.attach (endian_format_combo, 1, 2, 3, 4);
+ format_table.attach (bitdepth_format_label, 0, 1, row, row+1);
+ format_table.attach (bitdepth_format_combo, 1, 2, row, row+1);
- format_table.attach (sample_rate_label, 0, 1, 4, 5);
- format_table.attach (sample_rate_combo, 1, 2, 4, 5);
+ row++;
- format_table.attach (src_quality_label, 0, 1, 5, 6);
- format_table.attach (src_quality_combo, 1, 2, 5, 6);
+ if (!Profile->get_sae()) {
+ format_table.attach (endian_format_label, 0, 1, row, row+1);
+ format_table.attach (endian_format_combo, 1, 2, row, row+1);
+ row++;
+ }
- format_table.attach (dither_type_label, 0, 1, 6, 7);
- format_table.attach (dither_type_combo, 1, 2, 6, 7);
+ format_table.attach (sample_rate_label, 0, 1, row, row+1);
+ format_table.attach (sample_rate_combo, 1, 2, row, row+1);
- format_table.attach (cue_file_label, 0, 1, 7, 8);
- format_table.attach (cue_file_combo, 1, 2, 7, 8);
- format_table.attach (cuefile_only_checkbox, 0, 2, 8, 9);
+ row++;
+
+ if (!Profile->get_sae()) {
+ format_table.attach (src_quality_label, 0, 1, row, row+1);
+ format_table.attach (src_quality_combo, 1, 2, row, row+1);
+ row++;
+ }
+
+ format_table.attach (dither_type_label, 0, 1, row, row+1);
+ format_table.attach (dither_type_combo, 1, 2, row, row+1);
+
+ row++;
+
+ if (!Profile->get_sae()) {
+ format_table.attach (cue_file_label, 0, 1, row, row+1);
+ format_table.attach (cue_file_combo, 1, 2, row, row+1);
+ row++;
+
+ format_table.attach (cuefile_only_checkbox, 0, 2, row, row+1);
+ }
file_entry.set_name ("ExportFileDisplay");
ExportDialog::do_export ()
{
string filepath = file_entry.get_text();
-
+
+ if (!ARDOUR_UI::instance()->the_engine().connected()) {
+ MessageDialog msg (*this,
+ _("Not connected to audioengine"),
+ true,
+ MESSAGE_ERROR,
+ BUTTONS_OK);
+ msg.set_secondary_text (_("Ardour cannot export audio when disconnected"));
+ msg.present ();
+ msg.run ();
+ return;
+ }
+
if(!is_filepath_valid(filepath)){
return;
}
- if (export_cd_markers_allowed) {
+ if (!Profile->get_sae() && export_cd_markers_allowed) {
if (cue_file_combo.get_active_text () != _("None")) {
do_export_cd_markers (file_entry.get_text(), cue_file_combo.get_active_text ());
}
*/
if (file_entry.get_text().length() == 0) {
- string dir = session->export_dir();
- string::size_type last_slash;
-
- if ((last_slash = dir.find_last_of ('/')) != string::npos && last_slash != 0) {
- dir = dir.substr (0, last_slash+1);
- }
+ Glib::ustring export_path = session->export_dir();
if (!wants_dir()) {
- dir = dir + "export.wav";
+ export_path = Glib::build_filename (export_path, "export.wav");
}
- file_entry.set_text (dir);
+ file_entry.set_text (export_path);
}
progress_bar.set_fraction (0);
spec.format = 0;
spec.format |= sndfile_header_format_from_string (header_format_combo.get_active_text ());
-
- if ((spec.format & SF_FORMAT_WAV) == 0) {
- /* RIFF/WAV specifies endianess */
- spec.format |= sndfile_endian_format_from_string (endian_format_combo.get_active_text ());
+
+ if (!Profile->get_sae()) {
+ if ((spec.format & SF_FORMAT_WAV) == 0) {
+ /* RIFF/WAV specifies endianess */
+ spec.format |= sndfile_endian_format_from_string (endian_format_combo.get_active_text ());
+ }
}
spec.format |= sndfile_bitdepth_format_from_string (bitdepth_format_combo.get_active_text ());
spec.sample_rate = session->frame_rate();
}
- string src_str = src_quality_combo.get_active_text();
- if (src_str == _("fastest")) {
- spec.src_quality = SRC_ZERO_ORDER_HOLD;
- } else if (src_str == _("linear")) {
- spec.src_quality = SRC_LINEAR;
- } else if (src_str == _("better")) {
- spec.src_quality = SRC_SINC_FASTEST;
- } else if (src_str == _("intermediate")) {
- spec.src_quality = SRC_SINC_MEDIUM_QUALITY;
- } else {
+ if (Profile->get_sae()) {
spec.src_quality = SRC_SINC_BEST_QUALITY;
+ } else {
+ string src_str = src_quality_combo.get_active_text();
+ if (src_str == _("fastest")) {
+ spec.src_quality = SRC_ZERO_ORDER_HOLD;
+ } else if (src_str == _("linear")) {
+ spec.src_quality = SRC_LINEAR;
+ } else if (src_str == _("better")) {
+ spec.src_quality = SRC_SINC_FASTEST;
+ } else if (src_str == _("intermediate")) {
+ spec.src_quality = SRC_SINC_MEDIUM_QUALITY;
+ } else {
+ spec.src_quality = SRC_SINC_BEST_QUALITY;
+ }
}
string dither_str = dither_type_combo.get_active_text();