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#ifndef __AUDACITY_EFFECTPLUGIN_H__
12#define __AUDACITY_EFFECTPLUGIN_H__
13
14#include "EffectInterface.h"
15
16#include <functional>
17#include <memory>
18
20
21struct EffectSettings;
23class EffectPlugin;
24
25class TrackList;
29
30/***************************************************************************/
34class EFFECTS_API EffectPlugin
36{
37public:
38 using EffectSettingsAccessPtr = std::shared_ptr<EffectSettingsAccess>;
39
40 const static wxString kUserPresetIdent;
41 const static wxString kFactoryPresetIdent;
42 const static wxString kCurrentSettingsIdent;
43 const static wxString kFactoryDefaultsIdent;
44
46 virtual ~EffectPlugin();
47
50 virtual bool HasOptions() const = 0;
51
53 virtual bool CanExportPresets() const = 0;
54
55 virtual const EffectSettingsManager& GetDefinition() const = 0;
56
58 const EffectSettings &settings, wxString & parms) const = 0;
59 // @return nullptr for failure
61 const wxString & parms, EffectSettings &settings) const = 0;
62 virtual bool IsBatchProcessing() const = 0;
63 virtual void SetBatchProcessing() = 0;
64 virtual void UnsetBatchProcessing() = 0;
65
66 using InstancePointer = std::shared_ptr<EffectInstanceEx>;
70 using InstanceFinder = std::function<
71 std::optional<InstancePointer>(EffectSettings &settings)
72 >;
73
81 virtual bool DoEffect(
84 double projectRate, TrackList *list,
86 unsigned flags,
87 const EffectSettingsAccessPtr &pAccess = nullptr
89 ) = 0;
90};
91
92/***************************************************************************/
96class EFFECTS_API EffectInstanceEx : public virtual EffectInstance {
97public:
99
103 virtual bool Init();
104
106
109 virtual bool Process(EffectSettings &settings) = 0;
110
112};
113#endif
static RegisteredToolbarFactory factory
std::optional< std::unique_ptr< EffectSettingsAccess::Message > > OptionalMessage
static Settings & settings()
Definition: TrackInfo.cpp:51
Performs effect computation.
Definition: EffectPlugin.h:96
~EffectInstanceEx() override
virtual bool Process(EffectSettings &settings)=0
Actually do the effect here.
Performs effect computation.
Factory of instances of an effect.
Definition: EffectPlugin.h:36
static const wxString kUserPresetIdent
Definition: EffectPlugin.h:40
virtual bool HasOptions() const =0
virtual void SetBatchProcessing()=0
std::shared_ptr< EffectInstanceEx > InstancePointer
Definition: EffectPlugin.h:66
virtual bool DoEffect(EffectSettings &settings, const InstanceFinder &finder, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, const EffectSettingsAccessPtr &pAccess=nullptr)=0
std::function< std::optional< InstancePointer >(EffectSettings &settings) > InstanceFinder
Definition: EffectPlugin.h:72
virtual bool CanExportPresets() const =0
Whether the effect supports export of presets to files, and importing too.
virtual ~EffectPlugin()
std::shared_ptr< EffectSettingsAccess > EffectSettingsAccessPtr
Definition: EffectPlugin.h:38
static const wxString kFactoryPresetIdent
Definition: EffectPlugin.h:41
virtual void UnsetBatchProcessing()=0
virtual bool SaveSettingsAsString(const EffectSettings &settings, wxString &parms) const =0
virtual const EffectSettingsManager & GetDefinition() const =0
virtual bool IsBatchProcessing() const =0
virtual OptionalMessage LoadSettingsFromString(const wxString &parms, EffectSettings &settings) const =0
static const wxString kCurrentSettingsIdent
Definition: EffectPlugin.h:42
static const wxString kFactoryDefaultsIdent
Definition: EffectPlugin.h:43
EffectPlugin & operator=(EffectPlugin &)=delete
EffectSettingsManager is an EffectDefinitionInterface that adds a factory function for EffectSettings...
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Definition: Track.h:850
Used to create or clone a WaveTrack, with appropriate context from the project that will own the trac...
Definition: WaveTrack.h:871
Externalized state of a plug-in.