42#ifndef __AUDACITY_EFFECTINTERFACE_H__
43#define __AUDACITY_EFFECTINTERFACE_H__
80 {
return mDurationFormat; }
82 { mDurationFormat = durationFormat; }
86 void SetDuration(
double value) { mDuration = std::max(0.0, value); }
98 using TypedAny::TypedAny;
108 template<
typename T,
typename... Args>
111 return EffectSettings(std::in_place_type<T>, std::forward<Args>(args)...);
119 const T *pSrc = src.
cast<T>();
120 T *pDst = dst.
cast<T>();
133 virtual std::unique_ptr<EffectOutputs>
Clone()
const = 0;
153 :
public std::enable_shared_from_this<EffectSettingsAccess> {
159 virtual std::unique_ptr<Message>
Clone()
const = 0;
190 std::unique_ptr<Message> pMessage =
nullptr) = 0;
192 virtual void Set(std::unique_ptr<Message> pMessage =
nullptr) = 0;
210 template<
typename Function>
213 auto result = std::forward<Function>(function)(
settings);
214 this->Set(std::move(
settings), std::move(result));
227 std::unique_ptr<Message> pMessage)
override;
228 void Set(std::unique_ptr<Message> pMessage)
override;
229 void Flush()
override;
284 {
return RealtimeSupport() != RealtimeSince::Never; }
290 virtual bool EnablesDebug()
const;
299 virtual bool IsHiddenFromMenus()
const;
303 std::optional<std::unique_ptr<EffectSettingsAccess::Message>>;
346 virtual bool CopySettingsContents(
388 virtual bool VisitSettings(
394 virtual bool VisitSettings(
404 virtual std::unique_ptr<EffectOutputs> MakeOutputs()
const;
450 :
public std::enable_shared_from_this<EffectInstance>
488 virtual bool RealtimeAddProcessor(
496 virtual bool RealtimeSuspend();
502 virtual bool RealtimeResume();
510 virtual std::unique_ptr<Message> MakeMessage()
const;
521 virtual bool UsesMessages() const noexcept;
535 const
float *const *inBuf,
float *const *outBuf,
size_t numSamples);
541 virtual
void RealtimePassThrough(
560 virtual
size_t GetTailSize() const;
572 virtual
bool NeedsDither() const;
587 virtual
bool ProcessFinalize() noexcept = 0;
591 const
float *const *inBlock,
float *const *outBlock,
size_t blockLen)
601 size_t GetBlockSize()
const override;
604 size_t mBlockSize{ 0 };
COMPONENTS_API RegistryPath UserPresetsGroup(const RegistryPath &name)
Compute part of a registry path, given a name which may be empty.
COMPONENTS_API const RegistryPath & CurrentSettingsGroup()
Component of a configuration key path, for last-used destructive settings.
@ ChannelNameLowFrequency2
@ ChannelNameFrontRightCenter
@ ChannelNameFrontLeftCenter
@ ChannelNameTopBackRight
@ ChannelNameTopFrontCenter
@ ChannelNameBottomFrontLeft
@ ChannelNameTopFrontRight
@ ChannelNameTopBackCenter
@ ChannelNameBottomFrontRight
@ ChannelNameLowFrequency1
@ ChannelNameTopFrontLeft
@ ChannelNameBottomFrontCenter
@ ChannelNameTopSideRight
COMPONENTS_API const RegistryPath & FactoryDefaultsGroup()
Component of a configuration key path, for default state of MakeSettings()
std::optional< std::unique_ptr< EffectSettingsAccess::Message > > OptionalMessage
std::vector< RegistryPath > RegistryPaths
static CommandHandlerObject & ident(AudacityProject &project)
static Settings & settings()
Wrapper class for std::any, making type distinctions.
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the SettingsVis...
ComponentInterface provides name / vendor / version functions to identify plugins....
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
EffectDefinitionInterface is a ComponentInterface that adds some basic read-only information about ef...
virtual EffectType GetType() const =0
Type determines how it behaves.
bool SupportsRealtime() const
virtual bool IsDefault() const =0
Whether the effect sorts "above the line" in the menus.
virtual bool IsInteractive() const =0
Whether the effect needs a dialog for entry of settings.
virtual ~EffectDefinitionInterface()
virtual bool SupportsAutomation() const =0
Whether the effect has any automatable controls.
virtual RealtimeSince RealtimeSupport() const =0
Since which version of Audacity has the effect supported realtime?
virtual EffectFamilySymbol GetFamily() const =0
Report identifier and user-visible name of the effect protocol.
RealtimeSince
In which versions of Audacity was an effect realtime capable?
virtual std::shared_ptr< EffectInstance > MakeInstance() const =0
Make an object maintaining short-term state of an Effect.
virtual ~EffectInstanceFactory()
Performs effect computation.
virtual unsigned GetAudioInCount() const =0
How many input buffers to allocate at once.
virtual size_t SetBlockSize(size_t maxBlockSize)=0
virtual unsigned GetAudioOutCount() const =0
How many output buffers to allocate at once.
virtual size_t GetBlockSize() const =0
virtual ~EffectInstance()
Inherit to add a state variable to an EffectInstance subclass.
~EffectInstanceWithBlockSize() override
Hold values to send to effect output meters.
virtual std::unique_ptr< EffectOutputs > Clone() const =0
virtual void Assign(EffectOutputs &&src)=0
Update one Outputs object from another.
Type of messages to send from main thread to processing.
virtual void Merge(Message &&src)=0
Combine one Message object with another, which is then left "empty".
virtual std::unique_ptr< Message > Clone() const =0
virtual void Assign(Message &&src)=0
Update one Message object from another, which is then left "empty".
void ModifySettings(Function &&function)
Do a correct read-modify-write of settings.
virtual const EffectSettings & Get()=0
virtual void Set(EffectSettings &&settings, std::unique_ptr< Message > pMessage=nullptr)=0
virtual void Set(std::unique_ptr< Message > pMessage=nullptr)=0
Message-only overload of Set(). In future, this should be the only one.
virtual void Flush()=0
Make the last Set changes "persistent" in underlying storage.
virtual ~EffectSettingsAccess()
virtual bool IsSameAs(const EffectSettingsAccess &other) const =0
EffectSettingsManager is an EffectDefinitionInterface that adds a factory function for EffectSettings...
virtual OptionalMessage LoadFactoryDefaults(EffectSettings &settings) const =0
virtual ~EffectSettingsManager()
virtual RegistryPaths GetFactoryPresets() const =0
Report names of factory presets.
virtual OptionalMessage LoadUserPreset(const RegistryPath &name, EffectSettings &settings) const =0
virtual bool SaveUserPreset(const RegistryPath &name, const EffectSettings &settings) const =0
Save settings in the configuration file as a user-named preset.
virtual OptionalMessage LoadFactoryPreset(int id, EffectSettings &settings) const =0
virtual bool LoadSettings(const CommandParameters &parms, EffectSettings &settings) const =0
Restore settings from keys and values.
virtual bool SaveSettings(const EffectSettings &settings, CommandParameters &parms) const =0
Store settings as keys and values.
An explicitly nonlocalized string, not meant for the user to see.
Visitor of effect or command parameters. This is a base class with lots of virtual functions that do ...
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Implementation of EffectSettings for cases where there is only one thread.
SimpleEffectSettingsAccess(EffectSettings &settings)
EffectSettings & mSettings
~SimpleEffectSettingsAccess() override
Generates distinct, non-interconvertible types wrapping std::any.
const T * cast() const noexcept
Like pointer-valued any_cast but a non-static member function.
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
constexpr auto sampleRate
void swap(std::unique_ptr< Alg_seq > &a, std::unique_ptr< Alg_seq > &b)
constexpr auto maxBlockSize
TranslatableString Message(unsigned trackCount)
Externalized state of a plug-in.
EffectSettingsExtra extra
static EffectSettings Make(Args &&... args)
Like make_any but a static member function.
static bool Copy(const EffectSettings &src, EffectSettings &dst)
void swap(EffectSettings &other)