summaryrefslogtreecommitdiff
path: root/libs/ardour/playlist.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-10-15 18:44:17 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-10-15 18:44:22 -0400
commit5d533353004e69c6daf44a53b4c10e374e06cf21 (patch)
tree4c778be49abc83386c52a3ff1de3f16b8bd11010 /libs/ardour/playlist.cc
parentab658d7ca15ed24e073d85f43376c986c659b1cf (diff)
when flushing notifications/signals from an ARDOUR::Playlist, emit the RegionAdded/ContentsChanged signals first so that when LayersChanged is sent, the receivers know about all the new regions
Diffstat (limited to 'libs/ardour/playlist.cc')
-rw-r--r--libs/ardour/playlist.cc59
1 files changed, 32 insertions, 27 deletions
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc
index 895741c8da..ff2f524398 100644
--- a/libs/ardour/playlist.cc
+++ b/libs/ardour/playlist.cc
@@ -557,6 +557,7 @@ Playlist::notify_region_added (boost::shared_ptr<Region> r)
pending_contents_change = false;
RegionAdded (boost::weak_ptr<Region> (r)); /* EMIT SIGNAL */
ContentsChanged (); /* EMIT SIGNAL */
+
}
}
@@ -611,37 +612,41 @@ Playlist::flush_notifications (bool from_undo)
*/
}
- if (((regions_changed || pending_contents_change) && !in_set_state) || pending_layering) {
+ /* notify about contents/region changes first so that layering changes
+ * in a UI will take place on the new contents.
+ */
+
+ if (regions_changed || pending_contents_change) {
+ pending_layering = true;
+ ContentsChanged (); /* EMIT SIGNAL */
+ }
+
+ for (s = pending_adds.begin(); s != pending_adds.end(); ++s) {
+ (*s)->clear_changes ();
+ RegionAdded (boost::weak_ptr<Region> (*s)); /* EMIT SIGNAL */
+ }
+
+ if ((regions_changed && !in_set_state) || pending_layering) {
relayer ();
}
+
+ coalesce_and_check_crossfades (crossfade_ranges);
+
+ if (!pending_range_moves.empty ()) {
+ /* We don't need to check crossfades for these as pending_bounds has
+ already covered it.
+ */
+ RangesMoved (pending_range_moves, from_undo);
+ }
+
+ if (!pending_region_extensions.empty ()) {
+ RegionsExtended (pending_region_extensions);
+ }
- if (regions_changed || pending_contents_change) {
- pending_contents_change = false;
- ContentsChanged (); /* EMIT SIGNAL */
- }
-
- for (s = pending_adds.begin(); s != pending_adds.end(); ++s) {
- (*s)->clear_changes ();
- RegionAdded (boost::weak_ptr<Region> (*s)); /* EMIT SIGNAL */
- }
-
- coalesce_and_check_crossfades (crossfade_ranges);
-
- if (!pending_range_moves.empty ()) {
- /* We don't need to check crossfades for these as pending_bounds has
- already covered it.
- */
- RangesMoved (pending_range_moves, from_undo);
- }
-
- if (!pending_region_extensions.empty ()) {
- RegionsExtended (pending_region_extensions);
- }
-
- clear_pending ();
+ clear_pending ();
- in_flush = false;
- }
+ in_flush = false;
+}
void
Playlist::clear_pending ()