Fix #6280 – region (first_frame()==0) selectable with SnapRegionBoundary
Issue #6280 states that when selecting ranges using SnapToRegionBoundary it's not possible to select regions with first_frame() == 0. This is because Playlist::find_next_region() does not consider region boundaries == pos but only > pos. Thus it never considers pos == 0 to be a region boundary. This solution tries to be as little invasive as possible without changing the semantics of PlayList::find_next_region(). Therefore position 0 is added to the region boundary cache if there's a region starting at position 0 in any track.
This commit is contained in:
parent
681ab52330
commit
9bfe404b4e
@ -721,9 +721,12 @@ Editor::build_region_boundary_cache ()
|
||||
return;
|
||||
}
|
||||
|
||||
bool maybe_first_frame = false;
|
||||
|
||||
switch (_snap_type) {
|
||||
case SnapToRegionStart:
|
||||
interesting_points.push_back (Start);
|
||||
maybe_first_frame = true;
|
||||
break;
|
||||
case SnapToRegionEnd:
|
||||
interesting_points.push_back (End);
|
||||
@ -734,6 +737,7 @@ Editor::build_region_boundary_cache ()
|
||||
case SnapToRegionBoundary:
|
||||
interesting_points.push_back (Start);
|
||||
interesting_points.push_back (End);
|
||||
maybe_first_frame = true;
|
||||
break;
|
||||
default:
|
||||
fatal << string_compose (_("build_region_boundary_cache called with snap_type = %1"), _snap_type) << endmsg;
|
||||
@ -750,6 +754,17 @@ Editor::build_region_boundary_cache ()
|
||||
tlist = track_views.filter_to_unique_playlists ();
|
||||
}
|
||||
|
||||
if (maybe_first_frame) {
|
||||
TrackViewList::const_iterator i;
|
||||
for (i = tlist.begin(); i != tlist.end(); ++i) {
|
||||
boost::shared_ptr<Playlist> pl = (*i)->playlist();
|
||||
if (pl && pl->count_regions_at (0)) {
|
||||
region_boundary_cache.push_back (0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (pos < _session->current_end_frame() && !at_end) {
|
||||
|
||||
framepos_t rpos;
|
||||
|
Loading…
Reference in New Issue
Block a user