From a7a389407b110c18f78b1d9fd033b097b6d7e1c1 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 18 Nov 2020 19:26:45 +0100 Subject: [PATCH] NO-OP: whitespace --- gtk2_ardour/export_format_dialog.cc | 751 ++++++++++++++-------------- 1 file changed, 370 insertions(+), 381 deletions(-) diff --git a/gtk2_ardour/export_format_dialog.cc b/gtk2_ardour/export_format_dialog.cc index cadb39c426..dcce820f2c 100644 --- a/gtk2_ardour/export_format_dialog.cc +++ b/gtk2_ardour/export_format_dialog.cc @@ -21,11 +21,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include #include +#include -#include "ardour/session.h" #include "ardour/export_format_specification.h" +#include "ardour/session.h" #include "widgets/tooltips.h" @@ -36,86 +36,84 @@ using namespace ARDOUR; -ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : - ArdourDialog (new_dialog ? _("New Export Format Profile") : _("Edit Export Format Profile")), - format (format), - manager (format), - original_state (format->get_state()), +ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) + : ArdourDialog (new_dialog ? _("New Export Format Profile") : _("Edit Export Format Profile")) - applying_changes_from_engine (0), + , format (format) + , manager (format) + , original_state (format->get_state ()) - name_label (_("Label: "), Gtk::ALIGN_LEFT), - name_generated_part ("", Gtk::ALIGN_LEFT), + , applying_changes_from_engine (0) - 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), + , name_label (_("Label: "), Gtk::ALIGN_LEFT) + , name_generated_part ("", Gtk::ALIGN_LEFT) - normalize_dbfs_label (_("dBFS"), Gtk::ALIGN_LEFT), - normalize_lufs_label (_("LUFS"), Gtk::ALIGN_LEFT), - normalize_dbtp_label (_("dBTP"), 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) - silence_table (2, 4), - trim_start_checkbox (_("Trim silence at start")), - silence_start_checkbox (_("Add silence at start:")), - silence_start_clock ("silence_start", true, "", true, false, true), + , normalize_dbfs_label (_("dBFS"), Gtk::ALIGN_LEFT) + , normalize_lufs_label (_("LUFS"), Gtk::ALIGN_LEFT) + , normalize_dbtp_label (_("dBTP"), Gtk::ALIGN_LEFT) - trim_end_checkbox (_("Trim silence at end")), - silence_end_checkbox (_("Add silence at end:")), - silence_end_clock ("silence_end", true, "", true, false, true), + , silence_table (2, 4) + , trim_start_checkbox (_("Trim silence at start")) + , silence_start_checkbox (_("Add silence at start:")) + , silence_start_clock ("silence_start", 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), + , trim_end_checkbox (_("Trim silence at end")) + , silence_end_checkbox (_("Add silence at end:")) + , silence_end_clock ("silence_end", true, "", true, false, true) - format_table (3, 4), - compatibility_label (_("Compatibility"), Gtk::ALIGN_LEFT), - quality_label (_("Quality"), Gtk::ALIGN_LEFT), - format_label (_("File format"), Gtk::ALIGN_LEFT), - sample_rate_label (_("Sample rate"), Gtk::ALIGN_LEFT), + , command_label (_("Command to run post-export\n(%f=file path, %d=directory, %b=basename, see tooltip for more):"), Gtk::ALIGN_LEFT) - src_quality_label (_("Sample rate conversion quality:"), Gtk::ALIGN_RIGHT), + , format_table (3, 4) + , compatibility_label (_("Compatibility"), Gtk::ALIGN_LEFT) + , quality_label (_("Quality"), Gtk::ALIGN_LEFT) + , format_label (_("File format"), Gtk::ALIGN_LEFT) + , sample_rate_label (_("Sample rate"), Gtk::ALIGN_LEFT) - /* Watermarking */ - watermark_heading (_("Preview / Watermark"), Gtk::ALIGN_LEFT), + , src_quality_label (_("Sample rate conversion quality:"), Gtk::ALIGN_RIGHT) - demo_noise_mode_label (_("Mode:"), Gtk::ALIGN_LEFT), - demo_noise_level_label (_("Noise Level:"), Gtk::ALIGN_LEFT), - demo_noise_dbfs_unit (_("dBFS"), Gtk::ALIGN_LEFT), + /* Watermarking */ + , watermark_heading (_("Preview / Watermark"), Gtk::ALIGN_LEFT) - demo_noise_dbfs_adjustment ( -20.0, -90.00, -6.00, 1, 5), - demo_noise_dbfs_spinbutton (demo_noise_dbfs_adjustment, 1, 0), + , demo_noise_mode_label (_("Mode:"), Gtk::ALIGN_LEFT) + , demo_noise_level_label (_("Noise Level:"), Gtk::ALIGN_LEFT) + , demo_noise_dbfs_unit (_("dBFS"), Gtk::ALIGN_LEFT) - /* Changing encoding options from here on */ + , demo_noise_dbfs_adjustment (-20.0, -90.00, -6.00, 1, 5) + , demo_noise_dbfs_spinbutton (demo_noise_dbfs_adjustment, 1, 0) - encoding_options_label ("", Gtk::ALIGN_LEFT), + /* Changing encoding options from here on */ + , encoding_options_label ("", Gtk::ALIGN_LEFT) - /* Changing encoding options from here on */ + /* Changing encoding options from here on */ + , sample_format_label (_("Sample Format"), Gtk::ALIGN_LEFT) + , dither_label (_("Dithering"), 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")) + , 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")) { /* Name, new and remove */ name_hbox.pack_start (name_label, false, false, 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()); + name_entry.set_width_chars (20); + update_description (); + manager.DescriptionChanged.connect ( + *this, invalidator (*this), + boost::bind (&ExportFormatDialog::update_description, this), gui_context ()); /* Normalize */ - Gtk::RadioButtonGroup normalize_group = normalize_loudness_rb.get_group(); + 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); @@ -133,7 +131,7 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : normalize_hbox.pack_start (normalize_dbtp_label, false, false, 0); 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 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); @@ -159,35 +157,34 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : command_box.pack_start (command_entry, false, false, 6); 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" - )); + _( + "%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(); + init_format_table (); /* SRC */ @@ -196,16 +193,16 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : /* Watermark */ - watermark_options_table.attach (watermark_heading, 0, 3, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); + watermark_options_table.attach (watermark_heading, 0, 3, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); watermark_options_table.attach (demo_noise_mode_label, 0, 1, 1, 2, Gtk::FILL, Gtk::SHRINK); - watermark_options_table.attach (demo_noise_combo, 1, 3, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); + watermark_options_table.attach (demo_noise_combo, 1, 3, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); watermark_options_table.attach (demo_noise_level_label, 0, 1, 2, 3, Gtk::FILL, Gtk::SHRINK); watermark_options_table.attach (demo_noise_dbfs_spinbutton, 1, 2, 2, 3, Gtk::FILL, Gtk::SHRINK); - watermark_options_table.attach (demo_noise_dbfs_unit, 2, 3, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); + watermark_options_table.attach (demo_noise_dbfs_unit, 2, 3, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); /* Encoding options */ - init_encoding_option_widgets(); + init_encoding_option_widgets (); encoding_options_table.set_spacings (1); @@ -213,7 +210,7 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : encoding_options_vbox.pack_start (encoding_options_table, false, false, 12); encoding_options_vbox.pack_end (src_quality_box, false, false); - Pango::AttrList bold; + Pango::AttrList bold; Pango::Attribute b = Pango::Attribute::create_attr_weight (Pango::WEIGHT_BOLD); bold.insert (b); encoding_options_label.set_attributes (bold); @@ -228,16 +225,16 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : /* Buttons */ revert_button = add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - revert_button->signal_clicked().connect (sigc::mem_fun(*this, &ExportFormatDialog::revert)); + revert_button->signal_clicked ().connect (sigc::mem_fun (*this, &ExportFormatDialog::revert)); 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), boost::bind (&Gtk::Button::set_sensitive, close_button, _1), gui_context()); + close_button->signal_clicked ().connect (sigc::mem_fun (*this, &ExportFormatDialog::end_dialog)); + 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)); + 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)); metadata_table.attach (tag_checkbox, 0, 1, 0, 1); metadata_table.attach (with_mp4chaps, 0, 1, 1, 2); @@ -250,64 +247,64 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : /* Name entry */ - name_entry.signal_changed().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_name)); + name_entry.signal_changed ().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_name)); /* Normalize, silence and src_quality signals */ - trim_start_checkbox.signal_toggled().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_trim_start_selection)); - trim_end_checkbox.signal_toggled().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_trim_end_selection)); + trim_start_checkbox.signal_toggled ().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_trim_start_selection)); + 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_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)); + normalize_checkbox.signal_toggled ().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_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)); - silence_end_checkbox.signal_toggled().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_silence_end_selection)); + silence_end_checkbox.signal_toggled ().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_silence_end_selection)); silence_end_clock.ValueChanged.connect (sigc::mem_fun (*this, &ExportFormatDialog::update_silence_end_selection)); - src_quality_combo.signal_changed().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_src_quality_selection)); - codec_quality_combo.signal_changed().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_codec_quality_selection)); + src_quality_combo.signal_changed ().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_src_quality_selection)); + codec_quality_combo.signal_changed ().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_codec_quality_selection)); watermark_heading.set_attributes (bold); - demo_noise_combo.signal_changed().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_demo_noise_selection)); - demo_noise_dbfs_spinbutton.signal_value_changed().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_demo_noise_selection)); + demo_noise_combo.signal_changed ().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_demo_noise_selection)); + demo_noise_dbfs_spinbutton.signal_value_changed ().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_demo_noise_selection)); /* Format table signals */ - Gtk::CellRendererToggle *toggle = dynamic_cast(compatibility_view.get_column_cell_renderer (0)); - toggle->signal_toggled().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_compatibility_selection)); - compatibility_select_connection = compatibility_view.get_selection()->signal_changed().connect (sigc::mem_fun (*this, &ExportFormatDialog::prohibit_compatibility_selection)); + Gtk::CellRendererToggle* toggle = dynamic_cast (compatibility_view.get_column_cell_renderer (0)); + toggle->signal_toggled ().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_compatibility_selection)); + compatibility_select_connection = compatibility_view.get_selection ()->signal_changed ().connect (sigc::mem_fun (*this, &ExportFormatDialog::prohibit_compatibility_selection)); - quality_view.get_selection()->signal_changed().connect (sigc::mem_fun(*this, &ExportFormatDialog::update_quality_selection)); - format_view.get_selection()->signal_changed().connect (sigc::mem_fun(*this, &ExportFormatDialog::update_format_selection)); - sample_rate_view.get_selection()->signal_changed().connect (sigc::mem_fun(*this, &ExportFormatDialog::update_sample_rate_selection)); + quality_view.get_selection ()->signal_changed ().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_quality_selection)); + format_view.get_selection ()->signal_changed ().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_format_selection)); + sample_rate_view.get_selection ()->signal_changed ().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_sample_rate_selection)); /* Encoding option signals */ - sample_format_view.get_selection()->signal_changed().connect (sigc::mem_fun(*this, &ExportFormatDialog::update_sample_format_selection)); - dither_type_view.get_selection()->signal_changed().connect (sigc::mem_fun(*this, &ExportFormatDialog::update_dither_type_selection)); + sample_format_view.get_selection ()->signal_changed ().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_sample_format_selection)); + dither_type_view.get_selection ()->signal_changed ().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_dither_type_selection)); - tag_checkbox.signal_toggled().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_tagging_selection)); + tag_checkbox.signal_toggled ().connect (sigc::mem_fun (*this, &ExportFormatDialog::update_tagging_selection)); /* Pack containers in dialog */ Gtk::Frame* f; Gtk::Table* g = manage (new Gtk::Table); g->set_spacings (6); - get_vbox()->pack_start (*g); + get_vbox ()->pack_start (*g); - g->attach (name_hbox, 0, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); + g->attach (name_hbox, 0, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); f = manage (new Gtk::Frame (_("Pre Process"))); f->add (silence_table); - g->attach (*f, 0, 1, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); + g->attach (*f, 0, 1, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); f = manage (new Gtk::Frame (_("Watermark"))); f->add (watermark_options_table); - g->attach (*f, 1, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::FILL); + g->attach (*f, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::FILL); f = manage (new Gtk::Frame (_("Format"))); f->add (format_table); @@ -319,21 +316,20 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : f = manage (new Gtk::Frame (_("Metadata"))); f->add (metadata_table); - g->attach (*f, 0, 2, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); + g->attach (*f, 0, 2, 3, 4, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); f = manage (new Gtk::Frame (_("Post Export"))); f->add (command_box); - g->attach (*f, 0, 2, 4, 5, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); + g->attach (*f, 0, 2, 4, 5, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); /* Finalize */ - show_all_children(); + show_all_children (); update_normalize_sensitivity (); } ExportFormatDialog::~ExportFormatDialog () { - } void @@ -363,11 +359,11 @@ ExportFormatDialog::set_session (ARDOUR::Session* s) /* Select native samplerate if no selection is yet made */ - if (sample_rate_view.get_selection()->count_selected_rows() == 0) { + if (sample_rate_view.get_selection ()->count_selected_rows () == 0) { Gtk::ListStore::Children::iterator it; - for (it = sample_rate_list->children().begin(); it != sample_rate_list->children().end(); ++it) { - if ((samplecnt_t) (*it)->get_value (sample_rate_cols.ptr)->rate == _session->nominal_sample_rate()) { - sample_rate_view.get_selection()->select (it); + for (it = sample_rate_list->children ().begin (); it != sample_rate_list->children ().end (); ++it) { + if ((samplecnt_t) (*it)->get_value (sample_rate_cols.ptr)->rate == _session->nominal_sample_rate ()) { + sample_rate_view.get_selection ()->select (it); break; } } @@ -377,31 +373,30 @@ ExportFormatDialog::set_session (ARDOUR::Session* s) void ExportFormatDialog::load_state (FormatPtr spec) { - name_entry.set_text (spec->name()); + name_entry.set_text (spec->name ()); - normalize_checkbox.set_active (spec->normalize()); - 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()); + normalize_checkbox.set_active (spec->normalize ()); + 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_start_checkbox.set_active (spec->silence_beginning_time().not_zero()); + trim_start_checkbox.set_active (spec->trim_beginning ()); + silence_start = spec->silence_beginning_time (); + silence_start_checkbox.set_active (spec->silence_beginning_time ().not_zero ()); - trim_end_checkbox.set_active (spec->trim_end()); - silence_end = spec->silence_end_time(); - silence_end_checkbox.set_active (spec->silence_end_time().not_zero()); + trim_end_checkbox.set_active (spec->trim_end ()); + 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()); + with_cue.set_active (spec->with_cue ()); + with_toc.set_active (spec->with_toc ()); + with_mp4chaps.set_active (spec->with_mp4chaps ()); demo_noise_combo.set_active (0); - for (Gtk::ListStore::Children::iterator it = demo_noise_list->children().begin(); it != demo_noise_list->children().end(); ++it) { - if (it->get_value (demo_noise_cols.interval) == spec->demo_noise_interval () - && it->get_value (demo_noise_cols.duration) == spec->demo_noise_duration ()) { + for (Gtk::ListStore::Children::iterator it = demo_noise_list->children ().begin (); it != demo_noise_list->children ().end (); ++it) { + if (it->get_value (demo_noise_cols.interval) == spec->demo_noise_interval () && it->get_value (demo_noise_cols.duration) == spec->demo_noise_duration ()) { demo_noise_combo.set_active (it); break; } @@ -410,48 +405,47 @@ ExportFormatDialog::load_state (FormatPtr spec) demo_noise_dbfs_spinbutton.set_value (spec->demo_noise_level ()); update_demo_noise_sensitivity (); - 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()) { + 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); break; } } - for (Gtk::ListStore::Children::iterator it = codec_quality_list->children().begin(); it != codec_quality_list->children().end(); ++it) { - if (it->get_value (codec_quality_cols.quality) == spec->codec_quality()) { + for (Gtk::ListStore::Children::iterator it = codec_quality_list->children ().begin (); it != codec_quality_list->children ().end (); ++it) { + if (it->get_value (codec_quality_cols.quality) == spec->codec_quality ()) { codec_quality_combo.set_active (it); break; } } - for (Gtk::ListStore::Children::iterator it = format_list->children().begin(); it != format_list->children().end(); ++it) { + for (Gtk::ListStore::Children::iterator it = format_list->children ().begin (); it != format_list->children ().end (); ++it) { boost::shared_ptr format_in_list = it->get_value (format_cols.ptr); - if (format_in_list->get_format_id() == spec->format_id() && + if (format_in_list->get_format_id () == spec->format_id () && // BWF has the same format id with wav, so we need to check this. - format_in_list->has_broadcast_info() == spec->has_broadcast_info()) { - + format_in_list->has_broadcast_info () == spec->has_broadcast_info ()) { format_in_list->set_selected (true); break; } } - for (Gtk::ListStore::Children::iterator it = sample_rate_list->children().begin(); it != sample_rate_list->children().end(); ++it) { - if (it->get_value (sample_rate_cols.ptr)->rate == spec->sample_rate()) { + for (Gtk::ListStore::Children::iterator it = sample_rate_list->children ().begin (); it != sample_rate_list->children ().end (); ++it) { + if (it->get_value (sample_rate_cols.ptr)->rate == spec->sample_rate ()) { it->get_value (sample_rate_cols.ptr)->set_selected (true); break; } } - if (spec->sample_format()) { - for (Gtk::ListStore::Children::iterator it = sample_format_list->children().begin(); it != sample_format_list->children().end(); ++it) { - if (it->get_value (sample_format_cols.ptr)->format == spec->sample_format()) { + if (spec->sample_format ()) { + for (Gtk::ListStore::Children::iterator it = sample_format_list->children ().begin (); it != sample_format_list->children ().end (); ++it) { + if (it->get_value (sample_format_cols.ptr)->format == spec->sample_format ()) { it->get_value (sample_format_cols.ptr)->set_selected (true); break; } } - for (Gtk::ListStore::Children::iterator it = dither_type_list->children().begin(); it != dither_type_list->children().end(); ++it) { - if (it->get_value (dither_type_cols.ptr)->type == spec->dither_type()) { + for (Gtk::ListStore::Children::iterator it = dither_type_list->children ().begin (); it != dither_type_list->children ().end (); ++it) { + if (it->get_value (dither_type_cols.ptr)->type == spec->dither_type ()) { it->get_value (dither_type_cols.ptr)->set_selected (true); break; } @@ -459,25 +453,24 @@ ExportFormatDialog::load_state (FormatPtr spec) } update_normalize_sensitivity (); - tag_checkbox.set_active (spec->tag()); - command_entry.set_text (spec->command()); + tag_checkbox.set_active (spec->tag ()); + command_entry.set_text (spec->command ()); } void ExportFormatDialog::init_format_table () { - format_table.set_spacings (1); - format_table.attach (compatibility_label, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); - format_table.attach (quality_label, 1, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); - format_table.attach (format_label, 2, 3, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); - format_table.attach (sample_rate_label, 3, 4, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); + format_table.attach (compatibility_label, 0, 1, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); + format_table.attach (quality_label, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); + format_table.attach (format_label, 2, 3, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); + format_table.attach (sample_rate_label, 3, 4, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK); - format_table.attach (compatibility_view, 0, 1, 1, 2); - format_table.attach (quality_view, 1, 2, 1, 2); - format_table.attach (format_view, 2, 3, 1, 2); - format_table.attach (sample_rate_view, 3, 4, 1, 2); + format_table.attach (compatibility_view, 0, 1, 1, 2); + format_table.attach (quality_view, 1, 2, 1, 2); + format_table.attach (format_view, 2, 3, 1, 2); + format_table.attach (sample_rate_view, 3, 4, 1, 2); compatibility_view.set_headers_visible (false); quality_view.set_headers_visible (false); @@ -487,54 +480,54 @@ ExportFormatDialog::init_format_table () /*** Table entries ***/ Gtk::TreeModel::iterator iter; - Gtk::TreeModel::Row row; + Gtk::TreeModel::Row row; /* Compatibilities */ compatibility_list = Gtk::ListStore::create (compatibility_cols); compatibility_view.set_model (compatibility_list); - ExportFormatManager::CompatList const & compat_list = manager.get_compatibilities(); + ExportFormatManager::CompatList const& compat_list = manager.get_compatibilities (); - for (ExportFormatManager::CompatList::const_iterator it = compat_list.begin(); it != compat_list.end(); ++it) { - iter = compatibility_list->append(); - row = *iter; + for (ExportFormatManager::CompatList::const_iterator it = compat_list.begin (); it != compat_list.end (); ++it) { + iter = compatibility_list->append (); + row = *iter; - row[compatibility_cols.ptr] = *it; + row[compatibility_cols.ptr] = *it; row[compatibility_cols.selected] = false; - row[compatibility_cols.label] = (*it)->name(); + row[compatibility_cols.label] = (*it)->name (); WeakCompatPtr ptr (*it); - (*it)->SelectChanged.connect (*this, invalidator (*this), boost::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); Gtk::CellRendererText* text_renderer = Gtk::manage (new Gtk::CellRendererText); - text_renderer->property_editable() = false; + text_renderer->property_editable () = false; Gtk::TreeView::Column* column = compatibility_view.get_column (0); column->pack_start (*text_renderer); - column->add_attribute (text_renderer->property_text(), compatibility_cols.label); + column->add_attribute (text_renderer->property_text (), compatibility_cols.label); /* Qualities */ quality_list = Gtk::ListStore::create (quality_cols); quality_view.set_model (quality_list); - ExportFormatManager::QualityList const & qualities = manager.get_qualities (); + ExportFormatManager::QualityList const& qualities = manager.get_qualities (); - for (ExportFormatManager::QualityList::const_iterator it = qualities.begin(); it != qualities.end(); ++it) { - iter = quality_list->append(); - row = *iter; + for (ExportFormatManager::QualityList::const_iterator it = qualities.begin (); it != qualities.end (); ++it) { + iter = quality_list->append (); + row = *iter; - row[quality_cols.ptr] = *it; + row[quality_cols.ptr] = *it; row[quality_cols.color] = "white"; - row[quality_cols.label] = (*it)->name(); + row[quality_cols.label] = (*it)->name (); WeakQualityPtr ptr (*it); - (*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()); + (*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); @@ -544,30 +537,30 @@ ExportFormatDialog::init_format_table () format_list = Gtk::ListStore::create (format_cols); format_view.set_model (format_list); - ExportFormatManager::FormatList const & formats = manager.get_formats (); + ExportFormatManager::FormatList const& formats = manager.get_formats (); - for (ExportFormatManager::FormatList::const_iterator it = formats.begin(); it != formats.end(); ++it) { - iter = format_list->append(); - row = *iter; + for (ExportFormatManager::FormatList::const_iterator it = formats.begin (); it != formats.end (); ++it) { + iter = format_list->append (); + row = *iter; - row[format_cols.ptr] = *it; + row[format_cols.ptr] = *it; row[format_cols.color] = "white"; - row[format_cols.label] = (*it)->name(); + row[format_cols.label] = (*it)->name (); WeakFormatPtr ptr (*it); - (*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()); + (*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 hsf; if ((hsf = boost::dynamic_pointer_cast (*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->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), 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()); + 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 ()); } } @@ -578,68 +571,68 @@ ExportFormatDialog::init_format_table () sample_rate_list = Gtk::ListStore::create (sample_rate_cols); sample_rate_view.set_model (sample_rate_list); - ExportFormatManager::SampleRateList const & rates = manager.get_sample_rates (); + ExportFormatManager::SampleRateList const& rates = manager.get_sample_rates (); - for (ExportFormatManager::SampleRateList::const_iterator it = rates.begin(); it != rates.end(); ++it) { - iter = sample_rate_list->append(); - row = *iter; + for (ExportFormatManager::SampleRateList::const_iterator it = rates.begin (); it != rates.end (); ++it) { + iter = sample_rate_list->append (); + row = *iter; - row[sample_rate_cols.ptr] = *it; + row[sample_rate_cols.ptr] = *it; row[sample_rate_cols.color] = "white"; - row[sample_rate_cols.label] = (*it)->name(); + row[sample_rate_cols.label] = (*it)->name (); WeakSampleRatePtr ptr (*it); - (*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()); + (*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); /* Color rendering */ - Gtk::TreeViewColumn * label_col; - Gtk::CellRendererText * renderer; + Gtk::TreeViewColumn* label_col; + Gtk::CellRendererText* renderer; - label_col = quality_view.get_column(0); - renderer = dynamic_cast (quality_view.get_column_cell_renderer (0)); - label_col->add_attribute(renderer->property_foreground(), quality_cols.color); + label_col = quality_view.get_column (0); + renderer = dynamic_cast (quality_view.get_column_cell_renderer (0)); + label_col->add_attribute (renderer->property_foreground (), quality_cols.color); - label_col = format_view.get_column(0); - renderer = dynamic_cast (format_view.get_column_cell_renderer (0)); - label_col->add_attribute(renderer->property_foreground(), format_cols.color); + label_col = format_view.get_column (0); + renderer = dynamic_cast (format_view.get_column_cell_renderer (0)); + label_col->add_attribute (renderer->property_foreground (), format_cols.color); - label_col = sample_rate_view.get_column(0); - renderer = dynamic_cast (sample_rate_view.get_column_cell_renderer (0)); - label_col->add_attribute(renderer->property_foreground(), sample_rate_cols.color); + label_col = sample_rate_view.get_column (0); + renderer = dynamic_cast (sample_rate_view.get_column_cell_renderer (0)); + label_col->add_attribute (renderer->property_foreground (), sample_rate_cols.color); /* SRC Qualities */ src_quality_list = Gtk::ListStore::create (src_quality_cols); src_quality_combo.set_model (src_quality_list); - iter = src_quality_list->append(); - row = *iter; - row[src_quality_cols.id] = ExportFormatBase::SRC_SincBest; + iter = src_quality_list->append (); + row = *iter; + row[src_quality_cols.id] = ExportFormatBase::SRC_SincBest; row[src_quality_cols.label] = _("Best (sinc)"); - iter = src_quality_list->append(); - row = *iter; - row[src_quality_cols.id] = ExportFormatBase::SRC_SincMedium; + iter = src_quality_list->append (); + row = *iter; + row[src_quality_cols.id] = ExportFormatBase::SRC_SincMedium; row[src_quality_cols.label] = _("Medium (sinc)"); - iter = src_quality_list->append(); - row = *iter; - row[src_quality_cols.id] = ExportFormatBase::SRC_SincFast; + iter = src_quality_list->append (); + row = *iter; + row[src_quality_cols.id] = ExportFormatBase::SRC_SincFast; row[src_quality_cols.label] = _("Fast (sinc)"); - iter = src_quality_list->append(); - row = *iter; - row[src_quality_cols.id] = ExportFormatBase::SRC_Linear; + iter = src_quality_list->append (); + row = *iter; + row[src_quality_cols.id] = ExportFormatBase::SRC_Linear; row[src_quality_cols.label] = _("Linear"); - iter = src_quality_list->append(); - row = *iter; - row[src_quality_cols.id] = ExportFormatBase::SRC_ZeroOrderHold; + iter = src_quality_list->append (); + row = *iter; + row[src_quality_cols.id] = ExportFormatBase::SRC_ZeroOrderHold; row[src_quality_cols.label] = _("Zero order hold"); src_quality_combo.pack_start (src_quality_cols.label); @@ -650,72 +643,69 @@ ExportFormatDialog::init_format_table () demo_noise_list = Gtk::ListStore::create (demo_noise_cols); demo_noise_combo.set_model (demo_noise_list); - iter = demo_noise_list->append(); - row = *iter; + iter = demo_noise_list->append (); + row = *iter; row[demo_noise_cols.duration] = 0; row[demo_noise_cols.interval] = 0; - row[demo_noise_cols.label] = _("No Watermark"); + row[demo_noise_cols.label] = _("No Watermark"); - iter = demo_noise_list->append(); - row = *iter; + iter = demo_noise_list->append (); + row = *iter; row[demo_noise_cols.duration] = 500; row[demo_noise_cols.interval] = 15000; - row[demo_noise_cols.label] = _("1/2 sec white noise every 15 sec"); + row[demo_noise_cols.label] = _("1/2 sec white noise every 15 sec"); - iter = demo_noise_list->append(); - row = *iter; + iter = demo_noise_list->append (); + row = *iter; row[demo_noise_cols.duration] = 1000; row[demo_noise_cols.interval] = 30000; - row[demo_noise_cols.label] = _("1 sec white noise every 30 sec"); + row[demo_noise_cols.label] = _("1 sec white noise every 30 sec"); - iter = demo_noise_list->append(); - row = *iter; + iter = demo_noise_list->append (); + row = *iter; row[demo_noise_cols.duration] = 1000; row[demo_noise_cols.interval] = 1200000; - row[demo_noise_cols.label] = _("1 sec white noise every 2 mins"); + row[demo_noise_cols.label] = _("1 sec white noise every 2 mins"); demo_noise_combo.pack_start (demo_noise_cols.label); demo_noise_combo.set_active (0); ArdourWidgets::set_tooltip (demo_noise_combo, - _("This option allows to add noise, to send complete mixes to the clients for preview but watermarked. White noise is injected after analysis, right before the sample-format conversion or encoding. The first noise burst happens at 1/3 of the interval. Note: there is currently no limiter.")); + _("This option allows to add noise, to send complete mixes to the clients for preview but watermarked. White noise is injected after analysis, right before the sample-format conversion or encoding. The first noise burst happens at 1/3 of the interval. Note: there is currently no limiter.")); } void ExportFormatDialog::init_encoding_option_widgets () { - Gtk::TreeViewColumn * label_col; - Gtk::CellRendererText * renderer; + Gtk::TreeViewColumn* label_col; + Gtk::CellRendererText* renderer; sample_format_list = Gtk::ListStore::create (sample_format_cols); sample_format_view.set_model (sample_format_list); sample_format_view.set_headers_visible (false); sample_format_view.append_column ("", sample_format_cols.label); - label_col = sample_format_view.get_column(0); - renderer = dynamic_cast (sample_format_view.get_column_cell_renderer (0)); - label_col->add_attribute(renderer->property_foreground(), sample_format_cols.color); + label_col = sample_format_view.get_column (0); + renderer = dynamic_cast (sample_format_view.get_column_cell_renderer (0)); + label_col->add_attribute (renderer->property_foreground (), sample_format_cols.color); dither_type_list = Gtk::ListStore::create (dither_type_cols); dither_type_view.set_model (dither_type_list); dither_type_view.set_headers_visible (false); dither_type_view.append_column ("", dither_type_cols.label); - label_col = dither_type_view.get_column(0); - renderer = dynamic_cast (dither_type_view.get_column_cell_renderer (0)); - label_col->add_attribute(renderer->property_foreground(), dither_type_cols.color); - + label_col = dither_type_view.get_column (0); + renderer = dynamic_cast (dither_type_view.get_column_cell_renderer (0)); + label_col->add_attribute (renderer->property_foreground (), dither_type_cols.color); } void -ExportFormatDialog::update_compatibility_selection (std::string const & path) +ExportFormatDialog::update_compatibility_selection (std::string const& path) { - - Gtk::TreeModel::iterator iter = compatibility_view.get_model ()->get_iter (path); - ExportFormatCompatibilityPtr ptr = iter->get_value (compatibility_cols.ptr); - bool state = iter->get_value (compatibility_cols.selected); + Gtk::TreeModel::iterator iter = compatibility_view.get_model ()->get_iter (path); + ExportFormatCompatibilityPtr ptr = iter->get_value (compatibility_cols.ptr); + bool state = iter->get_value (compatibility_cols.selected); iter->set_value (compatibility_cols.selected, state); ptr->set_selected (state); - } void @@ -748,18 +738,18 @@ ExportFormatDialog::update_dither_type_selection () update_selection (dither_type_list, dither_type_view, dither_type_cols); } -template +template void -ExportFormatDialog::update_selection (Glib::RefPtr & list, Gtk::TreeView & view, ColsT & cols) +ExportFormatDialog::update_selection (Glib::RefPtr& list, Gtk::TreeView& view, ColsT& cols) { if (applying_changes_from_engine) { return; } Gtk::ListStore::Children::iterator it; - Glib::RefPtr selection = view.get_selection(); + Glib::RefPtr selection = view.get_selection (); - for (it = list->children().begin(); it != list->children().end(); ++it) { + for (it = list->children ().begin (); it != list->children ().end (); ++it) { bool selected = selection->is_selected (it); it->get_value (cols.ptr)->set_selected (selected); } @@ -772,9 +762,9 @@ ExportFormatDialog::change_compatibility_selection (bool select, WeakCompatPtr c { ++applying_changes_from_engine; - ExportFormatCompatibilityPtr ptr = compat.lock(); + ExportFormatCompatibilityPtr ptr = compat.lock (); - for (Gtk::ListStore::Children::iterator it = compatibility_list->children().begin(); it != compatibility_list->children().end(); ++it) { + for (Gtk::ListStore::Children::iterator it = compatibility_list->children ().begin (); it != compatibility_list->children ().end (); ++it) { if (it->get_value (compatibility_cols.ptr) == ptr) { it->set_value (compatibility_cols.selected, select); break; @@ -795,7 +785,7 @@ ExportFormatDialog::change_format_selection (bool select, WeakFormatPtr format) { change_selection (select, format, format_list, format_view, format_cols); - ExportFormatPtr ptr = format.lock(); + ExportFormatPtr ptr = format.lock (); if (select && ptr) { change_encoding_options (ptr); @@ -808,9 +798,9 @@ ExportFormatDialog::change_sample_rate_selection (bool select, WeakSampleRatePtr change_selection (select, rate, sample_rate_list, sample_rate_view, sample_rate_cols); if (select) { - ExportFormatManager::SampleRatePtr ptr = rate.lock(); + ExportFormatManager::SampleRatePtr ptr = rate.lock (); if (ptr && _session) { - src_quality_combo.set_sensitive ((uint32_t) ptr->rate != _session->sample_rate() && ptr->rate != ExportFormatBase::SR_Session); + src_quality_combo.set_sensitive ((uint32_t)ptr->rate != _session->sample_rate () && ptr->rate != ExportFormatBase::SR_Session); } } } @@ -827,23 +817,23 @@ ExportFormatDialog::change_dither_type_selection (bool select, WeakDitherTypePtr change_selection (select, type, dither_type_list, dither_type_view, dither_type_cols); } -template +template void -ExportFormatDialog::change_selection (bool select, boost::weak_ptr w_ptr, Glib::RefPtr & list, Gtk::TreeView & view, ColsT & cols) +ExportFormatDialog::change_selection (bool select, boost::weak_ptr w_ptr, Glib::RefPtr& list, Gtk::TreeView& view, ColsT& cols) { ++applying_changes_from_engine; - boost::shared_ptr ptr = w_ptr.lock(); + boost::shared_ptr ptr = w_ptr.lock (); Gtk::ListStore::Children::iterator it; - Glib::RefPtr selection; + Glib::RefPtr selection; - selection = view.get_selection(); + selection = view.get_selection (); if (!ptr) { - selection->unselect_all(); + selection->unselect_all (); } else { - for (it = list->children().begin(); it != list->children().end(); ++it) { + for (it = list->children ().begin (); it != list->children ().end (); ++it) { if (it->get_value (cols.ptr) == ptr) { if (select) { selection->select (it); @@ -888,15 +878,15 @@ ExportFormatDialog::change_dither_type_compatibility (bool compatibility, WeakDi change_compatibility (compatibility, type, dither_type_list, dither_type_cols, "red"); } -template +template void -ExportFormatDialog::change_compatibility (bool compatibility, boost::weak_ptr w_ptr, Glib::RefPtr & list, ColsT & cols, - std::string const & c_incompatible, std::string const & c_compatible) +ExportFormatDialog::change_compatibility (bool compatibility, boost::weak_ptr w_ptr, Glib::RefPtr& list, ColsT& cols, + std::string const& c_incompatible, std::string const& c_compatible) { - boost::shared_ptr ptr = w_ptr.lock(); + boost::shared_ptr ptr = w_ptr.lock (); Gtk::ListStore::Children::iterator it; - for (it = list->children().begin(); it != list->children().end(); ++it) { + for (it = list->children ().begin (); it != list->children ().end (); ++it) { if (it->get_value (cols.ptr) == ptr) { it->set_value (cols.color, compatibility ? c_compatible : c_incompatible); break; @@ -907,57 +897,57 @@ ExportFormatDialog::change_compatibility (bool compatibility, boost::weak_ptr void ExportFormatDialog::update_with_cue () { - manager.select_with_cue (with_cue.get_active()); + manager.select_with_cue (with_cue.get_active ()); } void ExportFormatDialog::update_with_toc () { - manager.select_with_toc (with_toc.get_active()); + manager.select_with_toc (with_toc.get_active ()); } void ExportFormatDialog::update_with_mp4chaps () { - manager.select_with_mp4chaps (with_mp4chaps.get_active()); + manager.select_with_mp4chaps (with_mp4chaps.get_active ()); } void ExportFormatDialog::update_command () { - manager.set_command (command_entry.get_text()); + manager.set_command (command_entry.get_text ()); } void -ExportFormatDialog::update_description() +ExportFormatDialog::update_description () { - std::string text = ": " + format->description(false); - name_generated_part.set_text(text); + std::string text = ": " + format->description (false); + name_generated_part.set_text (text); } void ExportFormatDialog::update_name () { - manager.set_name (name_entry.get_text()); + manager.set_name (name_entry.get_text ()); } void ExportFormatDialog::update_trim_start_selection () { - manager.select_trim_beginning (trim_start_checkbox.get_active()); + manager.select_trim_beginning (trim_start_checkbox.get_active ()); } void ExportFormatDialog::update_trim_end_selection () { - manager.select_trim_end (trim_end_checkbox.get_active()); + 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(); + 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); @@ -966,8 +956,8 @@ ExportFormatDialog::update_normalize_sensitivity () void ExportFormatDialog::update_normalize_selection () { - manager.select_normalize (normalize_checkbox.get_active()); - manager.select_normalize_loudness (normalize_loudness_rb.get_active()); + manager.select_normalize (normalize_checkbox.get_active ()); + 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 ()); @@ -980,7 +970,7 @@ ExportFormatDialog::update_silence_start_selection () update_time (silence_start, silence_start_clock); AnyTime zero; zero.type = AnyTime::Timecode; - manager.select_silence_beginning (silence_start_checkbox.get_active() ? silence_start : zero); + manager.select_silence_beginning (silence_start_checkbox.get_active () ? silence_start : zero); } void @@ -989,77 +979,77 @@ ExportFormatDialog::update_silence_end_selection () update_time (silence_end, silence_end_clock); AnyTime zero; zero.type = AnyTime::Timecode; - manager.select_silence_end (silence_end_checkbox.get_active() ? silence_end : zero); + manager.select_silence_end (silence_end_checkbox.get_active () ? silence_end : zero); } void -ExportFormatDialog::update_clock (AudioClock & clock, ARDOUR::AnyTime const & time) +ExportFormatDialog::update_clock (AudioClock& clock, ARDOUR::AnyTime const& time) { // TODO position clock.set (_session->convert_to_samples (time), true); - AudioClock::Mode mode(AudioClock::Timecode); + AudioClock::Mode mode (AudioClock::Timecode); switch (time.type) { - case AnyTime::Timecode: - mode = AudioClock::Timecode; - break; - case AnyTime::BBT: - mode = AudioClock::BBT; - break; - case AnyTime::Samples: - mode = AudioClock::Samples; - break; - case AnyTime::Seconds: - mode = AudioClock::MinSec; - break; + case AnyTime::Timecode: + mode = AudioClock::Timecode; + break; + case AnyTime::BBT: + mode = AudioClock::BBT; + break; + case AnyTime::Samples: + mode = AudioClock::Samples; + break; + case AnyTime::Seconds: + mode = AudioClock::MinSec; + break; } clock.set_mode (mode); } void -ExportFormatDialog::update_time (AnyTime & time, AudioClock const & clock) +ExportFormatDialog::update_time (AnyTime& time, AudioClock const& clock) { if (!_session) { return; } - samplecnt_t samples = clock.current_duration(); + samplecnt_t samples = clock.current_duration (); - switch (clock.mode()) { - case AudioClock::Timecode: - time.type = AnyTime::Timecode; - _session->timecode_time (samples, time.timecode); - break; - case AudioClock::BBT: - time.type = AnyTime::BBT; - _session->bbt_time (samples, time.bbt); - break; - case AudioClock::Seconds: - case AudioClock::MinSec: - time.type = AnyTime::Seconds; - time.seconds = (double) samples / _session->sample_rate(); - break; - case AudioClock::Samples: - time.type = AnyTime::Samples; - time.samples = samples; - break; + switch (clock.mode ()) { + case AudioClock::Timecode: + time.type = AnyTime::Timecode; + _session->timecode_time (samples, time.timecode); + break; + case AudioClock::BBT: + time.type = AnyTime::BBT; + _session->bbt_time (samples, time.bbt); + break; + case AudioClock::Seconds: + case AudioClock::MinSec: + time.type = AnyTime::Seconds; + time.seconds = (double)samples / _session->sample_rate (); + break; + case AudioClock::Samples: + time.type = AnyTime::Samples; + time.samples = samples; + break; } } void ExportFormatDialog::update_src_quality_selection () { - Gtk::TreeModel::const_iterator iter = src_quality_combo.get_active(); - ExportFormatBase::SRCQuality quality = iter->get_value (src_quality_cols.id); + Gtk::TreeModel::const_iterator iter = src_quality_combo.get_active (); + ExportFormatBase::SRCQuality quality = iter->get_value (src_quality_cols.id); manager.select_src_quality (quality); } void ExportFormatDialog::update_demo_noise_sensitivity () { - Gtk::TreeModel::const_iterator iter = demo_noise_combo.get_active(); + Gtk::TreeModel::const_iterator iter = demo_noise_combo.get_active (); if (!iter) { demo_noise_dbfs_spinbutton.set_sensitive (false); return; @@ -1072,25 +1062,25 @@ ExportFormatDialog::update_demo_noise_sensitivity () void ExportFormatDialog::update_demo_noise_selection () { - Gtk::TreeModel::const_iterator iter = demo_noise_combo.get_active(); + Gtk::TreeModel::const_iterator iter = demo_noise_combo.get_active (); if (!iter) { demo_noise_dbfs_spinbutton.set_sensitive (false); return; } int duration = iter->get_value (demo_noise_cols.duration); int interval = iter->get_value (demo_noise_cols.interval); - int level = demo_noise_dbfs_spinbutton.get_value(); + int level = demo_noise_dbfs_spinbutton.get_value (); demo_noise_dbfs_spinbutton.set_sensitive (interval != 0 && duration != 0); manager.select_demo_noise_duration (duration); manager.select_demo_noise_interval (interval); - manager.select_demo_noise_level(level); + manager.select_demo_noise_level (level); } void ExportFormatDialog::update_codec_quality_selection () { - Gtk::TreeModel::const_iterator iter = codec_quality_combo.get_active(); + Gtk::TreeModel::const_iterator iter = codec_quality_combo.get_active (); if (!iter) { return; } @@ -1101,7 +1091,7 @@ ExportFormatDialog::update_codec_quality_selection () void ExportFormatDialog::update_tagging_selection () { - manager.select_tagging (tag_checkbox.get_active()); + manager.select_tagging (tag_checkbox.get_active ()); } void @@ -1109,11 +1099,11 @@ ExportFormatDialog::change_encoding_options (ExportFormatPtr ptr) { empty_encoding_option_table (); - boost::shared_ptr linear_ptr; + boost::shared_ptr linear_ptr; boost::shared_ptr ogg_ptr; - boost::shared_ptr flac_ptr; - boost::shared_ptr bwf_ptr; - boost::shared_ptr ffmpeg_ptr; + boost::shared_ptr flac_ptr; + boost::shared_ptr bwf_ptr; + boost::shared_ptr ffmpeg_ptr; if ((linear_ptr = boost::dynamic_pointer_cast (ptr))) { show_linear_enconding_options (linear_ptr); @@ -1139,7 +1129,7 @@ ExportFormatDialog::empty_encoding_option_table () } void -ExportFormatDialog::remove_widget (Gtk::Widget & to_remove, Gtk::Container * remove_from) +ExportFormatDialog::remove_widget (Gtk::Widget& to_remove, Gtk::Container* remove_from) { remove_from->remove (to_remove); } @@ -1221,39 +1211,39 @@ ExportFormatDialog::fill_sample_format_lists (boost::shared_ptrclear (); - HasSampleFormat::SampleFormatList const & formats = ptr->get_sample_formats (); + HasSampleFormat::SampleFormatList const& formats = ptr->get_sample_formats (); - for (HasSampleFormat::SampleFormatList::const_iterator it = formats.begin(); it != formats.end(); ++it) { - iter = sample_format_list->append(); - row = *iter; + for (HasSampleFormat::SampleFormatList::const_iterator it = formats.begin (); it != formats.end (); ++it) { + iter = sample_format_list->append (); + row = *iter; - row[sample_format_cols.ptr] = *it; - row[sample_format_cols.color] = (*it)->compatible() ? "white" : "red"; - row[sample_format_cols.label] = (*it)->name(); + row[sample_format_cols.ptr] = *it; + row[sample_format_cols.color] = (*it)->compatible () ? "white" : "red"; + row[sample_format_cols.label] = (*it)->name (); - if ((*it)->selected()) { - sample_format_view.get_selection()->select (iter); + if ((*it)->selected ()) { + sample_format_view.get_selection ()->select (iter); } } dither_type_list->clear (); - HasSampleFormat::DitherTypeList const & types = ptr->get_dither_types (); + HasSampleFormat::DitherTypeList const& types = ptr->get_dither_types (); - for (HasSampleFormat::DitherTypeList::const_iterator it = types.begin(); it != types.end(); ++it) { - iter = dither_type_list->append(); - row = *iter; + for (HasSampleFormat::DitherTypeList::const_iterator it = types.begin (); it != types.end (); ++it) { + iter = dither_type_list->append (); + row = *iter; - row[dither_type_cols.ptr] = *it; + row[dither_type_cols.ptr] = *it; row[dither_type_cols.color] = "white"; - row[dither_type_cols.label] = (*it)->name(); + row[dither_type_cols.label] = (*it)->name (); - if ((*it)->selected()) { - dither_type_view.get_selection()->select (iter); + if ((*it)->selected ()) { + dither_type_view.get_selection ()->select (iter); } } } @@ -1261,15 +1251,14 @@ ExportFormatDialog::fill_sample_format_lists (boost::shared_ptr ptr) { - HasCodecQuality::CodecQualityList const & codecs = ptr->get_codec_qualities(); + HasCodecQuality::CodecQualityList const& codecs = ptr->get_codec_qualities (); - codec_quality_list->clear(); - for (HasCodecQuality::CodecQualityList::const_iterator it = codecs.begin(); it != codecs.end(); ++it) { - - Gtk::TreeModel::iterator iter = codec_quality_list->append(); - Gtk::TreeModel::Row row = *iter; + codec_quality_list->clear (); + for (HasCodecQuality::CodecQualityList::const_iterator it = codecs.begin (); it != codecs.end (); ++it) { + Gtk::TreeModel::iterator iter = codec_quality_list->append (); + Gtk::TreeModel::Row row = *iter; row[codec_quality_cols.quality] = (*it)->quality; - row[codec_quality_cols.label] = (*it)->name; + row[codec_quality_cols.label] = (*it)->name; } set_codec_quality_selection (); } @@ -1277,8 +1266,8 @@ ExportFormatDialog::fill_codec_quality_lists (boost::shared_ptrchildren().begin(); it != codec_quality_list->children().end(); ++it) { - if (it->get_value (codec_quality_cols.quality) == format->codec_quality()) { + for (Gtk::ListStore::Children::iterator it = codec_quality_list->children ().begin (); it != codec_quality_list->children ().end (); ++it) { + if (it->get_value (codec_quality_cols.quality) == format->codec_quality ()) { codec_quality_combo.set_active (it); break; } @@ -1295,6 +1284,6 @@ void ExportFormatDialog::prohibit_compatibility_selection () { compatibility_select_connection.block (true); - compatibility_view.get_selection()->unselect_all (); + compatibility_view.get_selection ()->unselect_all (); compatibility_select_connection.block (false); }