From bb9cc45cd22af67ac275a5e73accbe14fee664d8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 14 Oct 2009 16:10:01 +0000 Subject: Strip trailing whitespace and fix other whitespace errors (e.g. space/tab mixing). Whitespace changes only. Vimmers, try let c_space_errors = 1 in your .vimrc to highlight this kind of stuff in red. I don't know the emacs equivalent... git-svn-id: svn://localhost/ardour2/branches/3.0@5773 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/export_format_dialog.cc | 284 ++++++++++++++++++------------------ 1 file changed, 142 insertions(+), 142 deletions(-) (limited to 'gtk2_ardour/export_format_dialog.cc') diff --git a/gtk2_ardour/export_format_dialog.cc b/gtk2_ardour/export_format_dialog.cc index 22852882ba..593f16ec58 100644 --- a/gtk2_ardour/export_format_dialog.cc +++ b/gtk2_ardour/export_format_dialog.cc @@ -68,110 +68,110 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : { /* 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); - + /* Name, new and remove */ - + name_hbox.pack_start (name_label, false, false, 0); name_hbox.pack_start (name_entry, true, true, 0); - + /* 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); - + normalize_spinbutton.configure (normalize_adjustment, 0.1, 2); - + /* Silence */ - + silence_table.set_row_spacings (6); silence_table.set_col_spacings (12); - + silence_table.attach (normalize_hbox, 0, 3, 0, 1); - + silence_table.attach (trim_start_checkbox, 0, 1, 1, 2); silence_table.attach (silence_start_checkbox, 1, 2, 1, 2); silence_table.attach (silence_start_clock, 2, 3, 1, 2); - + silence_table.attach (trim_end_checkbox, 0, 1, 2, 3); silence_table.attach (silence_end_checkbox, 1, 2, 2, 3); silence_table.attach (silence_end_clock, 2, 3, 2, 3); - + /* Format table */ init_format_table(); - + /* Encoding options */ - + init_encoding_option_widgets(); - + encoding_options_table.set_spacings (1); - + encoding_options_vbox.pack_start (encoding_options_label, false, false, 0); encoding_options_vbox.pack_start (encoding_options_table, false, false, 12); - + Pango::AttrList bold; Pango::Attribute b = Pango::Attribute::create_attr_weight (Pango::WEIGHT_BOLD); bold.insert (b); encoding_options_label.set_attributes (bold); - + /* Buttons */ - + revert_button = add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); revert_button->signal_clicked().connect (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 (mem_fun (*this, &ExportFormatDialog::end_dialog)); manager.CompleteChanged.connect (mem_fun (*close_button, &Gtk::Button::set_sensitive)); - + /* Load state before hooking up the rest of the signals */ - + load_state (format); - + /* Name entry */ - + name_entry.signal_changed().connect (mem_fun (*this, &ExportFormatDialog::update_name)); - + /* Normalize, silence and src_quality signals */ - + trim_start_checkbox.signal_toggled().connect (mem_fun (*this, &ExportFormatDialog::update_trim_start_selection)); trim_end_checkbox.signal_toggled().connect (mem_fun (*this, &ExportFormatDialog::update_trim_end_selection)); - + normalize_checkbox.signal_toggled().connect (mem_fun (*this, &ExportFormatDialog::update_normalize_selection)); normalize_spinbutton.signal_value_changed().connect (mem_fun (*this, &ExportFormatDialog::update_normalize_selection)); - + silence_start_checkbox.signal_toggled().connect (mem_fun (*this, &ExportFormatDialog::update_silence_start_selection)); silence_start_clock.ValueChanged.connect (mem_fun (*this, &ExportFormatDialog::update_silence_start_selection)); - + silence_end_checkbox.signal_toggled().connect (mem_fun (*this, &ExportFormatDialog::update_silence_end_selection)); silence_end_clock.ValueChanged.connect (mem_fun (*this, &ExportFormatDialog::update_silence_end_selection)); - + src_quality_combo.signal_changed().connect (mem_fun (*this, &ExportFormatDialog::update_src_quality_selection)); - + /* Format table signals */ - + Gtk::CellRendererToggle *toggle = dynamic_cast(compatibility_view.get_column_cell_renderer (0)); toggle->signal_toggled().connect (mem_fun (*this, &ExportFormatDialog::update_compatibility_selection)); compatibility_select_connection = compatibility_view.get_selection()->signal_changed().connect (mem_fun (*this, &ExportFormatDialog::prohibit_compatibility_selection)); - + quality_view.get_selection()->signal_changed().connect (mem_fun(*this, &ExportFormatDialog::update_quality_selection)); format_view.get_selection()->signal_changed().connect (mem_fun(*this, &ExportFormatDialog::update_format_selection)); sample_rate_view.get_selection()->signal_changed().connect (mem_fun(*this, &ExportFormatDialog::update_sample_rate_selection)); - + /* Encoding option signals */ - + sample_format_view.get_selection()->signal_changed().connect (mem_fun(*this, &ExportFormatDialog::update_sample_format_selection)); dither_type_view.get_selection()->signal_changed().connect (mem_fun(*this, &ExportFormatDialog::update_dither_type_selection)); - + tag_checkbox.signal_toggled().connect (mem_fun (*this, &ExportFormatDialog::update_tagging_selection)); - + /* Finalize */ - + show_all_children(); } @@ -184,10 +184,10 @@ void ExportFormatDialog::revert () { ++applying_changes_from_engine; - + format->set_state (original_state); load_state (format); - + --applying_changes_from_engine; } @@ -198,15 +198,15 @@ ExportFormatDialog::set_session (ARDOUR::Session* s) if (!session) { return; } - + silence_start_clock.set_session (s); silence_end_clock.set_session (s); - + update_clock (silence_start_clock, silence_start); update_clock (silence_end_clock, silence_end); - + /* Select native samplerate if no selection is yet made */ - + 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) { @@ -222,39 +222,39 @@ void ExportFormatDialog::load_state (FormatPtr spec) { name_entry.set_text (spec->name()); - + normalize_checkbox.set_active (spec->normalize()); normalize_spinbutton.set_value (spec->normalize_target()); - + trim_start_checkbox.set_active (spec->trim_beginning()); silence_start = spec->silence_beginning_time(); silence_start_checkbox.set_active (spec->silence_beginning() > 0); - + trim_end_checkbox.set_active (spec->trim_end()); silence_end = spec->silence_end_time(); silence_end_checkbox.set_active (spec->silence_end() > 0); - + 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 = format_list->children().begin(); it != format_list->children().end(); ++it) { if (it->get_value (format_cols.ptr)->get_format_id() == spec->format_id()) { it->get_value (format_cols.ptr)->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()) { 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()) { @@ -262,7 +262,7 @@ ExportFormatDialog::load_state (FormatPtr spec) 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()) { it->get_value (dither_type_cols.ptr)->set_selected (true); @@ -270,7 +270,7 @@ ExportFormatDialog::load_state (FormatPtr spec) } } } - + tag_checkbox.set_active (spec->tag()); } @@ -279,20 +279,20 @@ ExportFormatDialog::init_format_table () { format_table.set_spacings (1); - + format_table.attach (compatibility_label, 0, 1, 0, 1); format_table.attach (quality_label, 1, 2, 0, 1); format_table.attach (format_label, 2, 3, 0, 1); format_table.attach (sample_rate_label, 3, 4, 0, 1); - + 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 (src_quality_label, 0, 3, 2, 3); format_table.attach (src_quality_combo, 3, 4, 2, 3); - + compatibility_view.set_headers_visible (false); quality_view.set_headers_visible (false); format_view.set_headers_visible (false); @@ -307,108 +307,108 @@ ExportFormatDialog::init_format_table () compatibility_list = Gtk::ListStore::create (compatibility_cols); compatibility_view.set_model (compatibility_list); - + 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; - + row[compatibility_cols.ptr] = *it; row[compatibility_cols.selected] = false; row[compatibility_cols.label] = (*it)->name(); - + WeakCompatPtr ptr (*it); (*it)->SelectChanged.connect (sigc::bind (sigc::mem_fun (*this, &ExportFormatDialog::change_compatibility_selection), ptr)); } - + compatibility_view.append_column_editable ("", compatibility_cols.selected); - + Gtk::CellRendererText* text_renderer = Gtk::manage (new Gtk::CellRendererText); 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); - + /* Qualities */ quality_list = Gtk::ListStore::create (quality_cols); quality_view.set_model (quality_list); - + 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; - + row[quality_cols.ptr] = *it; row[quality_cols.color] = "white"; row[quality_cols.label] = (*it)->name(); - + WeakQualityPtr ptr (*it); (*it)->SelectChanged.connect (sigc::bind (sigc::mem_fun (*this, &ExportFormatDialog::change_quality_selection), ptr)); (*it)->CompatibleChanged.connect (sigc::bind (sigc::mem_fun (*this, &ExportFormatDialog::change_quality_compatibility), ptr)); } - + quality_view.append_column ("", quality_cols.label); - + /* Formats */ - + format_list = Gtk::ListStore::create (format_cols); format_view.set_model (format_list); - + 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; - + row[format_cols.ptr] = *it; row[format_cols.color] = "white"; row[format_cols.label] = (*it)->name(); - + WeakFormatPtr ptr (*it); (*it)->SelectChanged.connect (sigc::bind (sigc::mem_fun (*this, &ExportFormatDialog::change_format_selection), ptr)); (*it)->CompatibleChanged.connect (sigc::bind (sigc::mem_fun (*this, &ExportFormatDialog::change_format_compatibility), ptr)); - + /* Encoding options */ - + boost::shared_ptr hsf; - + if (hsf = boost::dynamic_pointer_cast (*it)) { hsf->SampleFormatSelectChanged.connect (sigc::mem_fun (*this, &ExportFormatDialog::change_sample_format_selection)); hsf->SampleFormatCompatibleChanged.connect (sigc::mem_fun (*this, &ExportFormatDialog::change_sample_format_compatibility)); - + hsf->DitherTypeSelectChanged.connect (sigc::mem_fun (*this, &ExportFormatDialog::change_dither_type_selection)); hsf->DitherTypeCompatibleChanged.connect (sigc::mem_fun (*this, &ExportFormatDialog::change_dither_type_compatibility)); } } - + format_view.append_column ("", format_cols.label); - + /* Sample Rates */ - + 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 (); - + 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.color] = "white"; row[sample_rate_cols.label] = (*it)->name(); - + WeakSampleRatePtr ptr (*it); (*it)->SelectChanged.connect (sigc::bind (sigc::mem_fun (*this, &ExportFormatDialog::change_sample_rate_selection), ptr)); (*it)->CompatibleChanged.connect (sigc::bind (sigc::mem_fun (*this, &ExportFormatDialog::change_sample_rate_compatibility), ptr)); } sample_rate_view.append_column ("", sample_rate_cols.label); - + /* Color rendering */ Gtk::TreeViewColumn * label_col; @@ -417,45 +417,45 @@ ExportFormatDialog::init_format_table () 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 = 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; row[src_quality_cols.label] = _("Best (sinc)"); - + 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; row[src_quality_cols.label] = _("Fast (sinc)"); - + 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; row[src_quality_cols.label] = _("Zero order hold"); - + src_quality_combo.pack_start (src_quality_cols.label); src_quality_combo.set_active (0); } @@ -473,7 +473,7 @@ ExportFormatDialog::init_encoding_option_widgets () 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); @@ -481,20 +481,20 @@ ExportFormatDialog::init_encoding_option_widgets () 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 (Glib::ustring const & path) { - + Gtk::TreeModel::iterator iter = compatibility_view.get_model ()->get_iter (path); ExportFormatManager::CompatPtr 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 @@ -537,7 +537,7 @@ ExportFormatDialog::update_selection (Glib::RefPtr & list, Gtk:: Gtk::ListStore::Children::iterator it; Glib::RefPtr selection = view.get_selection(); - + for (it = list->children().begin(); it != list->children().end(); ++it) { bool selected = selection->is_selected (it); it->get_value (cols.ptr)->set_selected (selected); @@ -548,16 +548,16 @@ void ExportFormatDialog::change_compatibility_selection (bool select, WeakCompatPtr compat) { ++applying_changes_from_engine; - + ExportFormatManager::CompatPtr ptr = compat.lock(); - + 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; } } - + --applying_changes_from_engine; } @@ -583,7 +583,7 @@ void ExportFormatDialog::change_sample_rate_selection (bool select, WeakSampleRatePtr rate) { change_selection (select, rate, sample_rate_list, sample_rate_view, sample_rate_cols); - + if (select) { ExportFormatManager::SampleRatePtr ptr = rate.lock(); if (ptr && session) { @@ -609,14 +609,14 @@ void 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(); - + Gtk::ListStore::Children::iterator it; Glib::RefPtr selection; - + selection = view.get_selection(); - + if (!ptr) { selection->unselect_all(); } else { @@ -631,7 +631,7 @@ ExportFormatDialog::change_selection (bool select, boost::weak_ptr w_ptr, Gli } } } - + --applying_changes_from_engine; } @@ -671,7 +671,7 @@ ExportFormatDialog::change_compatibility (bool compatibility, boost::weak_ptr Glib::ustring const & c_incompatible, Glib::ustring const & c_compatible) { boost::shared_ptr ptr = w_ptr.lock(); - + Gtk::ListStore::Children::iterator it; for (it = list->children().begin(); it != list->children().end(); ++it) { if (it->get_value (cols.ptr) == ptr) { @@ -729,9 +729,9 @@ ExportFormatDialog::update_clock (AudioClock & clock, ARDOUR::AnyTime const & ti { // TODO position clock.set (session->convert_to_frames_at (0, time), true); - + AudioClock::Mode mode(AudioClock::SMPTE); - + switch (time.type) { case AnyTime::SMPTE: mode = AudioClock::SMPTE; @@ -746,7 +746,7 @@ ExportFormatDialog::update_clock (AudioClock & clock, ARDOUR::AnyTime const & ti mode = AudioClock::MinSec; break; } - + clock.set_mode (mode); } @@ -756,9 +756,9 @@ ExportFormatDialog::update_time (AnyTime & time, AudioClock const & clock) if (!session) { return; } - + nframes_t frames = clock.current_duration(); - + switch (clock.mode()) { case AudioClock::SMPTE: time.type = AnyTime::SMPTE; @@ -778,7 +778,7 @@ ExportFormatDialog::update_time (AnyTime & time, AudioClock const & clock) break; case AudioClock::Off: silence_end_checkbox.set_active (false); - return; + return; } } @@ -837,15 +837,15 @@ ExportFormatDialog::show_linear_enconding_options (boost::shared_ptr (ptr)); - + show_all_children (); } @@ -853,12 +853,12 @@ void ExportFormatDialog::show_ogg_enconding_options (boost::shared_ptr /*ptr*/) { encoding_options_label.set_label (_("Ogg Vorbis options")); - + encoding_options_table.resize (1, 1); encoding_options_table.attach (tag_checkbox, 0, 1, 0, 1); - + update_tagging_selection (); - + show_all_children (); } @@ -866,16 +866,16 @@ void ExportFormatDialog::show_flac_enconding_options (boost::shared_ptr ptr) { encoding_options_label.set_label (_("FLAC options")); - + encoding_options_table.resize (3, 2); encoding_options_table.attach (sample_format_label, 0, 1, 0, 1); encoding_options_table.attach (dither_label, 1, 2, 0, 1); encoding_options_table.attach (sample_format_view, 0, 1, 1, 2); encoding_options_table.attach (dither_type_view, 1, 2, 1, 2); encoding_options_table.attach (tag_checkbox, 0, 2, 2, 3); - + fill_sample_format_lists (boost::dynamic_pointer_cast (ptr)); - + show_all_children (); } @@ -883,15 +883,15 @@ void ExportFormatDialog::show_bwf_enconding_options (boost::shared_ptr ptr) { encoding_options_label.set_label (_("Broadcast Wave options")); - + encoding_options_table.resize (2, 2); encoding_options_table.attach (sample_format_label, 0, 1, 0, 1); encoding_options_table.attach (dither_label, 1, 2, 0, 1); encoding_options_table.attach (sample_format_view, 0, 1, 1, 2); encoding_options_table.attach (dither_type_view, 1, 2, 1, 2); - + fill_sample_format_lists (boost::dynamic_pointer_cast (ptr)); - + show_all_children (); } @@ -899,39 +899,39 @@ void ExportFormatDialog::fill_sample_format_lists (boost::shared_ptr ptr) { /* Fill lists */ - + Gtk::TreeModel::iterator iter; Gtk::TreeModel::Row row; - + sample_format_list->clear (); - + 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; - + 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); } } - + dither_type_list->clear (); - + 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; - + row[dither_type_cols.ptr] = *it; row[dither_type_cols.color] = "white"; row[dither_type_cols.label] = (*it)->name(); - + if ((*it)->selected()) { dither_type_view.get_selection()->select (iter); } -- cgit v1.2.3