1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-14 23:30:23 +02:00
audacity/src/effects/vamp/VampEffect.h
lllucius 41083f74cc Another round of effects bashing.
I've added some of the new plugin stuff to LV2, Nyquist, and
Vamp so that they play better in the new system.  They no
longer get bunched in with the Audacity effects when sorting
or grouping the menus.  They have not been fully converted
but they should be good for 2.1.0.

Nyquist plugins now include ";author" and ";copyright"
statements.

Added the 4 new Nyquist plugins to the Windows build.

Audiounits are still coming...had to push them to the back
burner to get this other stuff out of the way.

Scanning for new plugins has been improved so that newly
discovered ones will be shown to the user when Audacity starts.

Effects menu sorting has been fixed and improved.

Disabling effect types in Preferences works again and you
no longer have to restart Audacity for them the change to work.

Effect usage in chains works again.

Plugin registration dialog code simplified a bit.

Group names in the pluginregistry are now base64 encoded.  I
never really thought about it, but wxFileConfig group names
are case insensitive and since I was using the group name as
the plugin ID, I ran into a conflict on Linux where there
were two plugins with the same name, just different case.  (And
they were different plugins.)  Hoping all of this will change
when/if the config file gets converted to XML.  (wx3 if finally
including XML support)

A fair amount of cleanup of this new code has been done and
will continue as more stuff is converted.
2014-11-19 06:58:44 +00:00

137 lines
3.0 KiB
C++

/**********************************************************************
Audacity: A Digital Audio Editor
VampEffect.h
Chris Cannam
Vamp is an audio analysis and feature extraction plugin API.
http://www.vamp-plugins.org/
**********************************************************************/
#include "../Effect.h"
#include "../../LabelTrack.h"
class wxSlider;
class wxStaticText;
class wxTextCtrl;
class wxCheckBox;
class wxComboBox;
#include <wx/dialog.h>
#include <vamp-hostsdk/PluginLoader.h>
#define VAMPEFFECTS_VERSION wxT("1.0.0.0");
#define VAMPEFFECTS_FAMILY L"Vamp"
class VampEffect : public Effect {
public:
VampEffect(Vamp::HostExt::PluginLoader::PluginKey key,
int output,
bool hasParameters,
wxString name,
wxString category = wxString());
virtual ~VampEffect();
// IdentInterface implementation
virtual PluginID GetID();
virtual wxString GetPath();
virtual wxString GetName();
virtual wxString GetVendor();
virtual wxString GetVersion();
virtual wxString GetDescription();
// EffectIdentInterface implementation
virtual EffectType GetType();
virtual wxString GetFamily();
virtual bool IsInteractive();
virtual bool IsDefault();
virtual bool IsLegacy();
virtual bool SupportsRealtime();
virtual bool SupportsAutomation();
// Effect implementation
virtual wxString GetEffectName();
virtual std::set<wxString> GetEffectCategories();
virtual wxString GetEffectIdentifier();
virtual wxString GetEffectAction();
virtual bool Init();
virtual bool PromptUser();
virtual bool Process();
virtual void End();
private:
VampEffect(const VampEffect &);
VampEffect &operator=(const VampEffect &);
Vamp::HostExt::PluginLoader::PluginKey mKey;
int mOutput;
bool mHasParameters;
wxString mName;
double mRate;
wxString mCategory;
Vamp::Plugin *mPlugin;
void AddFeatures(LabelTrack *track,
Vamp::Plugin::FeatureSet &features);
};
class VampEffectDialog : public wxDialog {
DECLARE_DYNAMIC_CLASS(VampEffectDialog)
public:
VampEffectDialog(VampEffect *effect,
wxWindow *parent,
Vamp::Plugin *plugin);
~VampEffectDialog();
void OnCheckBox(wxCommandEvent & event);
void OnComboBox(wxCommandEvent & event);
void OnSlider(wxCommandEvent & event);
void OnTextCtrl(wxCommandEvent & event);
void OnOK(wxCommandEvent & event);
void OnCancel(wxCommandEvent & event);
void OnPreview(wxCommandEvent & event);
void ControlSetFocus(wxFocusEvent & event);
DECLARE_EVENT_TABLE()
private:
void HandleText();
void UpdateFromPlugin();
void ConnectFocus(wxControl *c);
void DisconnectFocus(wxControl *c);
bool inSlider;
bool inText;
VampEffect *mEffect;
Vamp::Plugin *mPlugin;
Vamp::Plugin::ParameterList mParameters;
wxSlider **sliders;
wxTextCtrl **fields;
wxStaticText **labels;
wxCheckBox **toggles;
wxComboBox **combos;
wxComboBox *programCombo;
};