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

This commit is contained in:
Ben Loftis 2014-07-08 14:16:13 -05:00
parent 39ea166620
commit c1166c9f63
3 changed files with 13 additions and 6 deletions

View File

@ -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 */

View File

@ -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 ();

View File

@ -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();