comparison vamp-sdk/PluginHostAdapter.cpp @ 15:6c5466fbea90

* fix failure to pick up all but first plugin's outputs
author cannam
date Thu, 06 Apr 2006 17:23:41 +0000
parents a3d35e11c3fe
children c29eccb892f1
comparison
equal deleted inserted replaced
14:b63909cbbf57 15:6c5466fbea90
42 PluginHostAdapter::PluginHostAdapter(const VampPluginDescriptor *descriptor, 42 PluginHostAdapter::PluginHostAdapter(const VampPluginDescriptor *descriptor,
43 float inputSampleRate) : 43 float inputSampleRate) :
44 Plugin(inputSampleRate), 44 Plugin(inputSampleRate),
45 m_descriptor(descriptor) 45 m_descriptor(descriptor)
46 { 46 {
47 std::cerr << "PluginHostAdapter::PluginHostAdapter (plugin = " << descriptor->name << ")" << std::endl; 47 // std::cerr << "PluginHostAdapter::PluginHostAdapter (plugin = " << descriptor->name << ")" << std::endl;
48 m_handle = m_descriptor->instantiate(m_descriptor, inputSampleRate); 48 m_handle = m_descriptor->instantiate(m_descriptor, inputSampleRate);
49 if (!m_handle) {
50 // std::cerr << "WARNING: PluginHostAdapter: Plugin instantiation failed for plugin " << m_descriptor->name << std::endl;
51 }
49 } 52 }
50 53
51 PluginHostAdapter::~PluginHostAdapter() 54 PluginHostAdapter::~PluginHostAdapter()
52 { 55 {
56 // std::cerr << "PluginHostAdapter::~PluginHostAdapter (plugin = " << m_descriptor->name << ")" << std::endl;
53 if (m_handle) m_descriptor->cleanup(m_handle); 57 if (m_handle) m_descriptor->cleanup(m_handle);
54 } 58 }
55 59
56 bool 60 bool
57 PluginHostAdapter::initialise(size_t channels, 61 PluginHostAdapter::initialise(size_t channels,
213 217
214 PluginHostAdapter::OutputList 218 PluginHostAdapter::OutputList
215 PluginHostAdapter::getOutputDescriptors() const 219 PluginHostAdapter::getOutputDescriptors() const
216 { 220 {
217 OutputList list; 221 OutputList list;
218 if (!m_handle) return list; 222 if (!m_handle) {
223 // std::cerr << "PluginHostAdapter::getOutputDescriptors: no handle " << std::endl;
224 return list;
225 }
219 226
220 unsigned int count = m_descriptor->getOutputCount(m_handle); 227 unsigned int count = m_descriptor->getOutputCount(m_handle);
221 228
222 for (unsigned int i = 0; i < count; ++i) { 229 for (unsigned int i = 0; i < count; ++i) {
223 VampOutputDescriptor *sd = m_descriptor->getOutputDescriptor(m_handle, i); 230 VampOutputDescriptor *sd = m_descriptor->getOutputDescriptor(m_handle, i);