Audacity 3.2.0
LadspaEffect.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 LadspaEffect.cpp
6
7 Dominic Mazzoni
8
9 This class implements a LADSPA Plug-in effect.
10
11*******************************************************************//*******************************************************************/
18#include "LadspaEffect.h" // This class's header file
19#include "LadspaEditor.h"
21#include "LadspaEffectsModule.h"
22
24
26 wxWindow &parent, wxDialog &dialog,
27 EffectEditor *, bool forceModal) const
28{
29 dialog.Layout();
30 dialog.Fit();
31 dialog.SetMinSize(dialog.GetSize());
32
33 if ((SupportsRealtime() || GetType() == EffectTypeAnalyze) && !forceModal)
34 {
35 dialog.Show();
36 return 0;
37 }
38
39 return dialog.ShowModal();
40}
41
42std::unique_ptr<EffectEditor> LadspaEffect::MakeEditor(ShuttleGui & S,
43 EffectInstance &instance, EffectSettingsAccess &access,
44 const EffectOutputs *pOutputs) const
45{
46 auto pValues = static_cast<const LadspaEffectOutputs *>(pOutputs);
47 auto result = std::make_unique<LadspaEditor>(*this,
48 dynamic_cast<LadspaInstance&>(instance),
50 GetType(), pValues);
51 result->PopulateUI(S);
52 return result;
53}
54
56 const EffectPlugin &, const EffectSettings &) const
57{
58}
59
61 const EffectPlugin &, EffectSettings &) const
62{
63 return { nullptr };
64}
65
67{
68 LadspaEffectOptionsDialog{ *this }.ShowModal();
69}
70
71// Inject factory hook to make LadspaEffect capable of UI
72static LadspaEffectsModule::Factory::SubstituteInUnique<LadspaEffect> scope;
@ EffectTypeAnalyze
std::optional< std::unique_ptr< EffectSettingsAccess::Message > > OptionalMessage
static LadspaEffectsModule::Factory::SubstituteInUnique< LadspaEffect > scope
#define S(N)
Definition: ToChars.cpp:64
double mProjectRate
Definition: EffectBase.h:119
Performs effect computation.
Hold values to send to effect output meters.
Factory of instances of an effect.
Definition: EffectPlugin.h:36
EffectType GetType() const override
Type determines how it behaves.
unsigned mNumInputControls
unsigned mNumOutputControls
int ShowClientInterface(const EffectPlugin &plugin, wxWindow &parent, wxDialog &dialog, EffectEditor *pEditor, bool forceModal) const override
void ShowOptions(const EffectPlugin &plugin) const override
std::unique_ptr< EffectEditor > MakeEditor(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) const override
Called only from PopulateUI, to add controls to effect panel.
OptionalMessage ImportPresets(const EffectPlugin &plugin, EffectSettings &settings) const override
void ExportPresets(const EffectPlugin &plugin, const EffectSettings &settings) const override
~LadspaEffect() override
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
Externalized state of a plug-in.
Carry output control port information back to main thread.