#include "export_format_dialog.h"
#include "gui_thread.h"
-#include "i18n.h"
+#include "tooltips.h"
+#include "pbd/i18n.h"
using namespace ARDOUR;
applying_changes_from_engine (0),
name_label (_("Label: "), Gtk::ALIGN_LEFT),
+ name_generated_part ("", Gtk::ALIGN_LEFT),
- normalize_checkbox (_("Normalize to:")),
- normalize_adjustment (0.00, -90.00, 0.00, 0.1, 0.2),
- normalize_db_label (_("dBFS"), Gtk::ALIGN_LEFT),
+ normalize_checkbox (_("Normalize:")),
+ normalize_peak_rb (_("Peak")),
+ normalize_loudness_rb (_("Loudness")),
+ normalize_dbfs_adjustment ( 0.00, -90.00, 0.00, 0.1, 0.2),
+ normalize_lufs_adjustment (-23.0, -90.00, 0.00, 0.1, 1.0),
+ normalize_dbtp_adjustment ( -1.0, -90.00, 0.00, 0.1, 0.2),
+
+ normalize_dbfs_label (_("dBFS"), Gtk::ALIGN_LEFT),
+ normalize_lufs_label (_("LUFS"), Gtk::ALIGN_LEFT),
+ normalize_dbtp_label (_("dBTP"), Gtk::ALIGN_LEFT),
silence_table (2, 4),
trim_start_checkbox (_("Trim silence at start")),
silence_start_checkbox (_("Add silence at start:")),
- silence_start_clock ("silence_start", true, "PreRollClock", true, false, true),
+ silence_start_clock ("silence_start", true, "", true, false, true),
trim_end_checkbox (_("Trim silence at end")),
silence_end_checkbox (_("Add silence at end:")),
- silence_end_clock ("silence_end", true, "PreRollClock", true, false, true),
+ silence_end_clock ("silence_end", true, "", true, false, true),
+
+ command_label(_("Command to run post-export\n(%f=file path, %d=directory, %b=basename, see tooltip for more):"), Gtk::ALIGN_LEFT),
format_table (3, 4),
compatibility_label (_("Compatibility"), Gtk::ALIGN_LEFT),
sample_format_label (_("Sample Format"), Gtk::ALIGN_LEFT),
dither_label (_("Dithering"), Gtk::ALIGN_LEFT),
+ with_cue (_("Create CUE file for disk-at-once CD/DVD creation")),
+ with_toc (_("Create TOC file for disk-at-once CD/DVD creation")),
+ with_mp4chaps (_("Create chapter mark file for MP4 chapter marks")),
+
tag_checkbox (_("Tag file with session's metadata"))
{
/* Pack containers in dialog */
- get_vbox()->pack_start (name_hbox, false, false, 0);
get_vbox()->pack_start (silence_table, false, false, 6);
get_vbox()->pack_start (format_table, false, false, 6);
get_vbox()->pack_start (encoding_options_vbox, false, false, 0);
+ get_vbox()->pack_start (cue_toc_vbox, false, false, 0);
+ get_vbox()->pack_start (name_hbox, false, false, 6);
/* Name, new and remove */
name_hbox.pack_start (name_label, false, false, 0);
- name_hbox.pack_start (name_entry, true, true, 0);
+ name_hbox.pack_start (name_entry, false, false, 0);
+ name_hbox.pack_start (name_generated_part, true, true, 0);
+ name_entry.set_width_chars(20);
+ update_description();
+ manager.DescriptionChanged.connect(
+ *this, invalidator (*this),
+ boost::bind (&ExportFormatDialog::update_description, this), gui_context());
/* Normalize */
- normalize_hbox.pack_start (normalize_checkbox, false, false, 0);
- normalize_hbox.pack_start (normalize_spinbutton, false, false, 6);
- normalize_hbox.pack_start (normalize_db_label, false, false, 0);
+ Gtk::RadioButtonGroup normalize_group = normalize_loudness_rb.get_group();
+ normalize_peak_rb.set_group (normalize_group);
+
+ normalize_hbox.pack_start (normalize_checkbox, false, false, 2);
+ normalize_hbox.pack_start (normalize_peak_rb, false, false, 0);
+ normalize_hbox.pack_start (normalize_dbfs_spinbutton, false, false, 2);
+ normalize_hbox.pack_start (normalize_dbfs_label, false, false, 0);
+
+ normalize_hbox.pack_start (*Gtk::manage (new Gtk::Label ("")), false, false, 6); // separator
- normalize_spinbutton.configure (normalize_adjustment, 0.1, 2);
+ normalize_hbox.pack_start (normalize_loudness_rb, false, false, 0);
+ normalize_hbox.pack_start (normalize_lufs_spinbutton, false, false, 2);
+ normalize_hbox.pack_start (normalize_lufs_label, false, false, 0);
+ normalize_hbox.pack_start (*Gtk::manage (new Gtk::Label (_("\u2227"))), false, false, 4);
+ normalize_hbox.pack_start (normalize_dbtp_spinbutton, false, false, 2);
+ normalize_hbox.pack_start (normalize_dbtp_label, false, false, 0);
+
+ ARDOUR_UI_UTILS::set_tooltip (normalize_loudness_rb,
+ _("Normalize to EBU-R128 LUFS target loudness without exceeding the given true-peak limit. EBU-R128 normalization is only available for mono and stereo targets, true-peak works for any channel layout."));
+
+ normalize_dbfs_spinbutton.configure (normalize_dbfs_adjustment, 0.1, 2);
+ normalize_lufs_spinbutton.configure (normalize_lufs_adjustment, 0.1, 2);
+ normalize_dbtp_spinbutton.configure (normalize_dbtp_adjustment, 0.1, 2);
/* Silence */
silence_table.attach (silence_end_checkbox, 1, 2, 2, 3);
silence_table.attach (silence_end_clock, 2, 3, 2, 3);
+ /* Post-export hook script */
+
+ get_vbox()->pack_start (command_label, false, false);
+ get_vbox()->pack_start (command_entry, false, false);
+
+ ARDOUR_UI_UTILS::set_tooltip (command_entry,
+ _(
+ "%a Artist name\n"
+ "%b File's base-name\n"
+ "%c Copyright\n"
+ "%d File's directory\n"
+ "%f File's full absolute path\n"
+ "%l Lyricist\n"
+ "%n Session name\n"
+ "%o Conductor\n"
+ "%t Title\n"
+ "%z Organization\n"
+ "%A Album\n"
+ "%C Comment\n"
+ "%E Engineer\n"
+ "%G Genre\n"
+ "%L Total track count\n"
+ "%M Mixer\n"
+ "%N Timespan name\n"
+ "%O Composer\n"
+ "%P Producer\n"
+ "%S Disc subtitle\n"
+ "%T Track number\n"
+ "%Y Year\n"
+ "%Z Country"
+ ));
+
/* Format table */
init_format_table();
close_button = add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_APPLY);
close_button->set_sensitive (false);
close_button->signal_clicked().connect (sigc::mem_fun (*this, &ExportFormatDialog::end_dialog));
- manager.CompleteChanged.connect (*this, invalidator (*this), ui_bind (&Gtk::Button::set_sensitive, close_button, _1), gui_context());
+ manager.CompleteChanged.connect (*this, invalidator (*this), boost::bind (&Gtk::Button::set_sensitive, close_button, _1), gui_context());
+
+ with_cue.signal_toggled().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_with_cue));
+ with_toc.signal_toggled().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_with_toc));
+ with_mp4chaps.signal_toggled().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_with_mp4chaps));
+ command_entry.signal_changed().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_command));
+
+ cue_toc_vbox.pack_start (with_cue, false, false);
+ cue_toc_vbox.pack_start (with_toc, false, false);
+ cue_toc_vbox.pack_start (with_mp4chaps, false, false);
/* Load state before hooking up the rest of the signals */
trim_end_checkbox.signal_toggled().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_trim_end_selection));
normalize_checkbox.signal_toggled().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_normalize_selection));
- normalize_spinbutton.signal_value_changed().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_normalize_selection));
+ normalize_peak_rb.signal_toggled().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_normalize_selection));
+ normalize_loudness_rb.signal_toggled().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_normalize_selection));
+ normalize_dbfs_spinbutton.signal_value_changed().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_normalize_selection));
+ normalize_lufs_spinbutton.signal_value_changed().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_normalize_selection));
+ normalize_dbtp_spinbutton.signal_value_changed().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_normalize_selection));
silence_start_checkbox.signal_toggled().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_silence_start_selection));
silence_start_clock.ValueChanged.connect (sigc::mem_fun (*this, &ExportFormatDialog::update_silence_start_selection));
/* Finalize */
show_all_children();
+ update_normalize_sensitivity ();
}
ExportFormatDialog::~ExportFormatDialog ()
name_entry.set_text (spec->name());
normalize_checkbox.set_active (spec->normalize());
- normalize_spinbutton.set_value (spec->normalize_target());
+ normalize_peak_rb.set_active (!spec->normalize_loudness());
+ normalize_loudness_rb.set_active (spec->normalize_loudness());
+ normalize_dbfs_spinbutton.set_value (spec->normalize_dbfs());
+ normalize_lufs_spinbutton.set_value (spec->normalize_lufs());
+ normalize_dbtp_spinbutton.set_value (spec->normalize_dbtp());
trim_start_checkbox.set_active (spec->trim_beginning());
silence_start = spec->silence_beginning_time();
silence_end = spec->silence_end_time();
silence_end_checkbox.set_active (spec->silence_end_time().not_zero());
+ with_cue.set_active (spec->with_cue());
+ with_toc.set_active (spec->with_toc());
+ with_mp4chaps.set_active (spec->with_mp4chaps());
+
for (Gtk::ListStore::Children::iterator it = src_quality_list->children().begin(); it != src_quality_list->children().end(); ++it) {
if (it->get_value (src_quality_cols.id) == spec->src_quality()) {
src_quality_combo.set_active (it);
}
}
+ update_normalize_sensitivity ();
tag_checkbox.set_active (spec->tag());
+ command_entry.set_text (spec->command());
}
void
row[compatibility_cols.label] = (*it)->name();
WeakCompatPtr ptr (*it);
- (*it)->SelectChanged.connect (*this, invalidator (*this), ui_bind (&ExportFormatDialog::change_compatibility_selection, this, _1, ptr), gui_context());
+ (*it)->SelectChanged.connect (*this, invalidator (*this), boost::bind (&ExportFormatDialog::change_compatibility_selection, this, _1, ptr), gui_context());
}
compatibility_view.append_column_editable ("", compatibility_cols.selected);
row[quality_cols.label] = (*it)->name();
WeakQualityPtr ptr (*it);
- (*it)->SelectChanged.connect (*this, invalidator (*this), ui_bind (&ExportFormatDialog::change_quality_selection, this, _1, ptr), gui_context());
- (*it)->CompatibleChanged.connect (*this, invalidator (*this), ui_bind (&ExportFormatDialog::change_quality_compatibility, this, _1, ptr), gui_context());
+ (*it)->SelectChanged.connect (*this, invalidator (*this), boost::bind (&ExportFormatDialog::change_quality_selection, this, _1, ptr), gui_context());
+ (*it)->CompatibleChanged.connect (*this, invalidator (*this), boost::bind (&ExportFormatDialog::change_quality_compatibility, this, _1, ptr), gui_context());
}
quality_view.append_column ("", quality_cols.label);
row[format_cols.label] = (*it)->name();
WeakFormatPtr ptr (*it);
- (*it)->SelectChanged.connect (*this, invalidator (*this), ui_bind (&ExportFormatDialog::change_format_selection, this, _1, ptr), gui_context());
- (*it)->CompatibleChanged.connect (*this, invalidator (*this), ui_bind (&ExportFormatDialog::change_format_compatibility, this, _1, ptr), gui_context());
+ (*it)->SelectChanged.connect (*this, invalidator (*this), boost::bind (&ExportFormatDialog::change_format_selection, this, _1, ptr), gui_context());
+ (*it)->CompatibleChanged.connect (*this, invalidator (*this), boost::bind (&ExportFormatDialog::change_format_compatibility, this, _1, ptr), gui_context());
/* Encoding options */
boost::shared_ptr<HasSampleFormat> hsf;
- if (hsf = boost::dynamic_pointer_cast<HasSampleFormat> (*it)) {
- hsf->SampleFormatSelectChanged.connect (*this, invalidator (*this), ui_bind (&ExportFormatDialog::change_sample_format_selection, this, _1, _2), gui_context());
- hsf->SampleFormatCompatibleChanged.connect (*this, invalidator (*this), ui_bind (&ExportFormatDialog::change_sample_format_compatibility, this, _1, _2), gui_context());
+ if ((hsf = boost::dynamic_pointer_cast<HasSampleFormat> (*it))) {
+ hsf->SampleFormatSelectChanged.connect (*this, invalidator (*this), boost::bind (&ExportFormatDialog::change_sample_format_selection, this, _1, _2), gui_context());
+ hsf->SampleFormatCompatibleChanged.connect (*this, invalidator (*this), boost::bind (&ExportFormatDialog::change_sample_format_compatibility, this, _1, _2), gui_context());
- hsf->DitherTypeSelectChanged.connect (*this, invalidator (*this), ui_bind (&ExportFormatDialog::change_dither_type_selection, this, _1, _2), gui_context());
- hsf->DitherTypeCompatibleChanged.connect (*this, invalidator (*this), ui_bind (&ExportFormatDialog::change_dither_type_compatibility, this, _1, _2), gui_context());
+ hsf->DitherTypeSelectChanged.connect (*this, invalidator (*this), boost::bind (&ExportFormatDialog::change_dither_type_selection, this, _1, _2), gui_context());
+ hsf->DitherTypeCompatibleChanged.connect (*this, invalidator (*this), boost::bind (&ExportFormatDialog::change_dither_type_compatibility, this, _1, _2), gui_context());
}
}
row[sample_rate_cols.label] = (*it)->name();
WeakSampleRatePtr ptr (*it);
- (*it)->SelectChanged.connect (*this, invalidator (*this), ui_bind (&ExportFormatDialog::change_sample_rate_selection, this, _1, ptr), gui_context());
- (*it)->CompatibleChanged.connect (*this, invalidator (*this), ui_bind (&ExportFormatDialog::change_sample_rate_compatibility, this, _1, ptr), gui_context());
+ (*it)->SelectChanged.connect (*this, invalidator (*this), boost::bind (&ExportFormatDialog::change_sample_rate_selection, this, _1, ptr), gui_context());
+ (*it)->CompatibleChanged.connect (*this, invalidator (*this), boost::bind (&ExportFormatDialog::change_sample_rate_compatibility, this, _1, ptr), gui_context());
}
sample_rate_view.append_column ("", sample_rate_cols.label);
}
}
+void
+ExportFormatDialog::update_with_cue ()
+{
+ manager.select_with_cue (with_cue.get_active());
+}
+
+void
+ExportFormatDialog::update_with_toc ()
+{
+ manager.select_with_toc (with_toc.get_active());
+}
+
+void
+ExportFormatDialog::update_with_mp4chaps ()
+{
+ manager.select_with_mp4chaps (with_mp4chaps.get_active());
+}
+
+void
+ExportFormatDialog::update_command ()
+{
+ manager.set_command (command_entry.get_text());
+}
+
+void
+ExportFormatDialog::update_description()
+{
+ std::string text = ": " + format->description(false);
+ name_generated_part.set_text(text);
+}
+
void
ExportFormatDialog::update_name ()
{
manager.select_trim_end (trim_end_checkbox.get_active());
}
+void
+ExportFormatDialog::update_normalize_sensitivity ()
+{
+ bool en = normalize_checkbox.get_active();
+ bool loudness = normalize_loudness_rb.get_active();
+ normalize_dbfs_spinbutton.set_sensitive (!loudness && en);
+ normalize_lufs_spinbutton.set_sensitive (loudness && en);
+ normalize_dbtp_spinbutton.set_sensitive (loudness && en);
+}
+
void
ExportFormatDialog::update_normalize_selection ()
{
manager.select_normalize (normalize_checkbox.get_active());
- manager.select_normalize_target (normalize_spinbutton.get_value ());
+ manager.select_normalize_loudness (normalize_loudness_rb.get_active());
+ manager.select_normalize_dbfs (normalize_dbfs_spinbutton.get_value ());
+ manager.select_normalize_lufs (normalize_lufs_spinbutton.get_value ());
+ manager.select_normalize_dbtp (normalize_dbtp_spinbutton.get_value ());
+ update_normalize_sensitivity ();
}
void
boost::shared_ptr<ARDOUR::ExportFormatFLAC> flac_ptr;
boost::shared_ptr<ARDOUR::ExportFormatBWF> bwf_ptr;
- if (linear_ptr = boost::dynamic_pointer_cast<ExportFormatLinear> (ptr)) {
+ if ((linear_ptr = boost::dynamic_pointer_cast<ExportFormatLinear> (ptr))) {
show_linear_enconding_options (linear_ptr);
- } else if (ogg_ptr = boost::dynamic_pointer_cast<ExportFormatOggVorbis> (ptr)) {
+ } else if ((ogg_ptr = boost::dynamic_pointer_cast<ExportFormatOggVorbis> (ptr))) {
show_ogg_enconding_options (ogg_ptr);
- } else if (flac_ptr = boost::dynamic_pointer_cast<ExportFormatFLAC> (ptr)) {
+ } else if ((flac_ptr = boost::dynamic_pointer_cast<ExportFormatFLAC> (ptr))) {
show_flac_enconding_options (flac_ptr);
- } else if (bwf_ptr = boost::dynamic_pointer_cast<ExportFormatBWF> (ptr)) {
+ } else if ((bwf_ptr = boost::dynamic_pointer_cast<ExportFormatBWF> (ptr))) {
show_bwf_enconding_options (bwf_ptr);
} else {
std::cout << "Unrecognized format!" << std::endl;
encoding_options_table.resize (1, 1);
encoding_options_table.attach (tag_checkbox, 0, 1, 0, 1);
- update_tagging_selection ();
-
show_all_children ();
}