Audacity  3.0.3
VampEffect.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  VampEffect.h
6 
7  Chris Cannam
8 
9  Vamp is an audio analysis and feature extraction plugin API.
10  http://www.vamp-plugins.org/
11 
12 **********************************************************************/
13 
14 
15 
16 #if defined(USE_VAMP)
17 
18 #include <vamp-hostsdk/PluginLoader.h>
19 
20 #include "../Effect.h"
21 
22 class wxStaticText;
23 class wxSlider;
24 class wxChoice;
25 class wxCheckBox;
26 class wxTextCtrl;
27 class LabelTrack;
28 
29 #define VAMPEFFECTS_VERSION wxT("1.0.0.0")
30 /* i18n-hint: Vamp is the proper name of a software protocol for sound analysis.
31  It is not an abbreviation for anything. See http://vamp-plugins.org */
32 #define VAMPEFFECTS_FAMILY XO("Vamp")
33 
34 class VampEffect final : public Effect
35 {
36 public:
37  VampEffect(std::unique_ptr<Vamp::Plugin> &&plugin,
38  const PluginPath & path,
39  int output,
40  bool hasParameters);
41  virtual ~VampEffect();
42 
43  // ComponentInterface implementation
44 
45  PluginPath GetPath() override;
47  VendorSymbol GetVendor() override;
48  wxString GetVersion() override;
50 
51  // EffectDefinitionInterface implementation
52 
53  EffectType GetType() override;
54  EffectFamilySymbol GetFamily() override;
55  bool IsInteractive() override;
56  bool IsDefault() override;
57 
58  // EffectClientInterface implementation
59 
60  unsigned GetAudioInCount() override;
61  bool GetAutomationParameters(CommandParameters & parms) override;
62  bool SetAutomationParameters(CommandParameters & parms) override;
63 
64  // Effect implementation
65 
66  bool Init() override;
67  bool Process() override;
68  void End() override;
69  void PopulateOrExchange(ShuttleGui & S) override;
70  bool TransferDataToWindow() override;
71  bool TransferDataFromWindow() override;
72 
73 private:
74  // VampEffect implementation
75 
76  void AddFeatures(LabelTrack *track, Vamp::Plugin::FeatureSet & features);
77 
78  void UpdateFromPlugin();
79 
80  void OnCheckBox(wxCommandEvent & evt);
81  void OnChoice(wxCommandEvent & evt);
82  void OnSlider(wxCommandEvent & evt);
83  void OnTextCtrl(wxCommandEvent & evt);
84 
85 private:
86  std::unique_ptr<Vamp::Plugin> mPlugin;
88  int mOutput;
90 
91  Vamp::HostExt::PluginLoader::PluginKey mKey;
92  wxString mName;
93  double mRate;
94 
95  bool mInSlider;
96  bool mInText;
97 
98  Vamp::Plugin::ParameterList mParameters;
99 
101 
107  wxChoice *mProgram;
108 
109  DECLARE_EVENT_TABLE()
110 };
111 
112 #endif
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
CommandParameters
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the Shuttle cla...
Definition: EffectAutomationParameters.h:67
VampEffect::OnChoice
void OnChoice(wxCommandEvent &evt)
Definition: VampEffect.cpp:800
VampEffect::~VampEffect
virtual ~VampEffect()
Definition: VampEffect.cpp:82
VampEffect::mPath
PluginPath mPath
Definition: VampEffect.h:87
VampEffect::TransferDataToWindow
bool TransferDataToWindow() override
Definition: VampEffect.cpp:696
VampEffect::mKey
Vamp::HostExt::PluginLoader::PluginKey mKey
Definition: VampEffect.h:91
VampEffect::GetDescription
TranslatableString GetDescription() override
Definition: VampEffect.cpp:110
VampEffect::VampEffect
VampEffect(std::unique_ptr< Vamp::Plugin > &&plugin, const PluginPath &path, int output, bool hasParameters)
Definition: VampEffect.cpp:68
VampEffect::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: VampEffect.cpp:708
VampEffect::Init
bool Init() override
Definition: VampEffect.cpp:299
VampEffect::IsInteractive
bool IsInteractive() override
Definition: VampEffect.cpp:130
Effect
Base class for many of the effects in Audacity.
Definition: Effect.h:72
VampEffect::Process
bool Process() override
Definition: VampEffect.cpp:344
PluginPath
wxString PluginPath
type alias for identifying a Plugin supplied by a module, each module defining its own interpretation...
Definition: Identifier.h:214
VampEffect::OnTextCtrl
void OnTextCtrl(wxCommandEvent &evt)
Definition: VampEffect.cpp:843
VampEffect::GetPath
PluginPath GetPath() override
Definition: VampEffect.cpp:90
VampEffect::mOutput
int mOutput
Definition: VampEffect.h:88
LabelTrack
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:88
VampEffect::mInSlider
bool mInSlider
Definition: VampEffect.h:95
VampEffect::mName
wxString mName
Definition: VampEffect.h:92
VampEffect::mToggles
ArrayOf< wxCheckBox * > mToggles
Definition: VampEffect.h:105
VampEffect::GetType
EffectType GetType() override
Definition: VampEffect.cpp:120
VampEffect::mValues
Floats mValues
Definition: VampEffect.h:100
VampEffect::mParameters
Vamp::Plugin::ParameterList mParameters
Definition: VampEffect.h:98
VampEffect::mChoices
ArrayOf< wxChoice * > mChoices
Definition: VampEffect.h:106
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
VampEffect::mPlugin
std::unique_ptr< Vamp::Plugin > mPlugin
Definition: VampEffect.h:86
VampEffect::AddFeatures
void AddFeatures(LabelTrack *track, Vamp::Plugin::FeatureSet &features)
Definition: VampEffect.cpp:720
VampEffect::UpdateFromPlugin
void UpdateFromPlugin()
Definition: VampEffect.cpp:750
VampEffect::SetAutomationParameters
bool SetAutomationParameters(CommandParameters &parms) override
Definition: VampEffect.cpp:194
VampEffect::GetVendor
VendorSymbol GetVendor() override
Definition: VampEffect.cpp:100
VampEffect::OnSlider
void OnSlider(wxCommandEvent &evt)
Definition: VampEffect.cpp:816
VampEffect::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: VampEffect.cpp:535
VampEffect::End
void End() override
Definition: VampEffect.cpp:530
VampEffect::IsDefault
bool IsDefault() override
Definition: VampEffect.cpp:135
VampEffect::GetAutomationParameters
bool GetAutomationParameters(CommandParameters &parms) override
Definition: VampEffect.cpp:148
VampEffect::mLabels
ArrayOf< wxStaticText * > mLabels
Definition: VampEffect.h:104
VampEffect::OnCheckBox
void OnCheckBox(wxCommandEvent &evt)
Definition: VampEffect.cpp:793
VampEffect::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: VampEffect.cpp:95
VampEffect::mSliders
ArrayOf< wxSlider * > mSliders
Definition: VampEffect.h:102
VampEffect::mRate
double mRate
Definition: VampEffect.h:93
VampEffect::GetAudioInCount
unsigned GetAudioInCount() override
Definition: VampEffect.cpp:143
VampEffect::mFields
ArrayOf< wxTextCtrl * > mFields
Definition: VampEffect.h:103
VampEffect::mHasParameters
bool mHasParameters
Definition: VampEffect.h:89
VampEffect::GetVersion
wxString GetVersion() override
Definition: VampEffect.cpp:105
EffectType
EffectType
Definition: EffectInterface.h:55
VampEffect::mProgram
wxChoice * mProgram
Definition: VampEffect.h:107
VampEffect::GetFamily
EffectFamilySymbol GetFamily() override
Definition: VampEffect.cpp:125
VampEffect
Definition: VampEffect.h:35
ArrayOf< float >
VampEffect::mInText
bool mInText
Definition: VampEffect.h:96
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631