changeset 650:ed9cb577eb7c single-point

Use matching-event search in tone generator
author Chris Cannam
date Wed, 20 Mar 2019 11:19:44 +0000
parents 284cb118368e
children b63dfd7e2780
files audio/AudioGenerator.cpp framework/Align.cpp
diffstat 2 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/audio/AudioGenerator.cpp	Tue Mar 19 13:06:58 2019 +0000
+++ b/audio/AudioGenerator.cpp	Wed Mar 20 11:19:44 2019 +0000
@@ -727,16 +727,17 @@
         // away than twice the model resolution, go silent (same
         // criterion TimeValueLayer uses for ending a discrete curve
         // segment)
-        /*!!! todo: restore
         if (f0 == 0.f) {
-            EventVector nextPoints = 
-                stvm->getNextPoints(reqStart + m_processingBlockSize);
-            if (nextPoints.empty() ||
-                nextPoints.begin()->frame > reqStart + 2 * stvm->getResolution()) {
+            Event nextP;
+            if (!stvm->getNearestEventMatching(reqStart + m_processingBlockSize,
+                                               [](Event) { return true; },
+                                               EventSeries::Forward,
+                                               nextP) ||
+                nextP.getFrame() > reqStart + 2 * stvm->getResolution()) {
                 f0 = -1.f;
             }
         }
-        */
+
 //        cerr << "f0 = " << f0 << endl;
 
         synth->mix(bufferIndexes,
--- a/framework/Align.cpp	Tue Mar 19 13:06:58 2019 +0000
+++ b/framework/Align.cpp	Wed Mar 20 11:19:44 2019 +0000
@@ -288,10 +288,10 @@
             m_error = QString("Output of alignment program contained no mappings");
             goto done;
         }
-/*
+
         SVCERR << "Align::alignmentProgramFinished: Setting alignment path ("
-             << path->getAllEvents().size() << " point(s))" << endl;
-*/      
+             << path->getEventCount() << " point(s))" << endl;
+
         alignmentModel->setPathFrom(path);
 
         emit alignmentComplete(alignmentModel);