comparison vamp-sdk/hostext/PluginInputDomainAdapter.cpp @ 59:fa79c4ec847d host-factory-stuff

* Put hostext stuff in the HostExt sub-namespace * Tidy up system-specific stuff in PluginLoader * Make PluginLoader return a deletion-notifying wrapper which permits the library to be unloaded when no longer in use * Add PluginChannelAdapter * Make vamp-simple-host use PluginChannelAdapter, and use the PluginLoader for plugin-running task. Also some other enhancements to host
author cannam
date Thu, 24 May 2007 15:17:07 +0000
parents 0284955e31e5
children 087c16cca0d6
comparison
equal deleted inserted replaced
58:0284955e31e5 59:fa79c4ec847d
38 38
39 #include <cmath> 39 #include <cmath>
40 40
41 namespace Vamp { 41 namespace Vamp {
42 42
43 namespace HostExt {
44
43 PluginInputDomainAdapter::PluginInputDomainAdapter(Plugin *plugin) : 45 PluginInputDomainAdapter::PluginInputDomainAdapter(Plugin *plugin) :
44 PluginWrapper(plugin), 46 PluginWrapper(plugin),
45 m_channels(0), 47 m_channels(0),
46 m_blockSize(0), 48 m_blockSize(0),
47 m_freqbuf(0) 49 m_freqbuf(0)
53 } 55 }
54 56
55 bool 57 bool
56 PluginInputDomainAdapter::initialise(size_t channels, size_t stepSize, size_t blockSize) 58 PluginInputDomainAdapter::initialise(size_t channels, size_t stepSize, size_t blockSize)
57 { 59 {
58 //!!! complain and die if blocksize is not a power of 2 60 //!!! complain and adapt-or-die if blocksize is not a power of 2
59 61
60 if (m_plugin->getInputDomain() == FrequencyDomain) { 62 if (m_plugin->getInputDomain() == FrequencyDomain) {
61 if (m_channels > 0) { 63 if (m_channels > 0) {
62 for (size_t c = 0; c < m_channels; ++c) { 64 for (size_t c = 0; c < m_channels; ++c) {
63 delete[] m_freqbuf[c]; 65 delete[] m_freqbuf[c];
104 } 106 }
105 107
106 size_t 108 size_t
107 PluginInputDomainAdapter::getPreferredBlockSize() const 109 PluginInputDomainAdapter::getPreferredBlockSize() const
108 { 110 {
111 //!!! complain and adapt-or-die if blocksize is not a power of 2
112
109 size_t block = m_plugin->getPreferredBlockSize(); 113 size_t block = m_plugin->getPreferredBlockSize();
110 114
111 if (block == 0 && (m_plugin->getInputDomain() == FrequencyDomain)) { 115 if (block == 0 && (m_plugin->getInputDomain() == FrequencyDomain)) {
112 block = 1024; 116 block = 1024;
113 } 117 }
267 io[i] /= denom; 271 io[i] /= denom;
268 } 272 }
269 } 273 }
270 } 274 }
271 275
276 }
272 277
273 } 278 }
274 279