summaryrefslogtreecommitdiff
path: root/libs/ardour/audiosource.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-04-22 01:40:33 +0000
committerCarl Hetherington <carl@carlh.net>2010-04-22 01:40:33 +0000
commit9213e9c9094468ce21be378ea017b0da1405bf03 (patch)
tree99424cd6f17fa93a354deae97db76af98b6f06e7 /libs/ardour/audiosource.cc
parent5b4b2c04e522f8c71b23359519c19160c886c8b9 (diff)
Allow more than one peaks_ready callback to be pending for an AudioRegionView
at any one time. Prevents problems when there is more than 1 channel for which peaks are not ready; before, the first peaks_ready callback would be forgotten when the second one was requested. Should fix #3074. git-svn-id: svn://localhost/ardour2/branches/3.0@6951 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audiosource.cc')
-rw-r--r--libs/ardour/audiosource.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc
index 60bd5804b3..d8dd58844f 100644
--- a/libs/ardour/audiosource.cc
+++ b/libs/ardour/audiosource.cc
@@ -148,8 +148,17 @@ AudioSource::update_length (sframes_t pos, sframes_t cnt)
PEAK FILE STUFF
***********************************************************************/
+/** Checks to see if peaks are ready. If so, we return true. If not, we return false, and
+ * things are set up so that doThisWhenReady is called when the peaks are ready.
+ * A new PBD::ScopedConnection is created for the associated connection and written to
+ * *connect_here_if_not.
+ *
+ * @param doThisWhenReady Function to call when peaks are ready (if they are not already).
+ * @param connect_here_if_not Address to write new ScopedConnection to.
+ * @param event_loop Event loop for doThisWhenReady to be called in.
+ */
bool
-AudioSource::peaks_ready (boost::function<void()> doThisWhenReady, ScopedConnection& connect_here_if_not, EventLoop* event_loop) const
+AudioSource::peaks_ready (boost::function<void()> doThisWhenReady, ScopedConnection** connect_here_if_not, EventLoop* event_loop) const
{
bool ret;
Glib::Mutex::Lock lm (_peaks_ready_lock);
@@ -159,7 +168,8 @@ AudioSource::peaks_ready (boost::function<void()> doThisWhenReady, ScopedConnect
*/
if (!(ret = _peaks_built)) {
- PeaksReady.connect (connect_here_if_not, MISSING_INVALIDATOR, doThisWhenReady, event_loop);
+ *connect_here_if_not = new ScopedConnection;
+ PeaksReady.connect (**connect_here_if_not, MISSING_INVALIDATOR, doThisWhenReady, event_loop);
}
return ret;