From 815abed5c5ac3770f5df4bbae733035fee9595f4 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 31 May 2021 13:20:44 -0600 Subject: [PATCH] alter API for playlist ripple callback, to provide required information --- libs/ardour/ardour/playlist.h | 2 +- libs/ardour/playlist.cc | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index 5386428990..45f2c5917a 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -191,7 +191,7 @@ public: void shuffle (boost::shared_ptr, int dir); - typedef boost::function RippleCallback; + typedef boost::function RippleCallback; void ripple (samplepos_t at, samplecnt_t distance, RegionList* exclude, RippleCallback ripple_callback); void ripple (samplepos_t at, samplecnt_t distance, boost::shared_ptr exclude, RippleCallback ripple_callback) diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 33479591de..6c6e89a3dd 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -878,7 +878,7 @@ Playlist::remove_gaps (samplepos_t gap_threshold, samplepos_t leave_gap, boost:: RegionList::iterator i; RegionList::iterator nxt (regions.end()); bool closed = false; - boost::function null_ripple_callback; + RippleCallback null_ripple_callback; if (regions.size() < 2) { return; @@ -1653,6 +1653,12 @@ Playlist::splice_unlocked (samplepos_t at, samplecnt_t distance, boost::shared_p notify_contents_changed (); } +void +Playlist::ripple (samplepos_t at, samplecnt_t distance, RegionList* exclude, RippleCallback ripple_callback) +{ + ripple_locked (at, distance, exclude, ripple_callback); +} + void Playlist::ripple_locked (samplepos_t at, samplecnt_t distance, RegionList* exclude, RippleCallback ripple_callback) { @@ -1694,7 +1700,7 @@ Playlist::ripple_unlocked (samplepos_t at, samplecnt_t distance, RegionList* exc _rippling = false; - ripple_callback (*this); + ripple_callback (*this, at, distance); if (notify) { notify_contents_changed (); @@ -3024,12 +3030,6 @@ Playlist::region_is_shuffle_constrained (boost::shared_ptr) return false; } -void -Playlist::ripple (samplepos_t at, samplecnt_t distance, RegionList* exclude, RippleCallback ripple_callback) -{ - ripple_locked (at, distance, exclude, ripple_callback); -} - void Playlist::update_after_tempo_map_change () {