diff vamp-sdk/PluginHostAdapter.cpp @ 167:31eda4b11f2b

* First bit of Vamp v2 work -- add an optional duration to features in a backward compatible way. Warning: this code is unstable and experimental and may change significantly in the coming weeks.
author cannam
date Thu, 17 Jul 2008 08:52:26 +0000
parents 44e6b94c2696
children 006a775133b1
line wrap: on
line diff
--- a/vamp-sdk/PluginHostAdapter.cpp	Wed Jul 09 11:00:16 2008 +0000
+++ b/vamp-sdk/PluginHostAdapter.cpp	Thu Jul 17 08:52:26 2008 +0000
@@ -404,6 +404,14 @@
                 feature.timestamp = RealTime(list.features[j].sec,
                                              list.features[j].nsec);
 
+                if (m_descriptor->vampApiVersion >= 2) {
+                    feature.hasDuration = list.featuresV2[j].hasDuration;
+                    feature.duration = RealTime(list.featuresV2[j].durationSec,
+                                                list.featuresV2[j].durationNsec);
+                } else {
+                    feature.hasDuration = false;
+                }
+
                 for (unsigned int k = 0; k < list.features[j].valueCount; ++k) {
                     feature.values.push_back(list.features[j].values[k]);
                 }