Audacity 3.2.0
EffectPlugin.h
Go to the documentation of this file.
1/*!********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file EffectPlugin.h
6
7 Paul Licameli
8 split from EffectInterface.h
9
10**********************************************************************/
11
12#ifndef __AUDACITY_EFFECTPLUGIN_H__
13#define __AUDACITY_EFFECTPLUGIN_H__
14
15#include "EffectInterface.h"
16
17#include <functional>
18#include <memory>
19
21
22class wxDialog;
23class wxWindow;
25class EffectInstance;
26class EffectSettings;
28class EffectPlugin;
29
31 wxDialog *pDialog{};
33 std::shared_ptr<EffectInstance> pInstance{};
35};
36
38
40 wxWindow &parent, EffectPlugin &, EffectUIClientInterface &,
42
43class TrackList;
46class EffectInstance;
47
48/***************************************************************************/
52class AUDACITY_DLL_API EffectPlugin
54{
55public:
56 using EffectSettingsAccessPtr = std::shared_ptr<EffectSettingsAccess>;
57
58 const static wxString kUserPresetIdent;
59 const static wxString kFactoryPresetIdent;
60 const static wxString kCurrentSettingsIdent;
61 const static wxString kFactoryDefaultsIdent;
62
64 virtual ~EffectPlugin();
65
66 virtual const EffectSettingsManager& GetDefinition() const = 0;
67
69
82 virtual int ShowHostInterface(
83 wxWindow &parent, const EffectDialogFactory &factory,
84 std::shared_ptr<EffectInstance> &pInstance, EffectSettingsAccess &access,
85 bool forceModal = false) = 0;
86
88
94
95 virtual void Preview(EffectSettingsAccess &access, bool dryOnly) = 0;
97 const EffectSettings &settings, wxString & parms) const = 0;
99 const wxString & parms, EffectSettings &settings) const = 0;
100 virtual bool IsBatchProcessing() const = 0;
101 virtual void SetBatchProcessing() = 0;
102 virtual void UnsetBatchProcessing() = 0;
103
105
118 virtual bool DoEffect(
120 double projectRate, TrackList *list,
122 unsigned flags,
123 // Prompt the user for input only if the next arguments are not all null.
124 wxWindow *pParent = nullptr,
125 const EffectDialogFactory &dialogFactory = {},
126 const EffectSettingsAccessPtr &pAccess = nullptr
128 ) = 0;
129
132
135};
136
137#endif
std::function< DialogFactoryResults(wxWindow &parent, EffectPlugin &, EffectUIClientInterface &, EffectSettingsAccess &) > EffectDialogFactory
Type of function that creates a dialog for an effect.
Definition: EffectPlugin.h:41
static Settings & settings()
Definition: TrackInfo.cpp:87
Performs effect computation.
Factory of instances of an effect and of dialogs to control them.
Definition: EffectPlugin.h:54
static const wxString kUserPresetIdent
Definition: EffectPlugin.h:58
virtual void SetBatchProcessing()=0
virtual bool TransferDataToWindow(const EffectSettings &settings)=0
Update controls for the settings.
virtual ~EffectPlugin()
std::shared_ptr< EffectSettingsAccess > EffectSettingsAccessPtr
Definition: EffectPlugin.h:56
virtual bool DoEffect(EffectSettings &settings, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, wxWindow *pParent=nullptr, const EffectDialogFactory &dialogFactory={}, const EffectSettingsAccessPtr &pAccess=nullptr)=0
Unfortunately complicated dual-use function.
static const wxString kFactoryPresetIdent
Definition: EffectPlugin.h:59
virtual bool TransferDataFromWindow(EffectSettings &settings)=0
Update the given settings from controls.
virtual void UnsetBatchProcessing()=0
virtual int ShowHostInterface(wxWindow &parent, const EffectDialogFactory &factory, std::shared_ptr< EffectInstance > &pInstance, EffectSettingsAccess &access, bool forceModal=false)=0
Usually applies factory to self and given access.
virtual EffectUIClientInterface * GetEffectUIClientInterface()=0
Returns the EffectUIClientInterface instance for this effect.
virtual bool SaveSettingsAsString(const EffectSettings &settings, wxString &parms) const =0
virtual const EffectSettingsManager & GetDefinition() const =0
virtual bool IsBatchProcessing() const =0
static const wxString kCurrentSettingsIdent
Definition: EffectPlugin.h:60
static const wxString kFactoryDefaultsIdent
Definition: EffectPlugin.h:61
virtual void Preview(EffectSettingsAccess &access, bool dryOnly)=0
virtual bool LoadSettingsFromString(const wxString &parms, EffectSettings &settings) const =0
EffectPlugin & operator=(EffectPlugin &)=delete
EffectSettingsManager is an EffectDefinitionInterface that adds a factory function for EffectSettings...
EffectUIClientInterface is an abstract base class to populate a UI and validate UI values....
Interface for transferring values from a panel of effect controls.
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Definition: Track.h:1338
Used to create or clone a WaveTrack, with appropriate context from the project that will own the trac...
Definition: WaveTrack.h:613
static RegisteredToolbarFactory factory
std::shared_ptr< EffectInstance > pInstance
constructed and successfully Init()-ed; or null for failure
Definition: EffectPlugin.h:33
EffectUIValidator * pValidator
Definition: EffectPlugin.h:34
Externalized state of a plug-in.