Introduce EffectPlugin base class

Extract a base class from VSTPlugin so new types of effect plugins
besides VST can be implemented.

The VSTProcessor no longer needs to know about VST or any specific
plugin standard.  Instead it uses the EffectPlugin interface and is
renamed EffectProcessor.

Note that the Settings dialog UI is still hardcoded for VST plugins.
This will be fixed in another commit.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Use EffectPlugin in VSTSettingsPage

Avoid referring to VST when we can use the generic EffectPlugin type
instead.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Extract plugin scanner from AddVSTPluginDialog

In order to support AudioUnit plugins the VST settings page and add
plugin dialog must become more generic.  Introduce the concept of a
PluginScanner that lists plugins found on the system.

The PluginScanner allows the AddVSTPluginDialog to enumerate and select
plugins without being VST-specific.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Rename AddVSTPluginDialog to AddEffectPluginDialog

Now that the add plugin dialog is no longer VST-specific it should be
renamed.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Rename VSTSettingsPage to EffectSettingsPage

Now that VSTSettingsPage is no longer VST-specific it should be renamed.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Make EffectPlugin->name a property

For completeness, make getName() a read-only property.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Add EffectPlugin->wetDryMix property

Store the wet/dry mix level, also known as send/return mix.  This allows
each plugin instance to behave differently with respect to mixing input
and output signals.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Add wet/dry mix control to EffectSettingsPage

Allow the user to set the wet/dry mix.  Only expose a drop-down list
with "On", "Mix", and "Bypass" for the time being.  Later we might
provide a knob for the full [0.0, 1.0] range.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Fix incorrect scratch buffer sizes in EffectProcessor

The EffectProcessor keeps two sets of working buffers around.  They are
used for inputs and outputs, respectively.  When there is more than one
EffectPlugin in a chain, the processing function swaps these two buffer
sets as it lets each plugin generate audio.

This logic was broken because we distinguished between maximum number of
inputs and outputs for a plugin.  Since the buffer sets are swapped
after each iteration of the processing loop, this can lead to
out-of-bound memory accesses if the number of inputs and outputs differ.

Simplify the logic by just keeping a maximum number of inputs or outputs
and allocating two sets of these buffers.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Honor EffectPlugin->wetDryMix in EffectProcessor

Apply the wet/dry mix during processing.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>