comparison pyvamp-main.cpp @ 6:e1b508f2f914

Added support to memory buffers to be used with NumPy (and some rationalisation of code)
author fazekasgy
date Wed, 19 Mar 2008 16:02:29 +0000
parents 134313c59d82
children a4c955e9a70b
comparison
equal deleted inserted replaced
5:6ed5ebd38fde 6:e1b508f2f914
59 using std::cerr; 59 using std::cerr;
60 using std::endl; 60 using std::endl;
61 using std::string; 61 using std::string;
62 using std::vector; 62 using std::vector;
63 63
64 volatile bool mutex = false; 64 //volatile bool mutex = false;
65 static int adinstcount; 65 static int adinstcount;
66 66
67 class PyPluginAdapter : public Vamp::PluginAdapterBase 67 class PyPluginAdapter : public Vamp::PluginAdapterBase
68 { 68 {
69 public: 69 public:
147 //Scanning Plugins 147 //Scanning Plugins
148 cerr << "Scanning PyPlugins" << endl; 148 cerr << "Scanning PyPlugins" << endl;
149 scanner = PyPlugScanner::getInstance(); 149 scanner = PyPlugScanner::getInstance();
150 pyPath=scanner->getAllValidPath(); 150 pyPath=scanner->getAllValidPath();
151 //add this as extra path for development 151 //add this as extra path for development
152 pyPath.push_back("/Users/Shared/Development/vamp-experiments"); 152 //pyPath.push_back("/Users/Shared/Development/vamp-experiments");
153 scanner->setPath(pyPath); 153 scanner->setPath(pyPath);
154 pyPlugs = scanner->getPyPlugs(); 154 pyPlugs = scanner->getPyPlugs();
155 cerr << "Found " << pyPlugs.size() << " Scripts ...OK" << endl; 155 cerr << "Found " << pyPlugs.size() << " Scripts ...OK" << endl;
156 //TODO: this will support multiple classes per script 156 //TODO: this will support multiple classes per script
157 pyInstances = scanner->getPyInstances(); 157 pyInstances = scanner->getPyInstances();
159 159
160 for (size_t i = 0; i < pyPlugs.size(); ++i) { 160 for (size_t i = 0; i < pyPlugs.size(); ++i) {
161 adapters.push_back( new PyPluginAdapter(pyPlugs[i],pyInstances[i])); 161 adapters.push_back( new PyPluginAdapter(pyPlugs[i],pyInstances[i]));
162 } 162 }
163 haveScannedPlugins=true; 163 haveScannedPlugins=true;
164
164 } 165 }
165 166
166 cerr << "Accessing adapter index: " << index << " (adapters: " << adapters.size() << ")" << endl; 167 cerr << "Accessing adapter index: " << index << " (adapters: " << adapters.size() << ")" << endl;
167 if (index<adapters.size()) { 168 if (index<adapters.size()) {
168 const VampPluginDescriptor *tmp = adapters[index]->getDescriptor(); 169 const VampPluginDescriptor *tmp = adapters[index]->getDescriptor();