From 4d269729b134445f9a37c778f2796dff7a8aa9b4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 14 May 2021 00:27:13 +0200 Subject: [PATCH] Fix missing entries in region-list #8701 RegionFactory::CheckNewRegion signal is emitted directly after region-creation from RegionFactory::create(). At this point in time the region is not on any playlist. This if fine for EditorSources, but the new RegionList design only shows regions that are on the timeline. CheckNewRegion() -> EditorRegions::add_region() -> EditorRegions::regions_changed() ignores regions w/o playlist. Later Playlist::add_region_internal() sets the playlist but calls Region::clear_changes() to not send all individual changes. So Region::RegionsPropertyChanged is not emitted either. We need to notify the EditorRegions *after* setting the playlist. The downside of this is that more signals than necessary are emitted. --- libs/ardour/playlist.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index d0f19580a9..5c2193ca0c 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -587,6 +587,7 @@ Playlist::notify_region_added (boost::shared_ptr r) pending_contents_change = false; RegionAdded (boost::weak_ptr (r)); /* EMIT SIGNAL */ ContentsChanged (); /* EMIT SIGNAL */ + RegionFactory::CheckNewRegion (r); /* EMIT SIGNAL */ } } @@ -655,6 +656,7 @@ Playlist::flush_notifications (bool from_undo) for (s = pending_adds.begin (); s != pending_adds.end (); ++s) { (*s)->clear_changes (); RegionAdded (boost::weak_ptr (*s)); /* EMIT SIGNAL */ + RegionFactory::CheckNewRegion (*s); /* EMIT SIGNAL */ } if ((regions_changed && !in_set_state) || pending_layering) {