X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor_ops.cc;h=50ead21c33b0c3107493520d6330157aa08a0d9c;hb=79731a716deae9a90be646695480f06f92c268f5;hp=3e757297a93eefa1929905deec8b67dfa60de00e;hpb=0883f02de92478800ad232f10d388219e2817ed7;p=ardour.git diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 3e757297a9..50ead21c33 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -58,10 +58,12 @@ #include "ardour/legatize.h" #include "ardour/region_factory.h" #include "ardour/reverse.h" +#include "ardour/selection.h" #include "ardour/session.h" #include "ardour/session_playlists.h" #include "ardour/strip_silence.h" #include "ardour/transient_detector.h" +#include "ardour/transport_master_manager.h" #include "ardour/transpose.h" #include "ardour/vca_manager.h" @@ -730,6 +732,7 @@ Editor::build_region_boundary_cache () /* if no snap selections are set, boundary cache should be left empty */ if ( interesting_points.empty() ) { + _region_boundary_cache_dirty = false; return; } @@ -753,7 +756,7 @@ Editor::build_region_boundary_cache () if (ARDOUR_UI::instance()->video_timeline) { region_boundary_cache.push_back (ARDOUR_UI::instance()->video_timeline->get_video_start_offset()); } - + std::pair ext = session_gui_extents (false); samplepos_t session_end = ext.second; @@ -2593,7 +2596,7 @@ Editor::transition_to_rolling (bool fwd) } if (_session->config.get_external_sync()) { - switch (Config->get_sync_source()) { + switch (TransportMasterManager::instance().current()->type()) { case Engine: break; default: @@ -6422,79 +6425,13 @@ Editor::split_region () void Editor::select_next_stripable (bool routes_only) { - if (selection->tracks.empty()) { - selection->set (track_views.front()); - return; - } - - TimeAxisView* current = selection->tracks.front(); - - bool valid; - do { - for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { - - if (*i == current) { - ++i; - if (i != track_views.end()) { - current = (*i); - } else { - current = (*(track_views.begin())); - //selection->set (*(track_views.begin())); - } - break; - } - } - - if (routes_only) { - RouteUI* rui = dynamic_cast(current); - valid = rui && rui->route()->active(); - } else { - valid = 0 != current->stripable ().get(); - } - - } while (current->hidden() || !valid); - - selection->set (current); - - ensure_time_axis_view_is_visible (*current, false); + _session->selection().select_next_stripable (false, routes_only); } void Editor::select_prev_stripable (bool routes_only) { - if (selection->tracks.empty()) { - selection->set (track_views.front()); - return; - } - - TimeAxisView* current = selection->tracks.front(); - - bool valid; - do { - for (TrackViewList::reverse_iterator i = track_views.rbegin(); i != track_views.rend(); ++i) { - - if (*i == current) { - ++i; - if (i != track_views.rend()) { - current = (*i); - } else { - current = *(track_views.rbegin()); - } - break; - } - } - if (routes_only) { - RouteUI* rui = dynamic_cast(current); - valid = rui && rui->route()->active(); - } else { - valid = 0 != current->stripable ().get(); - } - - } while (current->hidden() || !valid); - - selection->set (current); - - ensure_time_axis_view_is_visible (*current, false); + _session->selection().select_prev_stripable (false, routes_only); } void @@ -7366,15 +7303,15 @@ Editor::playhead_forward_to_grid () _session->request_locate (0); } } else { - + if (pos.sample < max_samplepos - 1) { pos.sample += 2; - snap_to_internal (pos, RoundUpAlways, SnapToGrid_Scaled, true); + pos = snap_to_grid (pos, RoundUpAlways, SnapToGrid_Scaled); _session->request_locate (pos.sample); } } - + /* keep PH visible in window */ if (pos.sample > (_leftmost_sample + current_page_samples() *0.9)) { reset_x_origin (pos.sample - (current_page_samples()*0.9)); @@ -7399,23 +7336,23 @@ Editor::playhead_backward_to_grid () _session->request_locate (0); } } else { - + if (pos.sample > 2) { pos.sample -= 2; - snap_to_internal (pos, RoundDownAlways, SnapToGrid_Scaled, true); + pos = snap_to_grid (pos, RoundDownAlways, SnapToGrid_Scaled); } //handle the case where we are rolling, and we're less than one-half second past the mark, we want to go to the prior mark... //also see: jump_backward_to_mark if (_session->transport_rolling()) { if ((playhead_cursor->current_sample() - pos.sample) < _session->sample_rate()/2) { - snap_to_internal (pos, RoundDownAlways, SnapToGrid_Scaled, true); + pos = snap_to_grid (pos, RoundDownAlways, SnapToGrid_Scaled); } } _session->request_locate (pos.sample, _session->transport_rolling()); } - + /* keep PH visible in window */ if (pos.sample < (_leftmost_sample + current_page_samples() *0.1)) { reset_x_origin (pos.sample - (current_page_samples()*0.1));