mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-17 10:55:57 +01:00
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:
parent
a3bd4de11d
commit
31ffc2aa85
3 changed files with 13 additions and 6 deletions
|
|
@ -752,6 +752,8 @@ Editor::Editor ()
|
|||
_last_region_menu_was_main = false;
|
||||
_popup_region_menu_item = 0;
|
||||
|
||||
_ignore_follow_edits = false;
|
||||
|
||||
_show_marker_lines = false;
|
||||
|
||||
/* Button bindings */
|
||||
|
|
|
|||
|
|
@ -1730,6 +1730,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 ();
|
||||
|
||||
|
|
|
|||
|
|
@ -135,7 +135,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;
|
||||
|
||||
|
|
@ -235,11 +236,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;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -2295,7 +2298,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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue