diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2014-07-08 14:16:13 -0500 |
---|---|---|
committer | Ben Loftis <ben@harrisonconsoles.com> | 2014-07-08 15:00:19 -0500 |
commit | c1166c9f6333a6ee1eff7b04718eaddd61613847 (patch) | |
tree | 67a397e42438dd4e900d957653058f90394c0c20 /gtk2_ardour | |
parent | 39ea16662063e68e55666ef1ba231e2c94a95ee8 (diff) |
fix thinko with split selections. also ignore follow_edits when we are splitting, because the playlist freeze and the newly added regions cause the playhead to jump to unexpected locations
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 15 |
3 files changed, 13 insertions, 6 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index c6bc038846..fed72be1cd 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -744,6 +744,8 @@ Editor::Editor () _last_region_menu_was_main = false; _popup_region_menu_item = 0; + _ignore_follow_edits = false; + _show_marker_lines = false; /* Button bindings */ diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 44092069f0..5174f81bb0 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1702,6 +1702,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void point_selection_changed (); void marker_selection_changed (); + bool _ignore_follow_edits; + void cancel_selection (); void cancel_time_selection (); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 97d3780c96..a2f8048fec 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -134,7 +134,8 @@ Editor::split_regions_at (framepos_t where, RegionSelection& regions) bool frozen = false; RegionSelection pre_selected_regions = selection->regions; - + bool working_on_selection = !pre_selected_regions.empty(); + list<boost::shared_ptr<Playlist> > used_playlists; list<RouteTimeAxisView*> used_trackviews; @@ -234,11 +235,13 @@ Editor::split_regions_at (framepos_t where, RegionSelection& regions) EditorThaw(); /* Emit Signal */ } - //IFF we were working on selected regions, then we should select both sides of the new region after the split. - if( !pre_selected_regions.empty() ) { - selection->add (latest_regionviews); //these are the new regions, created after the split - selection->add (pre_selected_regions); //these were the old selected regions, they got lost in the freeze/thaw + //IFF we were working on selected regions, try to reinstate the other region selections that existed before the freeze/thaw. + _ignore_follow_edits = true; //a split will change the region selection in mysterious ways; its not practical or wanted to follow this edit + if( working_on_selection ) { + selection->add ( pre_selected_regions ); + selection->add (latest_regionviews); //these are the new regions created after the split } + _ignore_follow_edits = false; } @@ -2271,7 +2274,7 @@ Editor::get_preroll () void Editor::maybe_locate_with_edit_preroll ( framepos_t location ) { - if ( _session->transport_rolling() || !Config->get_follow_edits() ) + if ( _session->transport_rolling() || !Config->get_follow_edits() || _ignore_follow_edits ) return; location -= get_preroll(); |