MCPcopy Create free account
hub / github.com/audacity/audacity / InitializePlugin

Method InitializePlugin

libraries/lib-ladspa/LadspaEffectBase.cpp:229–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229bool LadspaEffectBase::InitializePlugin()
230{
231 if (!Load())
232 return false;
233
234 mInputPorts.reinit( mData->PortCount );
235 mOutputPorts.reinit( mData->PortCount );
236 for (unsigned long p = 0; p < mData->PortCount; p++) {
237 LADSPA_PortDescriptor d = mData->PortDescriptors[p];
238
239 // Collect the audio ports
240 if (LADSPA_IS_PORT_AUDIO(d)) {
241 if (LADSPA_IS_PORT_INPUT(d))
242 mInputPorts[mAudioIns++] = p;
243 else if (LADSPA_IS_PORT_OUTPUT(d))
244 mOutputPorts[mAudioOuts++] = p;
245 }
246 // Count control ports
247 else if (LADSPA_IS_PORT_CONTROL(d)) {
248 if (LADSPA_IS_PORT_INPUT(d)) {
249 mInteractive = true;
250 ++mNumInputControls;
251 }
252 else if (LADSPA_IS_PORT_OUTPUT(d)) {
253 // LADSPA effects have a convention of providing latency on an output
254 // control port whose name is "latency".
255 if (strcmp(mData->PortNames[p], "latency") == 0)
256 mLatencyPort = p;
257 else {
258 mInteractive = true;
259 ++mNumOutputControls;
260 }
261 }
262 }
263 }
264 return true;
265}
266
267bool LadspaEffectBase::InitializeControls(LadspaEffectSettings &settings) const
268{

Callers 2

DiscoverPluginsAtPathMethod · 0.45
LoadPluginMethod · 0.45

Calls 2

LoadFunction · 0.85
reinitMethod · 0.45

Tested by

no test coverage detected