| 227 | } |
| 228 | |
| 229 | bool 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 | |
| 267 | bool LadspaEffectBase::InitializeControls(LadspaEffectSettings &settings) const |
| 268 | { |
no test coverage detected