Audacity 3.2.0
LadspaEditor.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 LadspaEditor.h
6
7 Dominic Mazzoni
8
9 Paul Licameli split from LadspaEffect.cpp
10
11**********************************************************************/
12#ifndef __AUDACITY_LADSPA_EDITOR__
13#define __AUDACITY_LADSPA_EDITOR__
14
15#include "../EffectEditor.h"
16#include "LadspaInstance.h" // for LadspaEffectSettings
17
18#include <wx/dialog.h>
19#include <wx/weakref.h>
20
21struct LadspaInstance;
22class NumericTextCtrl;
23class wxSlider;
24class wxTextCtrl;
25class wxStaticText;
26class wxCheckBox;
28
32 {
33 auto pSettings = settings.cast<LadspaEffectSettings>();
34 assert(pSettings);
35 return *pSettings;
36 }
38 static inline const LadspaEffectSettings &
40 {
41 return GetSettings(const_cast<EffectSettings &>(settings));
42 }
43
44 LadspaEditor(const EffectUIServices &effect,
45 const LadspaInstance &instance,
46 unsigned numInputControls, unsigned numOutputControls,
47 EffectSettingsAccess &access, double sampleRate, EffectType type,
48 const LadspaEffectOutputs *pOutputs);
49
50 bool UpdateUI() override;
51 bool ValidateUI() override;
52 void Disconnect() override;
53
54 void PopulateUI(ShuttleGui &S);
55
56 void OnCheckBox(wxCommandEvent & evt);
57 void OnSlider(wxCommandEvent & evt);
58 void OnTextCtrl(wxCommandEvent & evt);
59 void RefreshControls();
60
61 void UpdateControl(int index, float value, float epsilon);
62 void UpdateControls(const LadspaEffectSettings& src);
63
65 const unsigned mNumInputControls;
66 const unsigned mNumOutputControls;
67
68 const double mSampleRate;
72
74 wxWeakRef<wxDialog> mDialog;
75 wxWindow *mParent{};
80 std::vector<LadspaEffectMeter *> mMeters;
81};
82
83#endif
EffectType
#define S(N)
Definition: ToChars.cpp:64
static Settings & settings()
Definition: TrackInfo.cpp:51
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
Externalized state of a plug-in.
const unsigned mNumInputControls
Definition: LadspaEditor.h:65
wxWindow * mParent
Definition: LadspaEditor.h:75
static const LadspaEffectSettings & GetSettings(const EffectSettings &settings)
Assume settings originated from MakeSettings() and copies thereof.
Definition: LadspaEditor.h:39
const EffectType mType
Definition: LadspaEditor.h:69
void PopulateUI(ShuttleGui &S)
ArrayOf< wxSlider * > mSliders
Definition: LadspaEditor.h:76
const double mSampleRate
Definition: LadspaEditor.h:68
wxWeakRef< wxDialog > mDialog
Definition: LadspaEditor.h:74
void Disconnect() override
On the first call only, may disconnect from further event handling.
ArrayOf< wxCheckBox * > mToggles
Definition: LadspaEditor.h:79
static LadspaEffectSettings & GetSettings(EffectSettings &settings)
Assume settings originated from MakeSettings() and copies thereof.
Definition: LadspaEditor.h:31
LadspaEffectSettings mSettings
Definition: LadspaEditor.h:70
NumericTextCtrl * mDuration
Definition: LadspaEditor.h:73
ArrayOf< wxStaticText * > mLabels
Definition: LadspaEditor.h:78
ArrayOf< wxTextCtrl * > mFields
Definition: LadspaEditor.h:77
LadspaEditor(const EffectUIServices &effect, const LadspaInstance &instance, unsigned numInputControls, unsigned numOutputControls, EffectSettingsAccess &access, double sampleRate, EffectType type, const LadspaEffectOutputs *pOutputs)
const LadspaEffectOutputs *const mpOutputs
Definition: LadspaEditor.h:71
void UpdateControls(const LadspaEffectSettings &src)
void RefreshControls()
void OnCheckBox(wxCommandEvent &evt)
void OnSlider(wxCommandEvent &evt)
void UpdateControl(int index, float value, float epsilon)
void OnTextCtrl(wxCommandEvent &evt)
bool ValidateUI() override
Get settings data from the panel; may make error dialogs and return false.
std::vector< LadspaEffectMeter * > mMeters
Definition: LadspaEditor.h:80
const unsigned mNumOutputControls
Definition: LadspaEditor.h:66
const LadspaInstance & mInstance
Definition: LadspaEditor.h:64
bool UpdateUI() override
Update appearance of the panel for changes in settings.
Carry output control port information back to main thread.