changeset 78:49563d091790

Fix retrieval of output computes-type
author Chris Cannam
date Mon, 04 Mar 2013 17:20:31 +0000
parents 6e11a36c335a
children e47d5adb6564
files vamp.yeti
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/vamp.yeti	Mon Mar 04 12:28:19 2013 +0000
+++ b/vamp.yeti	Mon Mar 04 17:20:31 2013 +0000
@@ -128,7 +128,7 @@
         Unknown ();
     fi;
 
-outputDescriptor rdfData od is 'a -> ~OutputDescriptor -> 'b = {
+outputDescriptor rdfOutputData od is 'a -> ~OutputDescriptor -> 'b = {
     identifier = od#identifier,
     name = od#name,
     description = od#description,
@@ -140,7 +140,7 @@
     sampleType = sampleType od#sampleType,
     sampleRate = od#sampleRate,
     hasDuration = od#hasDuration,
-    computes = case rdfData of Some data: data.computes; None (): Unknown () esac,
+    get computes () = case rdfOutputData of Some data: data.computes; None (): Unknown () esac,
     get inferredStructure () = structureOf od,
     };
 
@@ -171,7 +171,11 @@
     get maxChannelCount () = p#getMaxChannelCount(),
     initialise { channels, blocksize, hop } = p#initialise(channels, hop, blocksize),
     reset () = p#reset(),
-    get outputs () = array (map (outputDescriptor rdfData) p#getOutputDescriptors()),
+    get outputs () =
+        array case rdfData of
+        Some data: map2 outputDescriptor (map Some data.outputs) p#getOutputDescriptors();
+        None (): map (outputDescriptor (None ())) p#getOutputDescriptors();
+        esac,
     process blocks time is 'a -> ~RealTime -> 'b = 
         featureSet p#process((map block.floats blocks) as ~float[][], 0, time),
     getRemainingFeatures () = featureSet p#getRemainingFeatures(),