changeset 28:b5f55ea61bb8

* stepsize/blocksize from plugin dialog actually working, though with some puzzlement
author Chris Cannam
date Wed, 20 Sep 2006 14:50:40 +0000
parents 61259228d029
children 660a973c157a
files transform/PluginTransform.cpp transform/TransformFactory.cpp
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/transform/PluginTransform.cpp	Tue Sep 19 14:37:06 2006 +0000
+++ b/transform/PluginTransform.cpp	Wed Sep 20 14:50:40 2006 +0000
@@ -15,6 +15,8 @@
 
 #include "PluginTransform.h"
 
+#include "vamp-sdk/PluginHostAdapter.h"
+
 PluginTransform::PluginTransform(Model *inputModel,
 				 const ExecutionContext &context) :
     Transform(inputModel),
@@ -66,6 +68,9 @@
 PluginTransform::ExecutionContext::makeConsistentWithPlugin(const Vamp::PluginBase *_plugin)
 {
     const Vamp::Plugin *vp = dynamic_cast<const Vamp::Plugin *>(_plugin);
+    if (!vp) {
+        vp = dynamic_cast<const Vamp::PluginHostAdapter *>(_plugin); //!!! why?
+    }
 
     if (!vp) {
         domain = Vamp::Plugin::TimeDomain;
--- a/transform/TransformFactory.cpp	Tue Sep 19 14:37:06 2006 +0000
+++ b/transform/TransformFactory.cpp	Wed Sep 20 14:50:40 2006 +0000
@@ -26,6 +26,8 @@
 
 #include "data/model/DenseTimeValueModel.h"
 
+#include "vamp-sdk/PluginHostAdapter.h"
+
 #include <iostream>
 #include <set>
 
@@ -338,7 +340,8 @@
                                   int &minChannels, int &maxChannels)
 {
     Vamp::Plugin *vp = 0;
-    if ((vp = dynamic_cast<Vamp::Plugin *>(plugin))) {
+    if ((vp = dynamic_cast<Vamp::Plugin *>(plugin)) ||
+        (vp = dynamic_cast<Vamp::PluginHostAdapter *>(plugin))) {
         minChannels = vp->getMinChannelCount();
         maxChannels = vp->getMaxChannelCount();
         return true;