X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fexport_format_dialog.cc;h=6062d515003d90c76bca11f39e530c3b3b839625;hb=746665e89cf66c5688cd584555168bb8323b824e;hp=69c494e09043528f50347c2b0b0f64ad32d1a863;hpb=52003be3695ab703b936163d7284e208790d5363;p=ardour.git diff --git a/gtk2_ardour/export_format_dialog.cc b/gtk2_ardour/export_format_dialog.cc index 69c494e090..6062d51500 100644 --- a/gtk2_ardour/export_format_dialog.cc +++ b/gtk2_ardour/export_format_dialog.cc @@ -18,12 +18,17 @@ */ +#include + #include "ardour/session.h" #include "ardour/export_format_specification.h" +#include "widgets/tooltips.h" + #include "export_format_dialog.h" #include "gui_thread.h" -#include "i18n.h" + +#include "pbd/i18n.h" using namespace ARDOUR; @@ -38,9 +43,16 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : 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")), @@ -51,8 +63,7 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : silence_end_checkbox (_("Add silence at end:")), silence_end_clock ("silence_end", true, "", true, false, true), - upload_checkbox(_("Upload to Soundcloud")), - command_label(_("Command to run post-export\n(%f=full path & filename, %d=directory, %b=basename, %u=username, %p=password):")), + 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), @@ -70,6 +81,7 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : 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")) { @@ -95,11 +107,29 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : /* 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_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); - normalize_spinbutton.configure (normalize_adjustment, 0.1, 2); + ArdourWidgets::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 */ @@ -116,10 +146,38 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : silence_table.attach (silence_end_checkbox, 1, 2, 2, 3); silence_table.attach (silence_end_clock, 2, 3, 2, 3); - get_vbox()->pack_start (upload_checkbox, false, false); + /* Post-export hook script */ + get_vbox()->pack_start (command_label, false, false); get_vbox()->pack_start (command_entry, false, false); + ArdourWidgets::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(); @@ -149,11 +207,12 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : 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)); - upload_checkbox.signal_toggled().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_upload)); + 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 */ @@ -169,7 +228,11 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : 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)); @@ -199,6 +262,7 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : /* Finalize */ show_all_children(); + update_normalize_sensitivity (); } ExportFormatDialog::~ExportFormatDialog () @@ -250,7 +314,11 @@ ExportFormatDialog::load_state (FormatPtr spec) 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(); @@ -262,6 +330,7 @@ ExportFormatDialog::load_state (FormatPtr spec) 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()) { @@ -304,8 +373,8 @@ ExportFormatDialog::load_state (FormatPtr spec) } } + update_normalize_sensitivity (); tag_checkbox.set_active (spec->tag()); - upload_checkbox.set_active (spec->upload()); command_entry.set_text (spec->command()); } @@ -729,9 +798,9 @@ ExportFormatDialog::update_with_toc () } void -ExportFormatDialog::update_upload () +ExportFormatDialog::update_with_mp4chaps () { - manager.select_upload (upload_checkbox.get_active()); + manager.select_with_mp4chaps (with_mp4chaps.get_active()); } void @@ -765,11 +834,25 @@ ExportFormatDialog::update_trim_end_selection () 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