comparison vampyhost.cpp @ 29:7e7f2f7d9542

PyTypeConversions -> VectorConversion
author Chris Cannam
date Wed, 26 Nov 2014 10:56:23 +0000
parents 1175e814954e
children f565f4b5cbaa
comparison
equal deleted inserted replaced
28:1175e814954e 29:7e7f2f7d9542
54 #include "vamp-hostsdk/PluginHostAdapter.h" 54 #include "vamp-hostsdk/PluginHostAdapter.h"
55 #include "vamp-hostsdk/PluginChannelAdapter.h" 55 #include "vamp-hostsdk/PluginChannelAdapter.h"
56 #include "vamp-hostsdk/PluginInputDomainAdapter.h" 56 #include "vamp-hostsdk/PluginInputDomainAdapter.h"
57 #include "vamp-hostsdk/PluginLoader.h" 57 #include "vamp-hostsdk/PluginLoader.h"
58 58
59 #include "PyTypeConversions.h" 59 #include "VectorConversion.h"
60 #include "PyRealTime.h" 60 #include "PyRealTime.h"
61 61
62 #include <iostream> 62 #include <iostream>
63 #include <fstream> 63 #include <fstream>
64 #include <set> 64 #include <set>
133 { 133 {
134 cerr << "vampyhost_enumeratePlugins" << endl; 134 cerr << "vampyhost_enumeratePlugins" << endl;
135 135
136 PluginLoader *loader = PluginLoader::getInstance(); 136 PluginLoader *loader = PluginLoader::getInstance();
137 vector<PluginLoader::PluginKey> plugins = loader->listPlugins(); 137 vector<PluginLoader::PluginKey> plugins = loader->listPlugins();
138 PyTypeConversions conv; 138 VectorConversion conv;
139 return conv.PyValue_From_StringVector(plugins); 139 return conv.PyValue_From_StringVector(plugins);
140 } 140 }
141 141
142 static PyObject * 142 static PyObject *
143 vampyhost_getPluginPath(PyObject *self, PyObject *) 143 vampyhost_getPluginPath(PyObject *self, PyObject *)
144 { 144 {
145 cerr << "vampyhost_getPluginPath" << endl; 145 cerr << "vampyhost_getPluginPath" << endl;
146 146
147 vector<string> path = PluginHostAdapter::getPluginPath(); 147 vector<string> path = PluginHostAdapter::getPluginPath();
148 PyTypeConversions conv; 148 VectorConversion conv;
149 return conv.PyValue_From_StringVector(path); 149 return conv.PyValue_From_StringVector(path);
150 } 150 }
151 151
152 static string toPluginKey(PyObject *pyPluginKey) 152 static string toPluginKey(PyObject *pyPluginKey)
153 { 153 {
205 205
206 PluginLoader *loader = PluginLoader::getInstance(); 206 PluginLoader *loader = PluginLoader::getInstance();
207 PluginLoader::PluginCategoryHierarchy 207 PluginLoader::PluginCategoryHierarchy
208 category = loader->getPluginCategory(pluginKey); 208 category = loader->getPluginCategory(pluginKey);
209 209
210 PyTypeConversions conv; 210 VectorConversion conv;
211 return conv.PyValue_From_StringVector(category); 211 return conv.PyValue_From_StringVector(category);
212 } 212 }
213 213
214 static PyObject * 214 static PyObject *
215 vampyhost_getOutputList(PyObject *self, PyObject *args) 215 vampyhost_getOutputList(PyObject *self, PyObject *args)
439 return 0; 439 return 0;
440 } 440 }
441 441
442 float **inbuf = new float *[channels]; 442 float **inbuf = new float *[channels];
443 443
444 PyTypeConversions typeConv; 444 VectorConversion typeConv;
445 445
446 cerr << "here!" << endl; 446 cerr << "here!" << endl;
447 447
448 vector<vector<float> > data; 448 vector<vector<float> > data;
449 for (int c = 0; c < channels; ++c) { 449 for (int c = 0; c < channels; ++c) {
470 470
471 delete[] inbuf; 471 delete[] inbuf;
472 472
473 cerr << "no no no, here!" << endl; 473 cerr << "no no no, here!" << endl;
474 474
475 PyTypeConversions conv; 475 VectorConversion conv;
476 476
477 PyObject *pyFs = PyDict_New(); 477 PyObject *pyFs = PyDict_New();
478 478
479 for (Plugin::FeatureSet::const_iterator fsi = fs.begin(); 479 for (Plugin::FeatureSet::const_iterator fsi = fs.begin();
480 fsi != fs.end(); ++fsi) { 480 fsi != fs.end(); ++fsi) {