comparison vamp-sdk/PluginAdapter.h @ 47:be8fdfe25693

* Change input buffers arg to process from float ** to const float *const * to avoid plugins modifying their input data * Some improvements to comments * Fix stupidity in frequency-domain input passing (there are n/2+1 values, not n/2)
author cannam
date Fri, 08 Dec 2006 17:39:32 +0000
parents 85801331454c
children 74822738965b
comparison
equal deleted inserted replaced
46:2858c897d90f 47:be8fdfe25693
83 unsigned int i); 83 unsigned int i);
84 84
85 static void vampReleaseOutputDescriptor(VampOutputDescriptor *desc); 85 static void vampReleaseOutputDescriptor(VampOutputDescriptor *desc);
86 86
87 static VampFeatureList *vampProcess(VampPluginHandle handle, 87 static VampFeatureList *vampProcess(VampPluginHandle handle,
88 float **inputBuffers, 88 const float *const *inputBuffers,
89 int sec, 89 int sec,
90 int nsec); 90 int nsec);
91 91
92 static VampFeatureList *vampGetRemainingFeatures(VampPluginHandle handle); 92 static VampFeatureList *vampGetRemainingFeatures(VampPluginHandle handle);
93 93
97 void checkOutputMap(Plugin *plugin); 97 void checkOutputMap(Plugin *plugin);
98 unsigned int getOutputCount(Plugin *plugin); 98 unsigned int getOutputCount(Plugin *plugin);
99 VampOutputDescriptor *getOutputDescriptor(Plugin *plugin, 99 VampOutputDescriptor *getOutputDescriptor(Plugin *plugin,
100 unsigned int i); 100 unsigned int i);
101 VampFeatureList *process(Plugin *plugin, 101 VampFeatureList *process(Plugin *plugin,
102 float **inputBuffers, 102 const float *const *inputBuffers,
103 int sec, int nsec); 103 int sec, int nsec);
104 VampFeatureList *getRemainingFeatures(Plugin *plugin); 104 VampFeatureList *getRemainingFeatures(Plugin *plugin);
105 VampFeatureList *convertFeatures(Plugin *plugin, 105 VampFeatureList *convertFeatures(Plugin *plugin,
106 const Plugin::FeatureSet &features); 106 const Plugin::FeatureSet &features);
107 107
108 // maps both plugins and descriptors to adapters 108 // maps both plugins and descriptors to adapters
129 template <typename P> 129 template <typename P>
130 class PluginAdapter : public PluginAdapterBase 130 class PluginAdapter : public PluginAdapterBase
131 { 131 {
132 public: 132 public:
133 PluginAdapter() : PluginAdapterBase() { } 133 PluginAdapter() : PluginAdapterBase() { }
134 ~PluginAdapter() { } 134 virtual ~PluginAdapter() { }
135 135
136 protected: 136 protected:
137 Plugin *createPlugin(float inputSampleRate) { 137 Plugin *createPlugin(float inputSampleRate) {
138 P *p = new P(inputSampleRate); 138 P *p = new P(inputSampleRate);
139 Plugin *plugin = dynamic_cast<Plugin *>(p); 139 Plugin *plugin = dynamic_cast<Plugin *>(p);