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
32 /*
33 @param[out] pInstance may construct
34 (and then must call Init() with success), or leave null for failure
35 */
36using EffectDialogFactory = std::function< wxDialog* (
37 wxWindow &parent, EffectPlugin &, EffectUIClientInterface &,
38 std::shared_ptr<EffectInstance> &,
40
41class TrackList;
44class EffectInstance;
45
46/***************************************************************************/
50class AUDACITY_DLL_API EffectPlugin
52{
53public:
54 using EffectSettingsAccessPtr = std::shared_ptr<EffectSettingsAccess>;
55
56 const static wxString kUserPresetIdent;
57 const static wxString kFactoryPresetIdent;
58 const static wxString kCurrentSettingsIdent;
59 const static wxString kFactoryDefaultsIdent;
60
62 virtual ~EffectPlugin();
63
64 virtual const EffectSettingsManager& GetDefinition() const = 0;
65
67
80 virtual int ShowHostInterface(
81 wxWindow &parent, const EffectDialogFactory &factory,
82 std::shared_ptr<EffectInstance> &pInstance, EffectSettingsAccess &access,
83 bool forceModal = false) = 0;
84
85 virtual void Preview(EffectSettingsAccess &access, bool dryOnly) = 0;
87 const EffectSettings &settings, wxString & parms) const = 0;
89 const wxString & parms, EffectSettings &settings) const = 0;
90 virtual bool IsBatchProcessing() const = 0;
91 virtual void SetBatchProcessing() = 0;
92 virtual void UnsetBatchProcessing() = 0;
93
95
108 virtual bool DoEffect(
110 double projectRate, TrackList *list,
112 unsigned flags,
113 // Prompt the user for input only if the next arguments are not all null.
114 wxWindow *pParent = nullptr,
115 const EffectDialogFactory &dialogFactory = {},
116 const EffectSettingsAccessPtr &pAccess = nullptr
118 ) = 0;
119
122
125};
126
127#endif
static RegisteredToolbarFactory factory
std::function< wxDialog *(wxWindow &parent, EffectPlugin &, EffectUIClientInterface &, std::shared_ptr< EffectInstance > &, EffectSettingsAccess &) > EffectDialogFactory
Type of function that creates a dialog for an effect.
Definition: EffectPlugin.h:39
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:52
static const wxString kUserPresetIdent
Definition: EffectPlugin.h:56
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:54
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:57
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 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:58
static const wxString kFactoryDefaultsIdent
Definition: EffectPlugin.h:59
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....
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Definition: Track.h:1330
Used to create or clone a WaveTrack, with appropriate context from the project that will own the trac...
Definition: WaveTrack.h:612
Externalized state of a plug-in.