Audacity 3.2.0
EffectEditor.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 EffectEditor.h
6
7 Dominic Mazzoni
8 Vaughan Johnson
9 Martyn Shaw
10
11 Paul Licameli split from EffectPlugin.h
12
13**********************************************************************/
14#ifndef __AUDACITY_EFFECT_EDITOR__
15#define __AUDACITY_EFFECT_EDITOR__
16
17#include "Observer.h"
18#include <wx/event.h>
19
22class wxWindow;
23
26{
27 size_t index { size_t(-1) };
28 float newValue {};
29};
30
31class AUDACITY_DLL_API EffectEditor /* not final */
32 : public Observer::Publisher<EffectSettingChanged>
33{
34public:
36 const EffectUIServices &services, EffectSettingsAccess &access);
37
38 virtual ~EffectEditor();
39
41
44 virtual bool ValidateUI() = 0;
45
47
52 virtual bool UpdateUI();
53
58 virtual bool IsGraphicalUI();
59
61
64 virtual void Disconnect();
65
70 virtual void OnClose();
71
73 static bool EnableApply(wxWindow *parent, bool enable = true);
74
75 // id that should be used by preview play button of effect dialog
76 static constexpr int kPlayID = 20102;
77
80 static bool EnablePreview(wxWindow *parent, bool enable = true);
81
82 protected:
83 // Convenience function template for binding event handler functions
84 template<typename EventTag, typename Class, typename Event>
85 void BindTo(
86 wxEvtHandler &src, const EventTag& eventType, void (Class::*pmf)(Event &))
87 {
88 src.Bind(eventType, pmf, static_cast<Class *>(this));
89 }
90
93
94 bool mUIClosed { false };
95};
96#endif
static const int kPlayID
Definition: EffectUI.cpp:132
virtual bool ValidateUI()=0
Get settings data from the panel; may make error dialogs and return false.
const EffectUIServices & mUIServices
Definition: EffectEditor.h:91
virtual ~EffectEditor()
EffectSettingsAccess & mAccess
Definition: EffectEditor.h:92
void BindTo(wxEvtHandler &src, const EventTag &eventType, void(Class::*pmf)(Event &))
Definition: EffectEditor.h:85
An object that sends messages to an open-ended list of subscribed callbacks.
Definition: Observer.h:108
void OnClose(const CommandContext &context)
Definition: FileMenus.cpp:241
Message sent by EffectEditor when a setting is changed by the user.
Definition: EffectEditor.h:26