From ceac42cc039d9043e0bcf929c6e8207d7f8fc7d4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 24 Feb 2018 13:54:15 +0100 Subject: [PATCH] NO-OP: whitespace - remove trailing whitespace - remove space after opening brackets and before closing brackets - add space around operators - do not use '//' for multi-line comments, do not use "//" on line-start to comment-out code breaking indenting (-Wmisleading-indent) - do add a single space after comment-start /*{SPACE}... or //{SPACE}... - reserve duplicate whitespace " " for alignment, remove other duplicate whitespace - use established "TODO" and "XXX" (highlighted keywords) - remove equal-sign series "====" (those indicate merge conflicts) --- gtk2_ardour/add_route_dialog.cc | 47 +++--- gtk2_ardour/editor.cc | 284 ++++++++++++++++---------------- gtk2_ardour/editor_canvas.cc | 29 ++-- gtk2_ardour/editor_mouse.cc | 67 ++++---- gtk2_ardour/editor_ops.cc | 76 ++++----- gtk2_ardour/editor_rulers.cc | 91 +++++----- gtk2_ardour/editor_summary.cc | 91 +++++----- gtk2_ardour/mixer_strip.cc | 4 +- gtk2_ardour/mixer_ui.cc | 2 +- gtk2_ardour/script_selector.cc | 10 +- gtk2_ardour/selection.cc | 150 ++++++++--------- 11 files changed, 426 insertions(+), 425 deletions(-) diff --git a/gtk2_ardour/add_route_dialog.cc b/gtk2_ardour/add_route_dialog.cc index 7c461ce6c9..4aeb80e161 100644 --- a/gtk2_ardour/add_route_dialog.cc +++ b/gtk2_ardour/add_route_dialog.cc @@ -89,7 +89,7 @@ AddRouteDialog::AddRouteDialog () if (builtin_types.empty()) { builtin_types.push_back ( - std::pair(_("Audio Tracks"), _( " \ + std::pair(_("Audio Tracks"), _(" \ Use the settings, below, to create 1 or more new Audio tracks.\n \ \n\n \ You may select:\n \ @@ -185,17 +185,17 @@ You may select:\n \ strict_io_combo.append_text (_("Strict-I/O")); strict_io_combo.set_active (Config->get_strict_io () ? 1 : 0); - //top-level VBox + /* top-level VBox */ VBox* vbox = manage (new VBox); get_vbox()->set_spacing (4); vbox->set_spacing (18); vbox->set_border_width (5); - //this box contains the template chooser, and the template details + /* this box contains the template chooser, and the template details */ HBox* template_hbox = manage (new HBox); template_hbox->set_spacing (8); - //scrollbars for the template chooser and template descriptions.... + /* scrollbars for the template chooser and template descriptions.... */ Gtk::ScrolledWindow *template_scroller = manage (new Gtk::ScrolledWindow()); template_scroller->set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); template_scroller->add (trk_template_chooser); @@ -204,10 +204,10 @@ You may select:\n \ desc_scroller->set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); desc_scroller->add (trk_template_desc); - //this is the outer sample that surrounds the description and the settings-table + /* this is the outer sample that surrounds the description and the settings-table */ trk_template_outer_frame.set_name (X_("TextHighlightFrame")); - //this is the "inner frame" that surrounds the description text + /* this is the "inner frame" that surrounds the description text */ trk_template_desc_frame.set_name (X_("TextHighlightFrame")); trk_template_desc_frame.add (*desc_scroller); @@ -250,7 +250,7 @@ You may select:\n \ vbox->pack_start (*template_hbox, true, true); - //Now pack the "settings table" with manual controls (these controls are sensitized by the left-side selection) + /* Now pack the "settings table" with manual controls (these controls are sensitized by the left-side selection) */ int n = 0; @@ -262,7 +262,7 @@ You may select:\n \ ++n; - // Number + /* Number */ add_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER); settings_table->attach (add_label, 0, 1, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); Gtk::Alignment *align = manage (new Alignment (0, .5, 0, 0)); @@ -271,31 +271,31 @@ You may select:\n \ ++n; - // Name + /* Name */ name_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER); settings_table->attach (name_label, 0, 1, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); settings_table->attach (name_template_entry, 1, 3, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); - // Route configuration + /* Route configuration */ configuration_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER); settings_table->attach (configuration_label, 4, 5, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); settings_table->attach (channel_combo, 5, 6, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); ++n; - // instrument choice (for MIDI) + /* instrument choice (for MIDI) */ instrument_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER); settings_table->attach (instrument_label, 0, 1, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); settings_table->attach (instrument_combo, 1, 3, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); - // Group choice + /* Group choice */ group_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER); settings_table->attach (group_label, 4, 5, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); settings_table->attach (route_group_combo, 5, 6, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); ++n; - // New Route's I/O is.. {strict/flexible} + /* New Route's I/O is.. {strict/flexible} */ if (Profile->get_mixbus ()) { strict_io_combo.set_active (1); } else { @@ -306,7 +306,7 @@ You may select:\n \ ArdourWidgets::set_tooltip (strict_io_combo, _("With strict-i/o enabled, Effect Processors will not modify the number of channels on a track. The number of output channels will always match the number of input channels.")); - // recording mode + /* recording mode */ mode_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER); settings_table->attach (mode_label, 4, 5, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); settings_table->attach (mode_combo, 5, 6, n, n + 1, Gtk::FILL, Gtk::SHRINK, 0, 0); @@ -317,12 +317,12 @@ You may select:\n \ HBox* outer_box = manage (new HBox); outer_box->set_spacing (4); - // New route will be inserted at.. + /* New route will be inserted at.. */ insert_label.set_alignment (Gtk::ALIGN_RIGHT, Gtk::ALIGN_CENTER); outer_box->pack_start (insert_label, false, false); outer_box->pack_start (insert_at_combo, false, false); - //quick-add button (add item but don't close dialog) + /* quick-add button (add item but don't close dialog) */ Gtk::Button* addnoclose_button = manage (new Gtk::Button(_("Add selected items (and leave dialog open)"))); addnoclose_button->set_can_default (); addnoclose_button->signal_clicked ().connect (sigc::bind (sigc::mem_fun (*this, &Gtk::Dialog::response), Add)); @@ -425,7 +425,6 @@ AddRouteDialog::trk_template_row_selected () } else { name_template_entry.set_text (""); } - if ((it = rs.find ("how_many")) != rs.end()) { if (atoi (it->second.c_str()) > 0) { @@ -534,13 +533,13 @@ std::string AddRouteDialog::get_template_path () { string p; - + if (trk_template_chooser.get_selection()->count_selected_rows() > 0) { TreeIter iter = trk_template_chooser.get_selection()->get_selected(); if (iter) { string n = (*iter)[track_template_columns.name]; - if ( n != _("Manual Configuration") ) { + if (n != _("Manual Configuration")) { p = (*iter)[track_template_columns.path]; } } @@ -630,7 +629,7 @@ AddRouteDialog::track_type_chosen () insert_label.set_sensitive (true); insert_at_combo.set_sensitive (true); - + break; case MidiTrack: @@ -651,7 +650,7 @@ AddRouteDialog::track_type_chosen () insert_label.set_sensitive (true); insert_at_combo.set_sensitive (true); - + break; case MixedTrack: { @@ -721,7 +720,7 @@ AddRouteDialog::track_type_chosen () insert_label.set_sensitive (false); insert_at_combo.set_sensitive (false); - + break; case MidiBus: @@ -941,8 +940,8 @@ AddRouteDialog::refill_channel_setups () continue; } TreeModel::Row row; - if ( (*s)->name == "Create Audio Tracks Interactively" && Profile->get_mixbus ()) { - // somewhat-special, Ben says: "most-used template" + if ((*s)->name == "Create Audio Tracks Interactively" && Profile->get_mixbus ()) { + /* somewhat-special, Ben says: "most-used template" */ row = *(trk_template_model->prepend ()); } else { row = *(trk_template_model->append ()); diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 3c1e3916d4..9fda261113 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -223,7 +223,7 @@ static const gchar *_rb_opt_strings[] = { }; #endif -//Robin says: this should be odd to accomodate cairo drawing offset ( width/2 rounds up to pixel boundary ) +/* Robin says: this should be odd to accomodate cairo drawing offset (width/2 rounds up to pixel boundary) */ #ifdef __APPLE__ #define COMBO_TRIANGLE_WIDTH 19 // ArdourButton _diameter (11) + 2 * arrow-padding (2*2) + 2 * text-padding (2*5) #else @@ -611,7 +611,7 @@ Editor::Editor () pad_line_1->set_outline_color (0xFF0000FF); pad_line_1->show(); - // CAIROCANVAS + /* CAIROCANVAS */ time_pad->show(); edit_packer.set_col_spacings (0); @@ -625,7 +625,7 @@ Editor::Editor () time_bars_event_box.signal_button_release_event().connect (sigc::mem_fun(*this, &Editor::ruler_label_button_release)); ArdourWidgets::ArdourDropShadow *axis_view_shadow = manage (new (ArdourWidgets::ArdourDropShadow)); - axis_view_shadow->set_size_request( 4, -1 ); + axis_view_shadow->set_size_request (4, -1); axis_view_shadow->set_name("EditorWindow"); axis_view_shadow->show(); @@ -740,25 +740,25 @@ Editor::Editor () global_vpacker.set_spacing (0); global_vpacker.set_border_width (0); - //the next three EventBoxes provide the ability for their child widgets to have a background color. That is all. + /* the next three EventBoxes provide the ability for their child widgets to have a background color. That is all. */ - Gtk::EventBox* ebox = manage (new Gtk::EventBox); //a themeable box + Gtk::EventBox* ebox = manage (new Gtk::EventBox); // a themeable box ebox->set_name("EditorWindow"); ebox->add (ebox_hpacker); - Gtk::EventBox* epane_box = manage (new EventBoxExt); //a themeable box + Gtk::EventBox* epane_box = manage (new EventBoxExt); // a themeable box epane_box->set_name("EditorWindow"); epane_box->add (edit_pane); - Gtk::EventBox* epane_box2 = manage (new EventBoxExt); //a themeable box + Gtk::EventBox* epane_box2 = manage (new EventBoxExt); // a themeable box epane_box2->set_name("EditorWindow"); epane_box2->add (global_vpacker); ArdourWidgets::ArdourDropShadow *toolbar_shadow = manage (new (ArdourWidgets::ArdourDropShadow)); - toolbar_shadow->set_size_request( -1, 4 ); + toolbar_shadow->set_size_request (-1, 4); toolbar_shadow->set_mode(ArdourWidgets::ArdourDropShadow::DropShadowBoth); toolbar_shadow->set_name("EditorWindow"); - toolbar_shadow->show(); + toolbar_shadow->show(); global_vpacker.pack_start (*toolbar_shadow, false, false); global_vpacker.pack_start (*ebox, false, false); @@ -1132,7 +1132,7 @@ bool Editor::deferred_control_scroll (samplepos_t /*target*/) { _session->request_locate (*_control_scroll_target, _session->transport_rolling()); - // reset for next stream + /* reset for next stream */ _control_scroll_target = boost::none; _dragging_playhead = false; return false; @@ -1148,7 +1148,7 @@ Editor::access_action (const std::string& action_group, const std::string& actio ENSURE_GUI_THREAD (*this, &Editor::access_action, action_group, action_item) RefPtr act; - act = ActionManager::get_action( action_group.c_str(), action_item.c_str() ); + act = ActionManager::get_action (action_group.c_str(), action_item.c_str()); if (act) { act->activate(); @@ -1326,10 +1326,11 @@ Editor::set_session (Session *t) return; } - //initialize _leftmost_sample to the extents of the session - //this prevents a bogus setting of leftmost = "0" if the summary view asks for the leftmost sample before the visible state has been loaded from instant.xml + /* initialize _leftmost_sample to the extents of the session + * this prevents a bogus setting of leftmost = "0" if the summary view asks for the leftmost sample + * before the visible state has been loaded from instant.xml */ _leftmost_sample = session_gui_extents().first; - + _playlist_selector->set_session (_session); nudge_clock->set_session (_session); _summary->set_session (_session); @@ -1364,15 +1365,15 @@ Editor::set_session (Session *t) loc = _session->locations()->auto_punch_location(); if (loc != 0) { - // force name + /* force name */ loc->set_name (_("Punch")); } refresh_location_display (); /* This must happen after refresh_location_display(), as (amongst other things) we restore - the selected Marker; this needs the LocationMarker list to be available. - */ + * the selected Marker; this needs the LocationMarker list to be available. + */ XMLNode* node = ARDOUR_UI::instance()->editor_settings(); set_state (*node, Stateful::loading_state_version); @@ -2208,7 +2209,7 @@ Editor::snap_mode() const void Editor::set_grid_to (GridType gt) { - if (_grid_type == gt) { //already set + if (_grid_type == gt) { // already set return; } @@ -2233,9 +2234,11 @@ Editor::set_grid_to (GridType gt) grid_type_selector.set_text (str); } - //show appropriate rulers for this grid setting. (ToDo: perhaps make this optional) - //Currently this is 'required' because the RULER calculates the grid_marks which will be used by grid_lines - if ( grid_musical() ) { + /* show appropriate rulers for this grid setting. + * TODO: perhaps make this optional. + * Currently this is 'required' because the RULER calculates the grid_marks which will be used by grid_lines + */ + if (grid_musical()) { ruler_tempo_action->set_active(true); ruler_meter_action->set_active(true); @@ -2243,7 +2246,7 @@ Editor::set_grid_to (GridType gt) ruler_timecode_action->set_active(false); ruler_minsec_action->set_active(false); ruler_samples_action->set_active(false); - } else if (_grid_type == GridTypeSmpte ) { + } else if (_grid_type == GridTypeSmpte) { ruler_tempo_action->set_active(false); ruler_meter_action->set_active(false); @@ -2251,7 +2254,7 @@ Editor::set_grid_to (GridType gt) ruler_timecode_action->set_active(true); ruler_minsec_action->set_active(false); ruler_samples_action->set_active(false); - } else if (_grid_type == GridTypeMinSec ) { + } else if (_grid_type == GridTypeMinSec) { ruler_tempo_action->set_active(false); ruler_meter_action->set_active(false); @@ -2259,7 +2262,7 @@ Editor::set_grid_to (GridType gt) ruler_timecode_action->set_active(false); ruler_minsec_action->set_active(true); ruler_samples_action->set_active(false); - } else if (_grid_type == GridTypeSamples ) { + } else if (_grid_type == GridTypeSamples) { ruler_tempo_action->set_active(false); ruler_meter_action->set_active(false); @@ -2271,7 +2274,7 @@ Editor::set_grid_to (GridType gt) instant_save (); - if ( grid_musical() ) { + if (grid_musical()) { compute_bbt_ruler_scale (_leftmost_sample, _leftmost_sample + current_page_samples()); update_tempo_based_rulers (); } @@ -2293,8 +2296,8 @@ Editor::set_snap_mode (SnapMode mode) } _snap_mode = mode; - - if (_snap_mode == SnapOff ) { + + if (_snap_mode == SnapOff) { snap_mode_button.set_active_state (Gtkmm2ext::Off); } else { snap_mode_button.set_active_state (Gtkmm2ext::ExplicitActive); @@ -2651,7 +2654,7 @@ Editor::trackview_by_y_position (double y, bool trackview_relative_offset) const } if (y < 0) { - return std::make_pair ( (TimeAxisView *) 0, 0); + return std::make_pair ((TimeAxisView *) 0, 0); } for (TrackViewList::const_iterator iter = track_views.begin(); iter != track_views.end(); ++iter) { @@ -2663,13 +2666,13 @@ Editor::trackview_by_y_position (double y, bool trackview_relative_offset) const } } - return std::make_pair ( (TimeAxisView *) 0, 0); + return std::make_pair ((TimeAxisView *) 0, 0); } void Editor::set_snapped_cursor_position (samplepos_t pos) { - if ( _edit_point == EditAtMouse ) { + if (_edit_point == EditAtMouse) { snapped_cursor->set_position(pos); } } @@ -2717,21 +2720,21 @@ Editor::snap_to (MusicSample& start, RoundMode direction, SnapPref pref, bool fo } void -check_best_snap ( samplepos_t presnap, samplepos_t &test, samplepos_t &dist, samplepos_t &best ) +check_best_snap (samplepos_t presnap, samplepos_t &test, samplepos_t &dist, samplepos_t &best) { - samplepos_t diff = abs( test - presnap ); - if ( diff < dist ) { + samplepos_t diff = abs (test - presnap); + if (diff < dist) { dist = diff; best = test; } - test = max_samplepos; //reset this so it doesn't get accidentally reused + test = max_samplepos; // reset this so it doesn't get accidentally reused } samplepos_t Editor::snap_to_grid (vector marks, samplepos_t presnap, RoundMode direction) { - if (marks.empty() ) return presnap; + if (marks.empty()) return presnap; samplepos_t before; samplepos_t after; @@ -2739,9 +2742,9 @@ Editor::snap_to_grid (vector marks, samplepos_t presn before = after = max_samplepos; - //get marks to either side of presnap + /* get marks to either side of presnap */ vector::const_iterator m = marks.begin(); - while ( m != marks.end() && (m->position < presnap) ) { + while (m != marks.end() && (m->position < presnap)) { ++m; } @@ -2769,7 +2772,7 @@ Editor::snap_to_grid (vector marks, samplepos_t presn test = after; else if ((direction == RoundDownMaybe || direction == RoundDownAlways)) test = before; - else if (direction == 0 ) { + else if (direction == 0) { if ((presnap - before) < (after - presnap)) { test = before; } else { @@ -2802,7 +2805,7 @@ Editor::marker_snap_to_internal (samplepos_t presnap, RoundMode direction) test = after; } else if ((direction == RoundDownMaybe || direction == RoundDownAlways)) { test = before; - } else if (direction == 0 ) { + } else if (direction == 0) { if ((presnap - before) < (after - presnap)) { test = before; } else { @@ -2819,22 +2822,22 @@ Editor::snap_to_internal (MusicSample& start, RoundMode direction, SnapPref pref { const samplepos_t presnap = start.sample; - samplepos_t test = max_samplepos; //for each snap, we'll use this value - samplepos_t dist = max_samplepos; //this records the distance of the best snap result we've found so far - samplepos_t best = max_samplepos; //this records the best snap-result we've found so far + samplepos_t test = max_samplepos; // for each snap, we'll use this value + samplepos_t dist = max_samplepos; // this records the distance of the best snap result we've found so far + samplepos_t best = max_samplepos; // this records the best snap-result we've found so far - //check snap-to-marker - if ( UIConfiguration::instance().get_snap_to_marks() ) { + /* check snap-to-marker */ + if (UIConfiguration::instance().get_snap_to_marks()) { if (for_mark) { return; } - test = marker_snap_to_internal ( presnap, direction ); + test = marker_snap_to_internal (presnap, direction); check_best_snap(presnap, test, dist, best); } - //check snap-to-region-{start/end/sync} - if ( UIConfiguration::instance().get_snap_to_region_start() || UIConfiguration::instance().get_snap_to_region_end() || UIConfiguration::instance().get_snap_to_region_sync() ) { + /* check snap-to-region-{start/end/sync} */ + if (UIConfiguration::instance().get_snap_to_region_start() || UIConfiguration::instance().get_snap_to_region_end() || UIConfiguration::instance().get_snap_to_region_sync()) { if (!region_boundary_cache.empty()) { vector::iterator prev = region_boundary_cache.end (); @@ -2864,20 +2867,21 @@ Editor::snap_to_internal (MusicSample& start, RoundMode direction, SnapPref pref check_best_snap(presnap, test, dist, best); } - //check Grid - if (UIConfiguration::instance().get_snap_to_grid() && (_grid_type != GridTypeNone) ) { + /* check Grid */ + if (UIConfiguration::instance().get_snap_to_grid() && (_grid_type != GridTypeNone)) { - //if SnapToGrid is selected, the user wants to prioritize the music grid - //in this case we should reset the best distance, so Grid will prevail + /* if SnapToGrid is selected, the user wants to prioritize the music grid + * in this case we should reset the best distance, so Grid will prevail */ dist = max_samplepos; test = snap_to_grid (grid_marks, presnap, direction); check_best_snap(presnap, test, dist, best); } - //now check "magnetic" state: is the grid within reasonable on-screen distance to trigger a snap? - //this also helps to avoid snapping to somewhere the user can't see. ( i.e.: I clicked on a region and it disappeared!! ) - //ToDo: perhaps this should only occur if EditPointMouse? + /* now check "magnetic" state: is the grid within reasonable on-screen distance to trigger a snap? + * this also helps to avoid snapping to somewhere the user can't see. (i.e.: I clicked on a region and it disappeared!!) + * ToDo: Perhaps this should only occur if EditPointMouse? + */ int snap_threshold_s = pixel_to_sample(UIConfiguration::instance().get_snap_threshold()); if (ensure_snap) { start.set (best, 0); @@ -3081,13 +3085,13 @@ Editor::setup_toolbar () toolbar_hbox.set_border_width (2); ArdourWidgets::ArdourDropShadow *tool_shadow = manage (new (ArdourWidgets::ArdourDropShadow)); - tool_shadow->set_size_request( 4, -1 ); + tool_shadow->set_size_request (4, -1); tool_shadow->show(); ebox_hpacker.pack_start (*tool_shadow, false, false); ebox_hpacker.pack_start(ebox_vpacker, true, true); - Gtk::EventBox* spacer = manage (new Gtk::EventBox); //extra space under the mouse toolbar, for aesthetics + Gtk::EventBox* spacer = manage (new Gtk::EventBox); // extra space under the mouse toolbar, for aesthetics spacer->set_name("EditorWindow"); spacer->set_size_request(-1,4); spacer->show(); @@ -3108,8 +3112,6 @@ Editor::setup_toolbar () toolbar_hbox.pack_start (*nudge_box, false, false); - //zoom tools on right ege - toolbar_hbox.pack_end (_zoom_box, false, false, 2); toolbar_hbox.pack_end (*(manage (new ArdourVSpacer ())), false, false, 3); @@ -3126,10 +3128,10 @@ Editor::build_edit_point_menu () { using namespace Menu_Helpers; - edit_point_selector.AddMenuElem (MenuElem ( edit_point_strings[(int)EditAtPlayhead], sigc::bind (sigc::mem_fun(*this, &Editor::edit_point_selection_done), (EditPoint) EditAtPlayhead))); + edit_point_selector.AddMenuElem (MenuElem (edit_point_strings[(int)EditAtPlayhead], sigc::bind (sigc::mem_fun(*this, &Editor::edit_point_selection_done), (EditPoint) EditAtPlayhead))); if(!Profile->get_mixbus()) - edit_point_selector.AddMenuElem (MenuElem ( edit_point_strings[(int)EditAtSelectedMarker], sigc::bind (sigc::mem_fun(*this, &Editor::edit_point_selection_done), (EditPoint) EditAtSelectedMarker))); - edit_point_selector.AddMenuElem (MenuElem ( edit_point_strings[(int)EditAtMouse], sigc::bind (sigc::mem_fun(*this, &Editor::edit_point_selection_done), (EditPoint) EditAtMouse))); + edit_point_selector.AddMenuElem (MenuElem (edit_point_strings[(int)EditAtSelectedMarker], sigc::bind (sigc::mem_fun(*this, &Editor::edit_point_selection_done), (EditPoint) EditAtSelectedMarker))); + edit_point_selector.AddMenuElem (MenuElem (edit_point_strings[(int)EditAtMouse], sigc::bind (sigc::mem_fun(*this, &Editor::edit_point_selection_done), (EditPoint) EditAtMouse))); set_size_request_to_display_given_text (edit_point_selector, edit_point_strings, COMBO_TRIANGLE_WIDTH, 2); } @@ -3139,10 +3141,10 @@ Editor::build_edit_mode_menu () { using namespace Menu_Helpers; - edit_mode_selector.AddMenuElem (MenuElem ( edit_mode_strings[(int)Slide], sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Slide))); -// edit_mode_selector.AddMenuElem (MenuElem ( edit_mode_strings[(int)Splice], sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Splice))); - edit_mode_selector.AddMenuElem (MenuElem ( edit_mode_strings[(int)Ripple], sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Ripple))); - edit_mode_selector.AddMenuElem (MenuElem ( edit_mode_strings[(int)Lock], sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Lock))); + edit_mode_selector.AddMenuElem (MenuElem (edit_mode_strings[(int)Slide], sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Slide))); + edit_mode_selector.AddMenuElem (MenuElem (edit_mode_strings[(int)Ripple], sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Ripple))); + edit_mode_selector.AddMenuElem (MenuElem (edit_mode_strings[(int)Lock], sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Lock))); + /* Note: Splice was removed */ set_size_request_to_display_given_text (edit_mode_selector, edit_mode_strings, COMBO_TRIANGLE_WIDTH, 2); } @@ -3152,54 +3154,54 @@ Editor::build_grid_type_menu () { using namespace Menu_Helpers; - //main grid: bars, quarter-notes, etc - grid_type_selector.AddMenuElem (MenuElem ( grid_type_strings[(int)GridTypeNone], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeNone))); - grid_type_selector.AddMenuElem (MenuElem ( grid_type_strings[(int)GridTypeBar], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBar))); - grid_type_selector.AddMenuElem (MenuElem ( grid_type_strings[(int)GridTypeBeat], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeat))); - grid_type_selector.AddMenuElem (MenuElem ( grid_type_strings[(int)GridTypeBeatDiv2], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv2))); - grid_type_selector.AddMenuElem (MenuElem ( grid_type_strings[(int)GridTypeBeatDiv4], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv4))); - grid_type_selector.AddMenuElem (MenuElem ( grid_type_strings[(int)GridTypeBeatDiv8], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv8))); - grid_type_selector.AddMenuElem (MenuElem ( grid_type_strings[(int)GridTypeBeatDiv16], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv16))); - grid_type_selector.AddMenuElem (MenuElem ( grid_type_strings[(int)GridTypeBeatDiv32], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv32))); + /* main grid: bars, quarter-notes, etc */ + grid_type_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeNone], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeNone))); + grid_type_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBar], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBar))); + grid_type_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeat], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeat))); + grid_type_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeatDiv2], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv2))); + grid_type_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeatDiv4], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv4))); + grid_type_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeatDiv8], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv8))); + grid_type_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeatDiv16], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv16))); + grid_type_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeBeatDiv32], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv32))); - //triplet grid + /* triplet grid */ grid_type_selector.AddMenuElem(SeparatorElem()); Gtk::Menu *_triplet_menu = manage (new Menu); MenuList& triplet_items (_triplet_menu->items()); { - triplet_items.push_back( MenuElem( grid_type_strings[(int)GridTypeBeatDiv3], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv3) )); - triplet_items.push_back( MenuElem( grid_type_strings[(int)GridTypeBeatDiv6], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv6) )); - triplet_items.push_back( MenuElem( grid_type_strings[(int)GridTypeBeatDiv12], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv12) )); - triplet_items.push_back( MenuElem( grid_type_strings[(int)GridTypeBeatDiv24], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv24) )); + triplet_items.push_back (MenuElem (grid_type_strings[(int)GridTypeBeatDiv3], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv3))); + triplet_items.push_back (MenuElem (grid_type_strings[(int)GridTypeBeatDiv6], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv6))); + triplet_items.push_back (MenuElem (grid_type_strings[(int)GridTypeBeatDiv12], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv12))); + triplet_items.push_back (MenuElem (grid_type_strings[(int)GridTypeBeatDiv24], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv24))); } grid_type_selector.AddMenuElem (Menu_Helpers::MenuElem (_("Triplets"), *_triplet_menu)); - //quintuplet grid + /* quintuplet grid */ Gtk::Menu *_quintuplet_menu = manage (new Menu); MenuList& quintuplet_items (_quintuplet_menu->items()); { - quintuplet_items.push_back( MenuElem( grid_type_strings[(int)GridTypeBeatDiv5], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv5) )); - quintuplet_items.push_back( MenuElem( grid_type_strings[(int)GridTypeBeatDiv10], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv10) )); - quintuplet_items.push_back( MenuElem( grid_type_strings[(int)GridTypeBeatDiv20], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv20) )); + quintuplet_items.push_back (MenuElem (grid_type_strings[(int)GridTypeBeatDiv5], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv5))); + quintuplet_items.push_back (MenuElem (grid_type_strings[(int)GridTypeBeatDiv10], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv10))); + quintuplet_items.push_back (MenuElem (grid_type_strings[(int)GridTypeBeatDiv20], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv20))); } grid_type_selector.AddMenuElem (Menu_Helpers::MenuElem (_("Quintuplets"), *_quintuplet_menu)); - //septuplet grid + /* septuplet grid */ Gtk::Menu *_septuplet_menu = manage (new Menu); MenuList& septuplet_items (_septuplet_menu->items()); { - septuplet_items.push_back( MenuElem( grid_type_strings[(int)GridTypeBeatDiv7], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv7) )); - septuplet_items.push_back( MenuElem( grid_type_strings[(int)GridTypeBeatDiv14], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv14) )); - septuplet_items.push_back( MenuElem( grid_type_strings[(int)GridTypeBeatDiv28], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv28) )); + septuplet_items.push_back (MenuElem (grid_type_strings[(int)GridTypeBeatDiv7], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv7))); + septuplet_items.push_back (MenuElem (grid_type_strings[(int)GridTypeBeatDiv14], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv14))); + septuplet_items.push_back (MenuElem (grid_type_strings[(int)GridTypeBeatDiv28], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeBeatDiv28))); } grid_type_selector.AddMenuElem (Menu_Helpers::MenuElem (_("Septuplets"), *_septuplet_menu)); grid_type_selector.AddMenuElem(SeparatorElem()); - grid_type_selector.AddMenuElem (MenuElem ( grid_type_strings[(int)GridTypeSmpte], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeSmpte))); - grid_type_selector.AddMenuElem (MenuElem ( grid_type_strings[(int)GridTypeMinSec], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeMinSec))); - grid_type_selector.AddMenuElem (MenuElem ( grid_type_strings[(int)GridTypeSamples], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeSamples))); + grid_type_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeSmpte], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeSmpte))); + grid_type_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeMinSec], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeMinSec))); + grid_type_selector.AddMenuElem (MenuElem (grid_type_strings[(int)GridTypeSamples], sigc::bind (sigc::mem_fun(*this, &Editor::grid_type_selection_done), (GridType) GridTypeSamples))); - set_size_request_to_display_given_text (grid_type_selector, _("Long Grid"), COMBO_TRIANGLE_WIDTH, 2); //problem: some of the rarely-used grid names are very long. Just do something arbitary, translators: rename this if needed + set_size_request_to_display_given_text (grid_type_selector, _("Long Grid"), COMBO_TRIANGLE_WIDTH, 2); // problem: some of the rarely-used grid names are very long. Just do something arbitary, translators: rename this if needed } void @@ -3377,16 +3379,15 @@ Editor::commit_reversible_selection_op () if (selection_op_cmd_depth == 1) { if (selection_op_history_it > 0 && selection_op_history_it < selection_op_history.size()) { - /** - The user has undone some selection ops and then made a new one, - making anything earlier in the list invalid. - */ + /* The user has undone some selection ops and then made a new one, + * making anything earlier in the list invalid. + */ list::iterator it = selection_op_history.begin(); list::iterator e_it = it; advance (e_it, selection_op_history_it); - for ( ; it != e_it; ++it) { + for (; it != e_it; ++it) { delete *it; } selection_op_history.erase (selection_op_history.begin(), e_it); @@ -3531,7 +3532,7 @@ Editor::duplicate_range (bool with_dialog) RegionSelection rs = get_regions_from_selection_and_entered (); - if ( selection->time.length() == 0 && rs.empty()) { + if (selection->time.length() == 0 && rs.empty()) { return; } @@ -3614,9 +3615,9 @@ Editor::cycle_edit_mode () } void -Editor::edit_mode_selection_done ( EditMode m ) +Editor::edit_mode_selection_done (EditMode m) { - Config->set_edit_mode ( m ); + Config->set_edit_mode (m); } void @@ -3664,7 +3665,7 @@ Editor::cycle_edit_point (bool with_marker) void Editor::edit_point_selection_done (EditPoint ep) { - set_edit_point_preference ( ep ); + set_edit_point_preference (ep); } void @@ -3672,18 +3673,18 @@ Editor::build_zoom_focus_menu () { using namespace Menu_Helpers; - zoom_focus_selector.AddMenuElem (MenuElem ( zoom_focus_strings[(int)ZoomFocusLeft], sigc::bind (sigc::mem_fun(*this, &Editor::zoom_focus_selection_done), (ZoomFocus) ZoomFocusLeft))); - zoom_focus_selector.AddMenuElem (MenuElem ( zoom_focus_strings[(int)ZoomFocusRight], sigc::bind (sigc::mem_fun(*this, &Editor::zoom_focus_selection_done), (ZoomFocus) ZoomFocusRight))); - zoom_focus_selector.AddMenuElem (MenuElem ( zoom_focus_strings[(int)ZoomFocusCenter], sigc::bind (sigc::mem_fun(*this, &Editor::zoom_focus_selection_done), (ZoomFocus) ZoomFocusCenter))); - zoom_focus_selector.AddMenuElem (MenuElem ( zoom_focus_strings[(int)ZoomFocusPlayhead], sigc::bind (sigc::mem_fun(*this, &Editor::zoom_focus_selection_done), (ZoomFocus) ZoomFocusPlayhead))); - zoom_focus_selector.AddMenuElem (MenuElem ( zoom_focus_strings[(int)ZoomFocusMouse], sigc::bind (sigc::mem_fun(*this, &Editor::zoom_focus_selection_done), (ZoomFocus) ZoomFocusMouse))); - zoom_focus_selector.AddMenuElem (MenuElem ( zoom_focus_strings[(int)ZoomFocusEdit], sigc::bind (sigc::mem_fun(*this, &Editor::zoom_focus_selection_done), (ZoomFocus) ZoomFocusEdit))); + zoom_focus_selector.AddMenuElem (MenuElem (zoom_focus_strings[(int)ZoomFocusLeft], sigc::bind (sigc::mem_fun(*this, &Editor::zoom_focus_selection_done), (ZoomFocus) ZoomFocusLeft))); + zoom_focus_selector.AddMenuElem (MenuElem (zoom_focus_strings[(int)ZoomFocusRight], sigc::bind (sigc::mem_fun(*this, &Editor::zoom_focus_selection_done), (ZoomFocus) ZoomFocusRight))); + zoom_focus_selector.AddMenuElem (MenuElem (zoom_focus_strings[(int)ZoomFocusCenter], sigc::bind (sigc::mem_fun(*this, &Editor::zoom_focus_selection_done), (ZoomFocus) ZoomFocusCenter))); + zoom_focus_selector.AddMenuElem (MenuElem (zoom_focus_strings[(int)ZoomFocusPlayhead], sigc::bind (sigc::mem_fun(*this, &Editor::zoom_focus_selection_done), (ZoomFocus) ZoomFocusPlayhead))); + zoom_focus_selector.AddMenuElem (MenuElem (zoom_focus_strings[(int)ZoomFocusMouse], sigc::bind (sigc::mem_fun(*this, &Editor::zoom_focus_selection_done), (ZoomFocus) ZoomFocusMouse))); + zoom_focus_selector.AddMenuElem (MenuElem (zoom_focus_strings[(int)ZoomFocusEdit], sigc::bind (sigc::mem_fun(*this, &Editor::zoom_focus_selection_done), (ZoomFocus) ZoomFocusEdit))); set_size_request_to_display_given_text (zoom_focus_selector, zoom_focus_strings, COMBO_TRIANGLE_WIDTH, 2); } void -Editor::zoom_focus_selection_done ( ZoomFocus f ) +Editor::zoom_focus_selection_done (ZoomFocus f) { RefPtr ract = zoom_focus_action (f); if (ract) { @@ -3740,13 +3741,13 @@ Editor::build_track_count_menu () void Editor::set_zoom_preset (int64_t ms) { - if ( ms <= 0 ) { + if (ms <= 0) { temporal_zoom_session(); return; } ARDOUR::samplecnt_t const sample_rate = ARDOUR::AudioEngine::instance()->sample_rate(); - temporal_zoom( (sample_rate * ms / 1000) / _visible_canvas_width ); + temporal_zoom ((sample_rate * ms / 1000) / _visible_canvas_width); } void @@ -3813,7 +3814,7 @@ void Editor::override_visible_track_count () { _visible_track_count = -1; - visible_tracks_selector.set_text ( _("*") ); + visible_tracks_selector.set_text (_("*")); } bool @@ -3883,13 +3884,13 @@ Editor::cycle_zoom_focus () void Editor::update_grid () { - if ( grid_musical() ) { + if (grid_musical()) { std::vector grid; if (bbt_ruler_scale != bbt_show_many) { compute_current_bbt_points (grid, _leftmost_sample, _leftmost_sample + current_page_samples()); } maybe_draw_grid_lines (); - } else if ( grid_nonmusical() ) { + } else if (grid_nonmusical()) { maybe_draw_grid_lines (); } else { hide_grid_lines (); @@ -3936,8 +3937,7 @@ Editor::set_stationary_playhead (bool yn) { if (_stationary_playhead != yn) { if ((_stationary_playhead = yn) == true) { - /* catch up */ - // FIXME need a 3.0 equivalent of this 2.X call + /* catch up -- FIXME need a 3.0 equivalent of this 2.X call */ // update_current_screen (); } instant_save (); @@ -4099,7 +4099,7 @@ Editor::playlist_deletion_dialog (boost::shared_ptr pl) dialog.add_button (_("Keep Remaining"), RESPONSE_NO); // ditto dialog.add_button (_("Cancel"), RESPONSE_CANCEL); - // by default gtk uses the left most button + /* by default gtk uses the left most button */ keep->grab_focus (); switch (dialog.run ()) { @@ -4397,8 +4397,7 @@ Editor::redo_visual_state () VisualState* vs = redo_visual_stack.back(); redo_visual_stack.pop_back(); - // can 'vs' really be 0? Is there a place that puts NULL pointers onto the stack? - // why do we check here? + /* XXX: can 'vs' really be 0? Is there a place that puts NULL pointers onto the stack? */ undo_visual_stack.push_back (current_visual_state (vs ? (vs->gui_state != 0) : false)); if (vs) { @@ -4513,7 +4512,7 @@ void Editor::ensure_visual_change_idle_handler () { if (pending_visual_change.idle_handler_id < 0) { - // see comment in add_to_idle_resize above. + /* see comment in add_to_idle_resize above. */ pending_visual_change.idle_handler_id = g_idle_add_full (G_PRIORITY_HIGH_IDLE + 10, _idle_visual_changer, this, NULL); pending_visual_change.being_handled = false; } @@ -4608,16 +4607,14 @@ Editor::visual_changer (const VisualChange& vc) } if (!(vc.pending & VisualChange::ZoomLevel)) { - /** - * If the canvas is not being zoomed then the canvas items will not change + /* If the canvas is not being zoomed then the canvas items will not change * and cause Item::prepare_for_render to be called so do it here manually. - * * Not ideal, but I can't think of a better solution atm. */ _track_canvas->prepare_for_render(); } - // If we are only scrolling vertically there is no need to update these + /* If we are only scrolling vertically there is no need to update these */ if (vc.pending != VisualChange::YOrigin) { update_fixed_rulers (); redisplay_grid (true); @@ -4668,11 +4665,11 @@ Editor::get_preferred_edit_position (EditIgnoreOption ignore, bool from_context_ return entered_marker->position(); } - if ( (ignore==EDIT_IGNORE_PHEAD) && ep == EditAtPlayhead) { + if ((ignore == EDIT_IGNORE_PHEAD) && ep == EditAtPlayhead) { ep = EditAtSelectedMarker; } - if ( (ignore==EDIT_IGNORE_MOUSE) && ep == EditAtMouse) { + if ((ignore == EDIT_IGNORE_MOUSE) && ep == EditAtMouse) { ep = EditAtPlayhead; } @@ -4864,13 +4861,13 @@ Editor::get_regions_from_selection_and_edit_point (EditIgnoreOption ignore, bool { RegionSelection regions; - if (_edit_point == EditAtMouse && entered_regionview && selection->tracks.empty() && selection->regions.empty() ) { + if (_edit_point == EditAtMouse && entered_regionview && selection->tracks.empty() && selection->regions.empty()) { regions.add (entered_regionview); } else { regions = selection->regions; } - if ( regions.empty() ) { + if (regions.empty()) { TrackViewList tracks = selection->tracks; if (!tracks.empty()) { @@ -4901,13 +4898,13 @@ Editor::get_regions_from_selection_and_mouse (samplepos_t pos) { RegionSelection regions; - if (entered_regionview && selection->tracks.empty() && selection->regions.empty() ) { + if (entered_regionview && selection->tracks.empty() && selection->regions.empty()) { regions.add (entered_regionview); } else { regions = selection->regions; } - if ( regions.empty() ) { + if (regions.empty()) { TrackViewList tracks = selection->tracks; if (!tracks.empty()) { @@ -5093,7 +5090,7 @@ Editor::first_idle () selection->set (rs); - // first idle adds route children (automation tracks), so we need to redisplay here + /* first idle adds route children (automation tracks), so we need to redisplay here */ _routes->redisplay (); delete dialog; @@ -5464,7 +5461,7 @@ Editor::hide_track_in_display (TimeAxisView* tv, bool apply_to_selection) PresentationInfo::ChangeSuspender cs; if (apply_to_selection) { - for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ) { + for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end();) { TrackSelection::iterator j = i; ++j; @@ -5477,7 +5474,7 @@ Editor::hide_track_in_display (TimeAxisView* tv, bool apply_to_selection) RouteTimeAxisView* rtv = dynamic_cast (tv); if (rtv && current_mixer_strip && (rtv->route() == current_mixer_strip->route())) { - // this will hide the mixer strip + /* this will hide the mixer strip */ set_selected_mixer_strip (*tv); } @@ -5792,27 +5789,28 @@ Editor::super_rapid_screen_update () _last_update_time = now; } - //snapped cursor stuff ( the snapped_cursor shows where an operation is going to occur ) + /* snapped cursor stuff (the snapped_cursor shows where an operation is going to occur) */ bool ignored; MusicSample where (sample, 0); - if ( !UIConfiguration::instance().get_show_snapped_cursor() ) { + if (!UIConfiguration::instance().get_show_snapped_cursor()) { snapped_cursor->hide (); - } else if ( _edit_point == EditAtPlayhead && !_dragging_playhead) { + } else if (_edit_point == EditAtPlayhead && !_dragging_playhead) { snap_to (where); // can't use snap_to_with_modifier? snapped_cursor->set_position (where.sample); snapped_cursor->show (); - } else if ( _edit_point == EditAtSelectedMarker ) { - //NOTE: I don't think EditAtSelectedMarker should snap. they are what they are. - //however, the current editing code -does- snap so I'll draw it that way for now. - if ( !selection->markers.empty() ) { + } else if (_edit_point == EditAtSelectedMarker) { + /* NOTE: I don't think EditAtSelectedMarker should snap. They are what they are. + * however, the current editing code -does- snap so I'll draw it that way for now. + */ + if (!selection->markers.empty()) { MusicSample ms (selection->markers.front()->position(), 0); - snap_to (ms); // should use snap_to_with_modifier? - snapped_cursor->set_position ( ms.sample ); + snap_to (ms); // should use snap_to_with_modifier? + snapped_cursor->set_position (ms.sample); snapped_cursor->show (); } - } else if (mouse_sample (where.sample, ignored)) { //cursor is in the editing canvas. show it. + } else if (mouse_sample (where.sample, ignored)) { // cursor is in the editing canvas. show it. snapped_cursor->show (); - } else { //mouse is out of the editing canvas. hide the snapped_cursor + } else { // mouse is out of the editing canvas. hide the snapped_cursor snapped_cursor->hide (); } @@ -5865,7 +5863,7 @@ Editor::super_rapid_screen_update () if (target <= 0.0) { target = 0.0; } - // compare to EditorCursor::set_position() + /* compare to EditorCursor::set_position() */ double const old_pos = sample_to_pixel_unrounded (_leftmost_sample); double const new_pos = sample_to_pixel_unrounded (target); if (rint (new_pos) != rint (old_pos)) { diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index cf25538d49..72a86808d0 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -584,24 +584,25 @@ Editor::autoscroll_active () const } std::pair -Editor::session_gui_extents ( bool use_extra ) const +Editor::session_gui_extents (bool use_extra) const { if (!_session) { return std::pair (max_samplepos,0); } - + samplecnt_t session_extent_start = _session->current_start_sample(); samplecnt_t session_extent_end = _session->current_end_sample(); - //calculate the extents of all regions in every playlist - //NOTE: we should listen to playlists, and cache these values so we don't calculate them every time. + /* calculate the extents of all regions in every playlist + * NOTE: we should listen to playlists, and cache these values so we don't calculate them every time. + */ { boost::shared_ptr rl = _session->get_routes(); for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) { boost::shared_ptr tr = boost::dynamic_pointer_cast (*r); if (tr) { boost::shared_ptr pl = tr->playlist(); - if ( pl && !pl->all_regions_empty() ) { + if (pl && !pl->all_regions_empty()) { pair e; e = pl->get_extent(); if (e.first < session_extent_start) { @@ -615,23 +616,23 @@ Editor::session_gui_extents ( bool use_extra ) const } } - //ToDo: also incorporate automation regions (in case the session has no audio/midi but is just used for automating plugins or the like) + /* ToDo: also incorporate automation regions (in case the session has no audio/midi but is just used for automating plugins or the like) */ - //add additional time to the ui extents ( user-defined in config ) + /* add additional time to the ui extents (user-defined in config) */ if (use_extra) { samplecnt_t const extra = UIConfiguration::instance().get_extra_ui_extents_time() * 60 * _session->nominal_sample_rate(); session_extent_end += extra; session_extent_start -= extra; } - - //range-check + + /* range-check */ if (session_extent_end > max_samplepos) { session_extent_end = max_samplepos; } if (session_extent_start < 0) { session_extent_start = 0; } - + std::pair ret (session_extent_start, session_extent_end); return ret; } @@ -667,7 +668,7 @@ Editor::autoscroll_canvas () dx += 10 + (2 * (autoscroll_cnt/2)); dx = pixel_to_sample (dx); - + dx *= UIConfiguration::instance().get_draggable_playhead_speed(); if (_leftmost_sample < max_samplepos - dx) { @@ -1336,13 +1337,13 @@ Editor::which_canvas_cursor(ItemType type) const cursor = _cursors->cross_hair; break; case LeftFrameHandle: - if ( effective_mouse_mode() == MouseObject ) // (smart mode): if the user is in the btm half, show the trim cursor + if (effective_mouse_mode() == MouseObject) // (smart mode): if the user is in the btm half, show the trim cursor cursor = which_trim_cursor (true); else - cursor = _cursors->selector; // (smart mode): in the top half, just show the selection (range) cursor + cursor = _cursors->selector; // (smart mode): in the top half, just show the selection (range) cursor break; case RightFrameHandle: - if ( effective_mouse_mode() == MouseObject ) //see above + if (effective_mouse_mode() == MouseObject) // see above cursor = which_trim_cursor (false); else cursor = _cursors->selector; diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 6b24acd938..df559cf8f0 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -215,7 +215,7 @@ Editor::mouse_mode_object_range_toggled() Glib::RefPtr tact = Glib::RefPtr::cast_dynamic (act); assert (tact); - set_mouse_mode(m, true); //call this so the button styles can get updated + set_mouse_mode (m, true); // call this so the button styles can get updated } bool @@ -227,7 +227,7 @@ Editor::snap_mode_button_clicked (GdkEventButton* ev) } RCOptionEditor* rc_option_editor = ARDOUR_UI::instance()->get_rc_option_editor(); - if ( rc_option_editor ) { + if (rc_option_editor) { ARDOUR_UI::instance()->show_tabbable (rc_option_editor); rc_option_editor->set_current_page (_("Editor/Snap")); } @@ -271,8 +271,8 @@ Editor::set_mouse_mode (MouseMode m, bool force) } if (ARDOUR::Profile->get_mixbus()) { - if ( m == MouseCut) m = MouseObject; - if ( m == MouseAudition) m = MouseRange; + if (m == MouseCut) m = MouseObject; + if (m == MouseAudition) m = MouseRange; } Glib::RefPtr act = get_mouse_mode_action(m); @@ -282,15 +282,15 @@ Editor::set_mouse_mode (MouseMode m, bool force) tact->set_active (false); tact->set_active (true); - //NOTE: this will result in a call to mouse_mode_toggled which does the heavy lifting + /* NOTE: this will result in a call to mouse_mode_toggled which does the heavy lifting */ } void Editor::mouse_mode_toggled (MouseMode m) { if (ARDOUR::Profile->get_mixbus()) { - if ( m == MouseCut) m = MouseObject; - if ( m == MouseAudition) m = MouseRange; + if (m == MouseCut) m = MouseObject; + if (m == MouseAudition) m = MouseRange; } Glib::RefPtr act = get_mouse_mode_action(m); @@ -932,7 +932,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT break; case StreamItem: - //in the past, we created a new midi region here, but perhaps that is best left to the Draw mode + /* in the past, we created a new midi region here, but perhaps that is best left to the Draw mode */ break; case AutomationTrackItem: @@ -977,11 +977,14 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT case StartCrossFadeItem: case EndCrossFadeItem: - /* we might allow user to grab inside the fade to trim a region with preserve_fade_anchor. for not this is not fully implemented */ -// if (!clicked_regionview->region()->locked()) { -// _drags->set (new TrimDrag (this, item, clicked_regionview, selection->regions.by_layer(), true), event); -// return true; -// } + /* we might allow user to grab inside the fade to trim a region with preserve_fade_anchor. + * For not this is not fully implemented */ +#if 0 + if (!clicked_regionview->region()->locked()) { + _drags->set (new TrimDrag (this, item, clicked_regionview, selection->regions.by_layer(), true), event); + return true; + } +#endif break; case FeatureLineItem: @@ -1127,7 +1130,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT pair tvp = trackview_by_y_position (y, false); if (tvp.first) { AutomationTimeAxisView* atv = dynamic_cast (tvp.first); - if ( atv) { + if (atv) { /* smart "join" mode: drag automation */ _drags->set (new AutomationRangeDrag (this, atv, selection->time), event, _cursors->up_down); } @@ -1298,11 +1301,11 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp if ((item_type != FadeInHandleItem) && (item_type != FadeOutHandleItem) && - !_drags->active () && - _session && - !_session->transport_rolling() && - (effective_mouse_mode() == MouseRange) && - UIConfiguration::instance().get_follow_edits() && + !_drags->active () && + _session && + !_session->transport_rolling() && + (effective_mouse_mode() == MouseRange) && + UIConfiguration::instance().get_follow_edits() && !_session->config.get_external_sync()) { MusicSample where (canvas_event_sample (event), 0); @@ -1600,7 +1603,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT case CdMarkerBarItem: if (!_dragging_playhead) { - // if we get here then a dragged range wasn't done + /* if we get here then a dragged range wasn't done */ snap_to_with_modifier (where, event, RoundNearest, SnapToAny, true); mouse_add_new_marker (where.sample, true); } @@ -1702,7 +1705,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT } else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::ModifierMask (Keyboard::TertiaryModifier|Keyboard::SecondaryModifier))) { lower_region (); } else { - // Button2 click is unused + /* Button2 click is unused */ } return true; @@ -2100,7 +2103,7 @@ Editor::motion_handler (ArdourCanvas::Item* /*item*/, GdkEvent* event, bool from update_join_object_range_location (event->motion.y); - //snapped_cursor stuff ( the snapped_cursor shows where an operation is going to occur ) + /* snapped_cursor stuff (the snapped_cursor shows where an operation is going to occur) */ bool ignored; MusicSample where (0, 0); if (mouse_sample (where.sample, ignored)) { @@ -2108,7 +2111,7 @@ Editor::motion_handler (ArdourCanvas::Item* /*item*/, GdkEvent* event, bool from set_snapped_cursor_position (where.sample); } - //drags might also change the snapped_cursor location, because we are snapping the thing being dragged, not the actual mouse cursor + /* drags might also change the snapped_cursor location, because we are snapping the thing being dragged, not the actual mouse cursor */ if (_drags->active ()) { return _drags->motion_handler (event, from_autoscroll); } @@ -2421,7 +2424,7 @@ Editor::mouse_brush_insert_region (RegionView* rv, samplepos_t pos) playlist->add_region (new_region, pos); _session->add_command (new StatefulDiffCommand (playlist)); - // playlist is frozen, so we have to update manually XXX this is disgusting + /* playlist is frozen, so we have to update manually XXX this is disgusting */ //playlist->RegionAdded (new_region); /* EMIT SIGNAL */ } @@ -2558,17 +2561,16 @@ Editor::escape () _drags->abort (); } else { selection->clear (); - - //if session is playing a range, cancel that + + /* if session is playing a range, cancel that */ if (_session->get_play_range()) { _session->request_cancel_play_range(); } - if ( _session->solo_selection_active() ) { + if (_session->solo_selection_active()) { StripableList sl; - _session->solo_selection( sl, false ); + _session->solo_selection (sl, false); } - } ARDOUR_UI::instance()->reset_focus (&contents()); @@ -2596,9 +2598,10 @@ Editor::update_join_object_range_location (double y) if (entered_regionview) { - //ToDo: there is currently a bug here(?) - //when we are inside a region fade handle, it acts as though we are in range mode because it is in the top half of the region - //can it be fixed here? + /* TODO: there is currently a bug here(?) + * when we are inside a region fade handle, it acts as though we are in range mode because it is in the top half of the region + * can it be fixed here? + */ ArdourCanvas::Duple const item_space = entered_regionview->get_canvas_group()->canvas_to_item (ArdourCanvas::Duple (0, y)); double const c = item_space.y / entered_regionview->height(); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 7ba7e94452..da4e4e3a4f 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -708,12 +708,12 @@ void Editor::build_region_boundary_cache () { - //ToDo: maybe set a timer so we don't recalutate when lots of changes are coming in + //ToDo: maybe set a timer so we don't recalutate when lots of changes are coming in //ToDo: maybe somehow defer this until session is fully loaded. - - if ( !_region_boundary_cache_dirty ) + + if (!_region_boundary_cache_dirty) return; - + samplepos_t pos = 0; vector interesting_points; boost::shared_ptr r; @@ -727,20 +727,20 @@ Editor::build_region_boundary_cache () } bool maybe_first_sample = false; - - if ( UIConfiguration::instance().get_snap_to_region_start() ) { + + if (UIConfiguration::instance().get_snap_to_region_start()) { interesting_points.push_back (Start); maybe_first_sample = true; } - - if ( UIConfiguration::instance().get_snap_to_region_end() ) { + + if (UIConfiguration::instance().get_snap_to_region_end()) { interesting_points.push_back (End); } - - if ( UIConfiguration::instance().get_snap_to_region_sync() ) { + + if (UIConfiguration::instance().get_snap_to_region_sync()) { interesting_points.push_back (SyncPoint); } - + TimeAxisView *ontrack = 0; TrackViewList tlist; @@ -822,7 +822,7 @@ Editor::build_region_boundary_cache () /* finally sort to be sure that the order is correct */ sort (region_boundary_cache.begin(), region_boundary_cache.end()); - + _region_boundary_cache_dirty = false; } @@ -1962,13 +1962,13 @@ void Editor::temporal_zoom_selection (Editing::ZoomAxis axes) { if (!selection) return; - - if ( selection->regions.empty() && selection->time.empty() ) { + + if (selection->regions.empty() && selection->time.empty()) { if (axes == Horizontal || axes == Both) { temporal_zoom_step(true); } if (axes == Vertical || axes == Both) { - if ( !track_views.empty() ) { + if (!track_views.empty()) { TrackViewList tvl; @@ -1977,7 +1977,7 @@ Editor::temporal_zoom_selection (Editing::ZoomAxis axes) const double btm = top + _visible_canvas_height + 10; for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) { - if ( (*iter)->covered_by_y_range (top, btm) ) { + if ((*iter)->covered_by_y_range (top, btm)) { tvl.push_back(*iter); } } @@ -2004,10 +2004,10 @@ Editor::temporal_zoom_selection (Editing::ZoomAxis axes) if (axes == Vertical || axes == Both) { fit_selection (); } - + //normally, we don't do anything "automatic" to the user's selection. //but in this case, we will clear the selection after a zoom-to-selection. - selection->clear(); + selection->clear(); } void @@ -5891,18 +5891,18 @@ Editor::toggle_record_enable () } StripableList -tracklist_to_stripables( TrackViewList list ) +tracklist_to_stripables (TrackViewList list) { StripableList ret; - + for (TrackSelection::iterator i = list.begin(); i != list.end(); ++i) { RouteTimeAxisView* rtv = dynamic_cast ((*i)); if (rtv && rtv->is_track()) { - ret.push_back( rtv->track() ); + ret.push_back (rtv->track()); } } - + return ret; } @@ -5911,25 +5911,25 @@ Editor::play_solo_selection (bool restart) { //note: session::solo_selection takes care of invalidating the region playlist - if ( (!selection->tracks.empty()) && selection->time.length() > 0 ) { //a range is selected; solo the tracks and roll - - StripableList sl = tracklist_to_stripables (selection->tracks); - _session->solo_selection( sl, true ); + if ((!selection->tracks.empty()) && selection->time.length() > 0) { //a range is selected; solo the tracks and roll - if ( restart ) { + StripableList sl = tracklist_to_stripables (selection->tracks); + _session->solo_selection (sl, true); + + if (restart) { samplepos_t start = selection->time.start(); samplepos_t end = selection->time.end_sample(); _session->request_bounded_roll (start, end); } - } else if ( ! selection->tracks.empty() ) { //no range is selected, but tracks are selected; solo the tracks and roll + } else if (! selection->tracks.empty()) { //no range is selected, but tracks are selected; solo the tracks and roll StripableList sl = tracklist_to_stripables (selection->tracks); - _session->solo_selection( sl, true ); + _session->solo_selection (sl, true); _session->request_cancel_play_range(); transition_to_rolling (true); - - } else if ( ! selection->regions.empty() ) { //solo any tracks with selected regions, and roll - StripableList sl = tracklist_to_stripables ( get_tracks_for_range_action() ); - _session->solo_selection( sl, true ); + + } else if (! selection->regions.empty()) { //solo any tracks with selected regions, and roll + StripableList sl = tracklist_to_stripables (get_tracks_for_range_action()); + _session->solo_selection (sl, true); _session->request_cancel_play_range(); transition_to_rolling (true); } else { @@ -6621,7 +6621,7 @@ Editor::set_punch_start_from_edit_point () snap_to(start); //if there's not already a sensible selection endpoint, go "forever" - if (start.sample > end ) { + if (start.sample > end) { end = max_samplepos; } @@ -6682,7 +6682,7 @@ Editor::set_loop_start_from_edit_point () snap_to (start); //if there's not already a sensible selection endpoint, go "forever" - if (start.sample > end ) { + if (start.sample > end) { end = max_samplepos; } @@ -7132,7 +7132,7 @@ Editor::snap_regions_to_grid () (*r)->region()->clear_changes (); MusicSample start ((*r)->region()->first_sample (), 0); - snap_to (start, RoundNearest, SnapToGrid ); + snap_to (start, RoundNearest, SnapToGrid); (*r)->region()->set_position (start.sample, start.division); _session->add_command(new StatefulDiffCommand ((*r)->region())); } @@ -7549,7 +7549,7 @@ edit your ardour.rc file to set the\n\ /* Route deletion calls Editor::timeaxisview_deleted() iteratively (for each deleted * route). If the deleted route is currently displayed in the Editor-Mixer (highly * likely because deletion requires selection) this will call - * Editor::set_selected_mixer_strip () which is expensive ( MixerStrip::set_route() ). + * Editor::set_selected_mixer_strip () which is expensive (MixerStrip::set_route()). * It's likewise likely that the route that has just been displayed in the * Editor-Mixer will be next in line for deletion. * @@ -7602,7 +7602,7 @@ Editor::do_insert_time () msg.run (); return; } - + InsertRemoveTimeDialog d (*this); int response = d.run (); diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc index c9e8bbf443..bf67577ef3 100644 --- a/gtk2_ardour/editor_rulers.cc +++ b/gtk2_ardour/editor_rulers.cc @@ -209,7 +209,7 @@ Editor::popup_ruler_menu (samplepos_t where, ItemType t) switch (t) { case MarkerBarItem: - ruler_items.push_back (MenuElem (_("New location marker"), sigc::bind ( sigc::mem_fun(*this, &Editor::mouse_add_new_marker), where, false))); + ruler_items.push_back (MenuElem (_("New location marker"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_add_new_marker), where, false))); ruler_items.push_back (MenuElem (_("Clear all locations"), sigc::mem_fun(*this, &Editor::clear_markers))); ruler_items.push_back (MenuElem (_("Unhide locations"), sigc::mem_fun(*this, &Editor::unhide_markers))); break; @@ -227,15 +227,15 @@ Editor::popup_ruler_menu (samplepos_t where, ItemType t) case CdMarkerBarItem: // TODO - ruler_items.push_back (MenuElem (_("New CD track marker"), sigc::bind ( sigc::mem_fun(*this, &Editor::mouse_add_new_marker), where, true))); + ruler_items.push_back (MenuElem (_("New CD track marker"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_add_new_marker), where, true))); break; case TempoBarItem: - ruler_items.push_back (MenuElem (_("New Tempo"), sigc::bind ( sigc::mem_fun(*this, &Editor::mouse_add_new_tempo_event), where))); + ruler_items.push_back (MenuElem (_("New Tempo"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_add_new_tempo_event), where))); break; case MeterBarItem: - ruler_items.push_back (MenuElem (_("New Meter"), sigc::bind ( sigc::mem_fun(*this, &Editor::mouse_add_new_meter_event), where))); + ruler_items.push_back (MenuElem (_("New Meter"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_add_new_meter_event), where))); break; case VideoBarItem: @@ -245,11 +245,11 @@ Editor::popup_ruler_menu (samplepos_t where, ItemType t) */ //ruler_items.push_back (MenuElem (_("Timeline height"))); // heading //static_cast(&ruler_items.back())->set_sensitive(false); - ruler_items.push_back (CheckMenuElem (_("Large"), sigc::bind ( sigc::mem_fun(*this, &Editor::set_video_timeline_height), 6))); + ruler_items.push_back (CheckMenuElem (_("Large"), sigc::bind (sigc::mem_fun(*this, &Editor::set_video_timeline_height), 6))); if (videotl_bar_height == 6) { static_cast(&ruler_items.back())->set_active(true);} - ruler_items.push_back (CheckMenuElem (_("Normal"), sigc::bind ( sigc::mem_fun(*this, &Editor::set_video_timeline_height), 4))); + ruler_items.push_back (CheckMenuElem (_("Normal"), sigc::bind (sigc::mem_fun(*this, &Editor::set_video_timeline_height), 4))); if (videotl_bar_height == 4) { static_cast(&ruler_items.back())->set_active(true);} - ruler_items.push_back (CheckMenuElem (_("Small"), sigc::bind ( sigc::mem_fun(*this, &Editor::set_video_timeline_height), 3))); + ruler_items.push_back (CheckMenuElem (_("Small"), sigc::bind (sigc::mem_fun(*this, &Editor::set_video_timeline_height), 3))); if (videotl_bar_height == 3) { static_cast(&ruler_items.back())->set_active(true);} ruler_items.push_back (SeparatorElem ()); @@ -815,9 +815,9 @@ Editor::metric_get_timecode (std::vector& marks, gdou switch (timecode_ruler_scale) { case timecode_show_bits: // Find timecode time of this sample (pos) with subframe accuracy - _session->sample_to_timecode(pos, timecode, true /* use_offset */, true /* use_subframes */ ); + _session->sample_to_timecode(pos, timecode, true /* use_offset */, true /* use_subframes */); for (n = 0; n < timecode_nmarks; n++) { - _session->timecode_to_sample(timecode, pos, true /* use_offset */, true /* use_subframes */ ); + _session->timecode_to_sample(timecode, pos, true /* use_offset */, true /* use_subframes */); if ((timecode.subframes % timecode_mark_modulo) == 0) { if (timecode.subframes == 0) { mark.style = ArdourCanvas::Ruler::Mark::Major; @@ -834,17 +834,17 @@ Editor::metric_get_timecode (std::vector& marks, gdou mark.position = pos; marks.push_back (mark); // Increment subframes by one - Timecode::increment_subframes( timecode, _session->config.get_subframes_per_frame() ); + Timecode::increment_subframes (timecode, _session->config.get_subframes_per_frame()); } break; case timecode_show_samples: // Find timecode time of this sample (pos) - _session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ ); + _session->sample_to_timecode (pos, timecode, true /* use_offset */, false /* use_subframes */); // Go to next whole sample down - Timecode::frames_floot( timecode ); + Timecode::frames_floot (timecode); for (n = 0; n < timecode_nmarks; n++) { - _session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ ); + _session->timecode_to_sample (timecode, pos, true /* use_offset */, false /* use_subframes */); if ((timecode.frames % timecode_mark_modulo) == 0) { if (timecode.frames == 0) { mark.style = ArdourCanvas::Ruler::Mark::Major; @@ -860,17 +860,17 @@ Editor::metric_get_timecode (std::vector& marks, gdou } mark.label = buf; marks.push_back (mark); - Timecode::increment( timecode, _session->config.get_subframes_per_frame() ); + Timecode::increment (timecode, _session->config.get_subframes_per_frame()); } break; case timecode_show_seconds: // Find timecode time of this sample (pos) - _session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ ); + _session->sample_to_timecode (pos, timecode, true /* use_offset */, false /* use_subframes */); // Go to next whole second down - Timecode::seconds_floor( timecode ); + Timecode::seconds_floor (timecode); for (n = 0; n < timecode_nmarks; n++) { - _session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ ); + _session->timecode_to_sample (timecode, pos, true /* use_offset */, false /* use_subframes */); if ((timecode.seconds % timecode_mark_modulo) == 0) { if (timecode.seconds == 0) { mark.style = ArdourCanvas::Ruler::Mark::Major; @@ -887,17 +887,17 @@ Editor::metric_get_timecode (std::vector& marks, gdou } mark.label = buf; marks.push_back (mark); - Timecode::increment_seconds( timecode, _session->config.get_subframes_per_frame() ); + Timecode::increment_seconds (timecode, _session->config.get_subframes_per_frame()); } break; case timecode_show_minutes: //Find timecode time of this sample (pos) - _session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ ); + _session->sample_to_timecode (pos, timecode, true /* use_offset */, false /* use_subframes */); // Go to next whole minute down - Timecode::minutes_floor( timecode ); + Timecode::minutes_floor (timecode); for (n = 0; n < timecode_nmarks; n++) { - _session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ ); + _session->timecode_to_sample (timecode, pos, true /* use_offset */, false /* use_subframes */); if ((timecode.minutes % timecode_mark_modulo) == 0) { if (timecode.minutes == 0) { mark.style = ArdourCanvas::Ruler::Mark::Major; @@ -912,16 +912,16 @@ Editor::metric_get_timecode (std::vector& marks, gdou mark.label = buf; mark.position = pos; marks.push_back (mark); - Timecode::increment_minutes( timecode, _session->config.get_subframes_per_frame() ); + Timecode::increment_minutes (timecode, _session->config.get_subframes_per_frame()); } break; case timecode_show_hours: // Find timecode time of this sample (pos) - _session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ ); + _session->sample_to_timecode (pos, timecode, true /* use_offset */, false /* use_subframes */); // Go to next whole hour down - Timecode::hours_floor( timecode ); + Timecode::hours_floor (timecode); for (n = 0; n < timecode_nmarks; n++) { - _session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ ); + _session->timecode_to_sample (timecode, pos, true /* use_offset */, false /* use_subframes */); if ((timecode.hours % timecode_mark_modulo) == 0) { mark.style = ArdourCanvas::Ruler::Mark::Major; snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames); @@ -932,17 +932,17 @@ Editor::metric_get_timecode (std::vector& marks, gdou mark.label = buf; mark.position = pos; marks.push_back (mark); - Timecode::increment_hours( timecode, _session->config.get_subframes_per_frame() ); + Timecode::increment_hours (timecode, _session->config.get_subframes_per_frame()); } break; case timecode_show_many_hours: // Find timecode time of this sample (pos) - _session->sample_to_timecode(pos, timecode, true /* use_offset */, false /* use_subframes */ ); + _session->sample_to_timecode (pos, timecode, true /* use_offset */, false /* use_subframes */); // Go to next whole hour down Timecode::hours_floor (timecode); - for (n = 0; n < timecode_nmarks; ) { - _session->timecode_to_sample(timecode, pos, true /* use_offset */, false /* use_subframes */ ); + for (n = 0; n < timecode_nmarks;) { + _session->timecode_to_sample (timecode, pos, true /* use_offset */, false /* use_subframes */); if ((timecode.hours % timecode_mark_modulo) == 0) { mark.style = ArdourCanvas::Ruler::Mark::Major; snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames); @@ -1075,17 +1075,17 @@ Editor::compute_bbt_ruler_scale (samplepos_t lower, samplepos_t upper) } //set upper limits on the beat_density based on the user's grid selection - if ( _grid_type == GridTypeBar ) { + if (_grid_type == GridTypeBar) { beat_density = fmax (beat_density, 16.01); - } else if ( _grid_type == GridTypeBeat ) { + } else if (_grid_type == GridTypeBeat) { beat_density = fmax (beat_density, 4.001); - } else if ( _grid_type == GridTypeBeatDiv4) { + } else if (_grid_type == GridTypeBeatDiv4) { beat_density = fmax (beat_density, 2.001); - } else if ( _grid_type == GridTypeBeatDiv8) { + } else if (_grid_type == GridTypeBeatDiv8) { beat_density = fmax (beat_density, 1.001); - } else if ( _grid_type == GridTypeBeatDiv16) { + } else if (_grid_type == GridTypeBeatDiv16) { beat_density = fmax (beat_density, 0.2501); - } else if ( _grid_type == GridTypeBeatDiv32) { + } else if (_grid_type == GridTypeBeatDiv32) { beat_density = fmax (beat_density, 0.12501); } @@ -1411,7 +1411,7 @@ Editor::metric_get_bbt (std::vector& marks, gdouble l case bbt_show_many: bbt_nmarks = 1; - snprintf (buf, sizeof(buf), "cannot handle %" PRIu32 " bars", bbt_bars ); + snprintf (buf, sizeof(buf), "cannot handle %" PRIu32 " bars", bbt_bars); mark.style = ArdourCanvas::Ruler::Mark::Major; mark.label = buf; mark.position = lower; @@ -1551,13 +1551,12 @@ Editor::metric_get_samples (std::vector& marks, gdoub } static void -sample_to_clock_parts ( samplepos_t sample, - samplepos_t sample_rate, - long *hrs_p, - long *mins_p, - long *secs_p, - long *millisecs_p) - +sample_to_clock_parts (samplepos_t sample, + samplepos_t sample_rate, + long* hrs_p, + long* mins_p, + long* secs_p, + long* millisecs_p) { samplepos_t left; long hrs; @@ -1725,10 +1724,10 @@ Editor::metric_get_minsec (std::vector& marks, gdoubl lower = 0; } - if ( minsec_mark_interval== 0) { //we got here too early; divide-by-zero imminent + if (minsec_mark_interval == 0) { //we got here too early; divide-by-zero imminent return; } - + pos = (((1000 * (samplepos_t) floor(lower)) + (minsec_mark_interval/2))/minsec_mark_interval) * minsec_mark_interval; switch (minsec_ruler_scale) { @@ -1810,7 +1809,7 @@ Editor::metric_get_minsec (std::vector& marks, gdoubl break; case minsec_show_many_hours: - for (n = 0; n < minsec_nmarks; ) { + for (n = 0; n < minsec_nmarks;) { sample_to_clock_parts (pos, _session->sample_rate(), &hrs, &mins, &secs, &millisecs); if (hrs % minsec_mark_modulo == 0) { mark.style = ArdourCanvas::Ruler::Mark::Major; diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index 6a894eae24..93c7494630 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -143,9 +143,9 @@ EditorSummary::render_background_image () double theoretical_end = ext.second; /* the summary should encompass the full extent of everywhere we've visited since the session was opened */ - if ( _leftmost < theoretical_start) + if (_leftmost < theoretical_start) theoretical_start = _leftmost; - if ( _rightmost > theoretical_end ) + if (_rightmost > theoretical_end) theoretical_end = _rightmost; /* range-check */ @@ -184,24 +184,24 @@ EditorSummary::render_background_image () /* paint a non-bg colored strip to represent the track itself */ - if ( _track_height > 4 ) { + if (_track_height > 4) { cairo_set_source_rgb (cr, 0.2, 0.2, 0.2); cairo_set_line_width (cr, _track_height - 1); cairo_move_to (cr, 0, y + _track_height / 2); cairo_line_to (cr, get_width(), y + _track_height / 2); cairo_stroke (cr); } - + StreamView* s = (*i)->view (); if (s) { cairo_set_line_width (cr, _track_height * 0.8); s->foreach_regionview (sigc::bind ( - sigc::mem_fun (*this, &EditorSummary::render_region), - cr, - y + _track_height / 2 - )); + sigc::mem_fun (*this, &EditorSummary::render_region), + cr, + y + _track_height / 2 + )); } y += _track_height; @@ -238,17 +238,17 @@ EditorSummary::render (Cairo::RefPtr const& ctx, cairo_rectangle /* maintain the leftmost and rightmost locations that we've ever reached */ samplecnt_t const leftmost = _editor->leftmost_sample (); - if ( leftmost < _leftmost) { + if (leftmost < _leftmost) { _leftmost = leftmost; _background_dirty = true; } samplecnt_t const rightmost = leftmost + _editor->current_page_samples(); - if ( rightmost > _rightmost) { + if (rightmost > _rightmost) { _rightmost = rightmost; _background_dirty = true; } - //draw the background (regions, markers, etc ) if they've changed + /* draw the background (regions, markers, etc) if they've changed */ if (!_image || _background_dirty) { render_background_image (); _background_dirty = false; @@ -439,7 +439,7 @@ EditorSummary::on_button_press_event (GdkEventButton* ev) { _old_follow_playhead = _editor->follow_playhead (); - if (ev->button == 3) { //right-click: show the reset menu action + if (ev->button == 3) { // right-click: show the reset menu action using namespace Gtk::Menu_Helpers; Gtk::Menu* m = manage (new Gtk::Menu); MenuList& items = m->items (); @@ -495,7 +495,7 @@ EditorSummary::on_button_press_event (GdkEventButton* ev) _editor->set_follow_playhead (false); _move_dragging = true; - + _last_mx = ev->x; _last_my = ev->y; _last_dx = 0; @@ -503,7 +503,7 @@ EditorSummary::on_button_press_event (GdkEventButton* ev) _last_y_delta = 0; get_window()->set_cursor (*_editor->_cursors->expand_left_right); - + } return true; @@ -576,7 +576,7 @@ EditorSummary::get_position (double x, double y) const void EditorSummary::reset_to_extents() { - //reset as if the user never went anywhere outside the extents + /* reset as if the user never went anywhere outside the extents */ _leftmost = max_samplepos; _rightmost = 0; @@ -609,7 +609,7 @@ EditorSummary::set_cursor (Position p) } void -EditorSummary::summary_zoom_step ( int steps /* positive steps to zoom "out" , negative steps to zoom "in" */ ) +EditorSummary::summary_zoom_step (int steps /* positive steps to zoom "out" , negative steps to zoom "in" */ ) { pair xn; @@ -618,9 +618,12 @@ EditorSummary::summary_zoom_step ( int steps /* positive steps to zoom "out" , n xn.first -= steps; xn.second += steps; - //for now, disallow really close zooming-in from the scroomer. ( currently it causes the start-offset to 'walk' because of integer limitations. to fix this, probably need to maintain float throught the get/set_editor() path ) + /* for now, disallow really close zooming-in from the scroomer. (Currently it + * causes the start-offset to 'walk' because of integer limitations. + * To fix this, probably need to maintain float throught the get/set_editor() path.) + */ if (steps<0) { - if ( (xn.second-xn.first) < 2) + if ((xn.second - xn.first) < 2) return; } @@ -634,49 +637,48 @@ EditorSummary::on_motion_notify_event (GdkEventMotion* ev) { if (_move_dragging) { - //To avoid accidental zooming, the mouse must move exactly vertical, not diagonal, to trigger a zoom step - //we use screen coordinates for this, not canvas-based grab_x + /* To avoid accidental zooming, the mouse must move exactly vertical, not diagonal, to trigger a zoom step + * we use screen coordinates for this, not canvas-based grab_x */ double mx = ev->x; double dx = mx - _last_mx; double my = ev->y; double dy = my - _last_my; - //do zooming in windowed "steps" so it feels more reversible ? + /* do zooming in windowed "steps" so it feels more reversible ? */ const int stepsize = 2; int y_delta = _start_mouse_y - my; y_delta = y_delta / stepsize; - //do the zoom? + /* do the zoom? */ const float zscale = 3; - if ( (dx==0) && (_last_dx ==0) && (y_delta != _last_y_delta) ) { + if ((dx == 0) && (_last_dx == 0) && (y_delta != _last_y_delta)) { - summary_zoom_step( dy * zscale ); + summary_zoom_step (dy * zscale); - //after the zoom we must re-calculate x-pos grabs + /* after the zoom we must re-calculate x-pos grabs */ pair xr; get_editor (&xr); _start_editor_x = xr; _start_mouse_x = ev->x; - + _last_y_delta = y_delta; } - - //always track horizontal movement, if any - if ( dx != 0 ) { + + /* always track horizontal movement, if any */ + if (dx != 0) { double x = _start_editor_x.first; x += ev->x - _start_mouse_x; - + if (x < 0) { x = 0; } - //zoom-behavior-tweaks - //protect the right edge from expanding beyond the end + /* zoom-behavior-tweaks: protect the right edge from expanding beyond the end */ pair xr; get_editor (&xr); double w = xr.second - xr.first; - if ( x + w < get_width() ) { + if (x + w < get_width()) { set_editor (x); } } @@ -696,9 +698,8 @@ EditorSummary::on_motion_notify_event (GdkEventMotion* ev) xr.first += dx; } else if (_zoom_trim_position == RIGHT) { - //zoom-behavior-tweaks - //protect the right edge from expanding beyond the edge - if ( (xr.second + dx) < get_width() ) { + /* zoom-behavior-tweaks: protect the right edge from expanding beyond the edge */ + if ((xr.second + dx) < get_width()) { xr.second += dx; } @@ -712,7 +713,7 @@ EditorSummary::on_motion_notify_event (GdkEventMotion* ev) set_editor (xr); } else { - set_cursor ( get_position(ev->x, ev->y) ); + set_cursor (get_position (ev->x, ev->y)); } return true; @@ -745,19 +746,19 @@ EditorSummary::on_scroll_event (GdkEventScroll* ev) switch (ev->direction) { case GDK_SCROLL_UP: { - - summary_zoom_step( -4 ); - + + summary_zoom_step (-4); + return true; } break; - + case GDK_SCROLL_DOWN: { - - summary_zoom_step( 4 ); - + + summary_zoom_step (4); + return true; } break; - + case GDK_SCROLL_LEFT: if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomHorizontalModifier)) { _editor->temporal_zoom_step (false); diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 9c1bdeda9d..278863a5cb 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -1256,7 +1256,6 @@ MixerStrip::guess_main_type(bool for_input, bool favor_connected) const /* * Output port labelling - * ===================== * * Case 1: Each output has one connection, all connections are to system:playback_%i * out 1 -> system:playback_1 @@ -1280,8 +1279,9 @@ MixerStrip::guess_main_type(bool for_input, bool favor_connected) const * Default case (unusual routing): * Display as: *number of connections* * + * * Tooltips - * ======== + * * .-----------------------------------------------. * | Mixdown | * | out 1 -> ardour:master/in 1, jamin:input/in 1 | diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 4880865c86..4fbb96e87e 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -1448,7 +1448,7 @@ Mixer_UI::redisplay_track_list () add_vca_button.show (); vca_scroller_base.show(); - + for (i = rows.begin(); i != rows.end(); ++i) { AxisView* s = (*i)[stripable_columns.strip]; diff --git a/gtk2_ardour/script_selector.cc b/gtk2_ardour/script_selector.cc index bd2ebf9844..28488a7b99 100644 --- a/gtk2_ardour/script_selector.cc +++ b/gtk2_ardour/script_selector.cc @@ -79,7 +79,7 @@ ScriptSelector::ScriptSelector (std::string title, LuaScriptInfo::ScriptType typ setup_list (); show_all (); - + script_combo_changed(); } @@ -95,20 +95,20 @@ void ScriptSelector::setup_list () { _combocon.block(); - + vector script_names; for (LuaScriptList::const_iterator s = _scripts.begin(); s != _scripts.end(); ++s) { if ((*s)->name != "Shortcut") { script_names.push_back ((*s)->name); } } - + _script_combo.clear(); _script_combo.set_row_separator_func (sigc::mem_fun (*this, &ScriptSelector::script_separator)); _script_combo.append_text ("Shortcut"); _script_combo.append_text ("separator"); - + vector::const_iterator i; for (i = script_names.begin(); i != script_names.end(); ++i) { _script_combo.append_text (*i); @@ -132,7 +132,7 @@ ScriptSelector::script_combo_changed () } if (_script) { - + if (_script->name == "Shortcut") { _type.hide(); _type_label.hide(); diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index 66de08ccb3..df8b359f72 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -241,8 +241,8 @@ Selection::clear_markers (bool with_signal) void Selection::toggle (boost::shared_ptr pl) { - clear_time(); //enforce object/range exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce object/range exclusivity + clear_tracks(); // enforce object/track exclusivity PlaylistSelection::iterator i; @@ -259,8 +259,8 @@ Selection::toggle (boost::shared_ptr pl) void Selection::toggle (const MidiNoteSelection& midi_note_list) { - clear_time(); //enforce object/range exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce object/range exclusivity + clear_tracks(); // enforce object/track exclusivity for (MidiNoteSelection::const_iterator i = midi_note_list.begin(); i != midi_note_list.end(); ++i) { toggle ((*i)); @@ -287,8 +287,8 @@ Selection::toggle (MidiCutBuffer* midi) void Selection::toggle (RegionView* r) { - clear_time(); //enforce object/range exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce object/range exclusivity + clear_tracks(); // enforce object/track exclusivity RegionSelection::iterator i; @@ -304,8 +304,8 @@ Selection::toggle (RegionView* r) void Selection::toggle (MidiRegionView* mrv) { - clear_time(); //enforce object/range exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce object/range exclusivity + clear_tracks(); // enforce object/track exclusivity MidiRegionSelection::iterator i; @@ -321,8 +321,8 @@ Selection::toggle (MidiRegionView* mrv) void Selection::toggle (vector& r) { - clear_time(); //enforce object/range exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce object/range exclusivity + clear_tracks(); // enforce object/track exclusivity RegionSelection::iterator i; @@ -340,7 +340,7 @@ Selection::toggle (vector& r) long Selection::toggle (samplepos_t start, samplepos_t end) { - clear_objects(); //enforce object/range exclusivity + clear_objects(); // enforce object/range exclusivity AudioRangeComparator cmp; @@ -360,8 +360,8 @@ Selection::add (boost::shared_ptr pl) { if (find (playlists.begin(), playlists.end(), pl) == playlists.end()) { - clear_time(); //enforce object/range exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce object/range exclusivity + clear_tracks(); // enforce object/track exclusivity pl->use (); playlists.push_back(pl); PlaylistsChanged (); @@ -382,8 +382,8 @@ Selection::add (const list >& pllist) } if (changed) { - clear_time(); //enforce object/range exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce object/range exclusivity + clear_tracks(); // enforce object/track exclusivity PlaylistsChanged (); } } @@ -395,8 +395,8 @@ Selection::add (const MidiNoteSelection& midi_list) const MidiNoteSelection::const_iterator e = midi_list.end(); if (!midi_list.empty()) { - clear_time(); //enforce object/range exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce object/range exclusivity + clear_tracks(); // enforce object/track exclusivity midi_notes.insert (midi_notes.end(), b, e); MidiNotesChanged (); } @@ -428,8 +428,8 @@ Selection::add (vector& v) } if (changed) { - clear_time(); //enforce object/range exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce object/range exclusivity + clear_tracks(); // enforce object/track exclusivity RegionsChanged (); } } @@ -449,8 +449,8 @@ Selection::add (const RegionSelection& rs) } if (changed) { - clear_time(); //enforce object/range exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce object/range exclusivity + clear_tracks(); // enforce object/track exclusivity RegionsChanged (); } } @@ -461,8 +461,8 @@ Selection::add (RegionView* r) if (find (regions.begin(), regions.end(), r) == regions.end()) { bool changed = regions.add (r); if (changed) { - clear_time(); //enforce object/range exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce object/range exclusivity + clear_tracks(); // enforce object/track exclusivity RegionsChanged (); } } @@ -473,8 +473,8 @@ Selection::add (MidiRegionView* mrv) { DEBUG_TRACE(DEBUG::Selection, string_compose("Selection::add MRV %1\n", mrv)); - clear_time(); //enforce object/range exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce object/range exclusivity + clear_tracks(); // enforce object/track exclusivity if (find (midi_regions.begin(), midi_regions.end(), mrv) == midi_regions.end()) { midi_regions.push_back (mrv); @@ -486,7 +486,7 @@ Selection::add (MidiRegionView* mrv) long Selection::add (samplepos_t start, samplepos_t end) { - clear_objects(); //enforce object/range exclusivity + clear_objects(); // enforce object/range exclusivity AudioRangeComparator cmp; @@ -519,7 +519,7 @@ Selection::move_time (samplecnt_t distance) void Selection::replace (uint32_t sid, samplepos_t start, samplepos_t end) { - clear_objects(); //enforce object/range exclusivity + clear_objects(); // enforce object/range exclusivity for (list::iterator i = time.begin(); i != time.end(); ++i) { if ((*i).id == sid) { @@ -549,8 +549,8 @@ Selection::add (boost::shared_ptr cl) } if (!cl->empty()) { - clear_time(); //enforce object/range exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce object/range exclusivity + clear_tracks(); // enforce object/track exclusivity } /* The original may change so we must store a copy (not a pointer) here. @@ -691,8 +691,8 @@ void Selection::set (const MidiNoteSelection& midi_list) { if (!midi_list.empty()) { - clear_time (); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time (); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity } clear_objects (); add (midi_list); @@ -702,8 +702,8 @@ void Selection::set (boost::shared_ptr playlist) { if (playlist) { - clear_time (); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time (); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity } clear_objects (); add (playlist); @@ -713,7 +713,7 @@ void Selection::set (const list >& pllist) { if (!pllist.empty()) { - clear_time(); //enforce region/object exclusivity + clear_time(); // enforce region/object exclusivity } clear_objects (); add (pllist); @@ -723,8 +723,8 @@ void Selection::set (const RegionSelection& rs) { if (!rs.empty()) { - clear_time(); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity } clear_objects(); regions = rs; @@ -735,8 +735,8 @@ void Selection::set (MidiRegionView* mrv) { if (mrv) { - clear_time(); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity } clear_objects (); add (mrv); @@ -746,8 +746,8 @@ void Selection::set (RegionView* r, bool /*also_clear_tracks*/) { if (r) { - clear_time(); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity } clear_objects (); add (r); @@ -757,8 +757,8 @@ void Selection::set (vector& v) { if (!v.empty()) { - clear_time(); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity } clear_objects(); @@ -772,7 +772,7 @@ Selection::set (vector& v) long Selection::set (samplepos_t start, samplepos_t end) { - clear_objects(); //enforce region/object exclusivity + clear_objects(); // enforce region/object exclusivity clear_time(); if ((start == 0 && end == 0) || end < start) { @@ -809,7 +809,7 @@ Selection::set (samplepos_t start, samplepos_t end) void Selection::set_preserving_all_ranges (samplepos_t start, samplepos_t end) { - clear_objects(); //enforce region/object exclusivity + clear_objects(); // enforce region/object exclusivity if ((start == 0 && end == 0) || (end < start)) { return; @@ -831,8 +831,8 @@ Selection::set_preserving_all_ranges (samplepos_t start, samplepos_t end) void Selection::set (boost::shared_ptr ac) { - clear_time(); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity clear_objects(); add (ac); @@ -859,7 +859,7 @@ Selection::selected (ControlPoint* cp) const bool Selection::empty (bool internal_selection) { - bool object_level_empty = regions.empty () && + bool object_level_empty = regions.empty () && tracks.empty () && points.empty () && playlists.empty () && @@ -884,8 +884,8 @@ Selection::empty (bool internal_selection) void Selection::toggle (ControlPoint* cp) { - clear_time(); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity cp->set_selected (!cp->selected ()); PointSelection::iterator i = find (points.begin(), points.end(), cp); @@ -901,8 +901,8 @@ Selection::toggle (ControlPoint* cp) void Selection::toggle (vector const & cps) { - clear_time(); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity for (vector::const_iterator i = cps.begin(); i != cps.end(); ++i) { toggle (*i); @@ -912,8 +912,8 @@ Selection::toggle (vector const & cps) void Selection::toggle (list const & selectables) { - clear_time(); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time(); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity RegionView* rv; ControlPoint* cp; @@ -945,8 +945,8 @@ Selection::toggle (list const & selectables) void Selection::set (list const & selectables) { - clear_time (); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time (); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity clear_objects (); add (selectables); @@ -955,8 +955,8 @@ Selection::set (list const & selectables) void Selection::add (PointSelection const & s) { - clear_time (); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time (); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity for (PointSelection::const_iterator i = s.begin(); i != s.end(); ++i) { points.push_back (*i); @@ -966,8 +966,8 @@ Selection::add (PointSelection const & s) void Selection::add (list const & selectables) { - clear_time (); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time (); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity RegionView* rv; ControlPoint* cp; @@ -1010,8 +1010,8 @@ Selection::clear_points (bool with_signal) void Selection::add (ControlPoint* cp) { - clear_time (); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time (); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity cp->set_selected (true); points.push_back (cp); @@ -1021,8 +1021,8 @@ Selection::add (ControlPoint* cp) void Selection::add (vector const & cps) { - clear_time (); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time (); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity for (vector::const_iterator i = cps.begin(); i != cps.end(); ++i) { (*i)->set_selected (true); @@ -1034,8 +1034,8 @@ Selection::add (vector const & cps) void Selection::set (ControlPoint* cp) { - clear_time (); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time (); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity if (cp->selected () && points.size () == 1) { return; @@ -1052,8 +1052,8 @@ Selection::set (ControlPoint* cp) void Selection::set (ArdourMarker* m) { - clear_time (); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time (); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity markers.clear (); add (m); @@ -1085,8 +1085,8 @@ Selection::remove (ArdourMarker* m) void Selection::add (ArdourMarker* m) { - clear_time (); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time (); //enforce region/object exclusivity + clear_tracks(); //enforce object/track exclusivity if (find (markers.begin(), markers.end(), m) == markers.end()) { markers.push_back (m); @@ -1097,8 +1097,8 @@ Selection::add (ArdourMarker* m) void Selection::add (const list& m) { - clear_time (); //enforce region/object exclusivity - clear_tracks(); //enforce object/track exclusivity + clear_time (); // enforce region/object exclusivity + clear_tracks(); // enforce object/track exclusivity markers.insert (markers.end(), m.begin(), m.end()); markers.sort (); @@ -1298,7 +1298,7 @@ Selection::set_state (XMLNode const & node, int) pending_midi_note_selection.push_back (make_pair (id, notes)); } - } else if ((*i)->name() == X_("ControlPoint")) { + } else if ((*i)->name() == X_("ControlPoint")) { XMLProperty const * prop_type = (*i)->property (X_("type")); assert(prop_type); @@ -1369,7 +1369,7 @@ Selection::set_state (XMLNode const & node, int) } } - } else if ((*i)->name() == X_("AudioRange")) { + } else if ((*i)->name() == X_("AudioRange")) { samplepos_t start; samplepos_t end; @@ -1671,7 +1671,7 @@ Selection::core_selection_changed (PropertyChange const & what_changed) CoreSelection& selection (editor->session()->selection()); if (selection.selected()) { - clear_objects(); // enforce object/range exclusivity + clear_objects(); // enforce object/range exclusivity } tracks.clear (); // clear stage for whatever tracks are now selected (maybe none) @@ -1693,6 +1693,6 @@ Selection::core_selection_changed (PropertyChange const & what_changed) tracks.push_back (tav); } } - + TracksChanged(); }