changeset 61:bf25c6d663d2

Pass through params to converted as well (will need them for timestamps)
author Chris Cannam
date Thu, 10 Jan 2013 17:55:48 +0000
parents 7e48a92b6bbd
children 11933d198ad0
files vamp.yeti
diffstat 1 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/vamp.yeti	Thu Jan 10 17:14:46 2013 +0000
+++ b/vamp.yeti	Thu Jan 10 17:55:48 2013 +0000
@@ -133,9 +133,6 @@
 
 featuresFromSet outputNo f = if outputNo in f then f[outputNo] else [] fi;
 
-converted outputNo fl =
-    map (featuresFromSet outputNo) fl;
-
 outputNumberByName p name =
    (outputs = p.outputs;
     index (head (find ((== name) . (.identifier)) outputs)) outputs);
@@ -155,17 +152,21 @@
             [rf]);
     esac;
 
+converted { p, sampleRate, hop } outputNo fl =
+    map (featuresFromSet outputNo) fl;
+
 process key output stream =
    (p = loadPlugin stream.sampleRate key;
     blockSize = p.preferredBlockSize;
     hop = p.preferredStepSize;
     outputNo = outputNumberByName p output;
-    if p.initialise { channels = 1, blocksize = blockSize, hop } then
-        converted outputNo
-           (processed
-            { p, sampleRate = stream.sampleRate, hop } 
-            (fr.frames { framesize = blockSize, hop } stream)
-            0);
+    params = {
+        p,
+        sampleRate = stream.sampleRate, channels = 1,
+        framesize = blockSize, blocksize = blockSize, hop
+    };
+    if p.initialise params then
+        converted params outputNo(processed params (fr.frames params stream) 0);
         // If processing completed successfully, then p is disposed by
         // processed and stream is closed by the framer
     else