diff transform/TransformFactory.cpp @ 1039:b14064bd1f97 cxx11

This code now compiles. Main problem: sample rate types
author Chris Cannam
date Tue, 03 Mar 2015 17:09:19 +0000
parents 45e95de8b11d
children 26cf6d5251ec
line wrap: on
line diff
--- a/transform/TransformFactory.cpp	Tue Mar 03 15:18:24 2015 +0000
+++ b/transform/TransformFactory.cpp	Tue Mar 03 17:09:19 2015 +0000
@@ -754,7 +754,7 @@
 {
     Transform t;
     t.setIdentifier(id);
-    if (rate != 0) t.setSampleRate(rate);
+    if (rate != 0) t.setSampleRate(float(rate));
 
     Vamp::PluginBase *plugin = instantiateDefaultPluginFor(id, rate);
 
@@ -772,7 +772,7 @@
 TransformFactory::instantiatePluginFor(const Transform &transform)
 {
     Vamp::PluginBase *plugin = instantiateDefaultPluginFor
-        (transform.getIdentifier(), transform.getSampleRate());
+        (transform.getIdentifier(), int(lrintf(transform.getSampleRate())));
 
     if (plugin) {
         setPluginParameters(transform, plugin);
@@ -797,7 +797,7 @@
             FeatureExtractionPluginFactory::instanceFor(pluginId);
 
         if (factory) {
-            plugin = factory->instantiatePlugin(pluginId, rate);
+            plugin = factory->instantiatePlugin(pluginId, float(rate));
         }
 
     } else {
@@ -913,8 +913,8 @@
             instantiatePlugin(id, 44100);
         if (!plugin) return false;
 
-        min = plugin->getMinChannelCount();
-        max = plugin->getMaxChannelCount();
+        min = (int)plugin->getMinChannelCount();
+        max = (int)plugin->getMaxChannelCount();
         delete plugin;
 
         return true;
@@ -1040,10 +1040,10 @@
     } else {
         Vamp::Plugin::InputDomain domain = vp->getInputDomain();
         if (!transform.getStepSize()) {
-            transform.setStepSize(vp->getPreferredStepSize());
+            transform.setStepSize((int)vp->getPreferredStepSize());
         }
         if (!transform.getBlockSize()) {
-            transform.setBlockSize(vp->getPreferredBlockSize());
+            transform.setBlockSize((int)vp->getPreferredBlockSize());
         }
         if (!transform.getBlockSize()) {
             transform.setBlockSize(1024);