Audacity 3.2.0
LadspaEffectBase.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 LadspaEffectBase.h
6
7 Dominic Mazzoni
8
9 Paul Licameli split from LadspaEffect.h
10
11**********************************************************************/
12#ifndef __AUDACITY_LADSPA_EFFECT_BASE__
13#define __AUDACITY_LADSPA_EFFECT_BASE__
14
15#include "LadspaInstance.h" // for LadspaEffectSettings
16#include <wx/dynlib.h> // member variable
17
18#define LADSPAEFFECTS_VERSION wxT("1.0.0.0")
19/* i18n-hint: abbreviates "Linux Audio Developer's Simple Plugin API"
20 (Application programming interface)
21 */
22#define LADSPAEFFECTS_FAMILY XO("LADSPA")
23
24class LADSPA_API LadspaEffectBase
25 : public EffectWithSettings<LadspaEffectSettings, PerTrackEffect>
26{
27public:
28 LadspaEffectBase(const wxString & path, int index);
30
31 bool InitializePlugin();
32
33protected:
34 EffectSettings MakeSettings() const override;
36 const EffectSettings &src, EffectSettings &dst) const override;
37
38 std::unique_ptr<EffectOutputs> MakeOutputs() const override;
39
40 PluginPath GetPath() const override;
41 ComponentInterfaceSymbol GetSymbol() const override;
42 VendorSymbol GetVendor() const override;
43 wxString GetVersion() const override;
44 TranslatableString GetDescription() const override;
45
46 EffectType GetType() const override;
47 EffectFamilySymbol GetFamily() const override;
48 bool IsInteractive() const override;
49 bool IsDefault() const override;
50 RealtimeSince RealtimeSupport() const override;
51 bool SupportsAutomation() const override;
52
53 bool SaveSettings(
54 const EffectSettings &settings, CommandParameters & parms) const override;
55 bool LoadSettings(
56 const CommandParameters & parms, EffectSettings &settings) const override;
57
58 OptionalMessage LoadUserPreset(
59 const RegistryPath & name, EffectSettings &settings) const override;
60 bool SaveUserPreset(
61 const RegistryPath & name, const EffectSettings &settings) const override;
62
63 RegistryPaths GetFactoryPresets() const override;
64 OptionalMessage LoadFactoryPreset(int id, EffectSettings &settings)
65 const override;
66
67 bool InitializeControls(LadspaEffectSettings &settings) const;
68
69 std::shared_ptr<EffectInstance> MakeInstance() const override;
70
71 bool CanExportPresets() const override;
72
73 bool HasOptions() const override;
74
75 bool Load();
76 void Unload();
77
78 OptionalMessage LoadParameters(
79 const RegistryPath & group, EffectSettings &settings) const;
80 bool SaveParameters(
81 const RegistryPath & group, const EffectSettings &settings) const;
82
83 const wxString mPath;
84 const int mIndex;
85
86 wxDynamicLibrary mLib;
87 const LADSPA_Descriptor *mData{};
88
89 wxString pluginName;
90
91 size_t mBlockSize{ 0 };
92
93 bool mInteractive{ false };
94
95 unsigned mAudioIns{ 0 };
96 // Mapping from input channel number to audio port number
98
99 unsigned mAudioOuts{ 0 };
100 // Mapping from output channel number to audio port number
102
103 unsigned mNumInputControls{ 0 };
104 unsigned mNumOutputControls{ 0 };
105
106 int mLatencyPort{ -1 };
107};
108#endif
const TranslatableString name
Definition: Distortion.cpp:76
EffectType
std::optional< std::unique_ptr< EffectSettingsAccess::Message > > OptionalMessage
wxString RegistryPath
Definition: Identifier.h:218
wxString PluginPath
type alias for identifying a Plugin supplied by a module, each module defining its own interpretation...
Definition: Identifier.h:214
std::vector< RegistryPath > RegistryPaths
Definition: Identifier.h:219
static Settings & settings()
Definition: TrackInfo.cpp:47
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the SettingsVis...
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
RealtimeSince
In which versions of Audacity was an effect realtime capable?
EffectSettings MakeSettings() const override
Definition: Effect.h:156
bool CopySettingsContents(const EffectSettings &src, EffectSettings &dst) const override
Definition: Effect.h:160
An Effect that calls up a LADSPA plug in, i.e. many possible effects from this one class.
const wxString mPath
~LadspaEffectBase() override
wxDynamicLibrary mLib
ArrayOf< unsigned long > mInputPorts
ArrayOf< unsigned long > mOutputPorts
Holds a msgid for the translation catalog; may also bind format arguments.
THEME_RESOURCES_API void Load()
_LADSPA_Descriptor is a structure that provides the API to a LADSPA (Linux Audio Plugin Architecture)...
Definition: ladspa.h:373
Externalized state of a plug-in.