changeset 453:22b29720da41 vampipe

Add test using new curve-fsr-mixed output from the Vamp Test Plugin, and make corresponding fix to timestamp logic
author Chris Cannam
date Wed, 14 Sep 2016 17:35:41 +0100
parents cd8414edfd32
children d6262c77e5a5 30234a7aaae3 3949cc56f2ce
files .hgignore host/vamp-simple-host.cpp test/expected/vamp-test-plugin-freq_curve-fsr-mixed.txt test/expected/vamp-test-plugin_curve-fsr-mixed.txt
diffstat 4 files changed, 27 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Wed Sep 14 17:33:56 2016 +0100
+++ b/.hgignore	Wed Sep 14 17:35:41 2016 +0100
@@ -27,3 +27,5 @@
 *.opensdf
 re:^build/x64/Debug/
 re:^build/x64/Release/
+test/obtained
+test/failures
--- a/host/vamp-simple-host.cpp	Wed Sep 14 17:33:56 2016 +0100
+++ b/host/vamp-simple-host.cpp	Wed Sep 14 17:35:41 2016 +0100
@@ -508,7 +508,7 @@
               const Plugin::OutputDescriptor &output, int outputNo,
               const Plugin::FeatureSet &features, ofstream *out, bool useFrames)
 {
-    static int featureCount = 0;
+    static int featureCount = -1;
     
     if (features.find(outputNo) == features.end()) return;
     
@@ -523,12 +523,13 @@
             rt = f.timestamp;
             haveRt = true;
         } else if (output.sampleType == Plugin::OutputDescriptor::FixedSampleRate) {
-            int n = featureCount;
+            int n = featureCount + 1;
             if (f.hasTimestamp) {
                 n = int(round(toSeconds(f.timestamp) * output.sampleRate));
             }
             rt = RealTime::fromSeconds(double(n) / output.sampleRate);
             haveRt = true;
+            featureCount = n;
         }
         
         if (useFrames) {
@@ -570,8 +571,6 @@
         (out ? *out : cout) << " " << f.label;
 
         (out ? *out : cout) << endl;
-
-        ++featureCount;
     }
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/expected/vamp-test-plugin-freq_curve-fsr-mixed.txt	Wed Sep 14 17:35:41 2016 +0100
@@ -0,0 +1,11 @@
+=== vamp-test-plugin:vamp-test-plugin-freq:curve-fsr-mixed
+ 2.400000000: 0 1 of 10: 0 at 2.4 snap to 2.4
+ 2.800000000: 0.1 2 of 10: 0.1 at 2.9 snap to 2.8
+ 3.200000000: 0.2 3 of 10: 0.2 at 3.14 snap to 3.2
+ 3.600000000: 0.3 4 of 10: 0.3 at 3.5 snap to 3.6
+ 4.000000000: 0.4 5 of 10: 0.4 at 4
+ 4.400000000: 0.5 6 of 10: 0.5 at 4.4
+ 4.000000000: 0.6 7 of 10: 0.6 at 3.9 snap to 4
+ 4.400000000: 0.7 8 of 10: 0.7 at 4.4 snap to 4.4
+ 4.800000000: 0.8 9 of 10: 0.8 at 4.8
+ 5.200000000: 0.9 10 of 10: 0.9 at 5 snap to 5.2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/expected/vamp-test-plugin_curve-fsr-mixed.txt	Wed Sep 14 17:35:41 2016 +0100
@@ -0,0 +1,11 @@
+=== vamp-test-plugin:vamp-test-plugin:curve-fsr-mixed
+ 2.400000000: 0 1 of 10: 0 at 2.4 snap to 2.4
+ 2.800000000: 0.1 2 of 10: 0.1 at 2.9 snap to 2.8
+ 3.200000000: 0.2 3 of 10: 0.2 at 3.14 snap to 3.2
+ 3.600000000: 0.3 4 of 10: 0.3 at 3.5 snap to 3.6
+ 4.000000000: 0.4 5 of 10: 0.4 at 4
+ 4.400000000: 0.5 6 of 10: 0.5 at 4.4
+ 4.000000000: 0.6 7 of 10: 0.6 at 3.9 snap to 4
+ 4.400000000: 0.7 8 of 10: 0.7 at 4.4 snap to 4.4
+ 4.800000000: 0.8 9 of 10: 0.8 at 4.8
+ 5.200000000: 0.9 10 of 10: 0.9 at 5 snap to 5.2