Audacity 3.2.0
Public Member Functions | List of all members
EffectSettingsAccess Class Referenceabstract

#include <EffectInterface.h>

Inheritance diagram for EffectSettingsAccess:
[legend]
Collaboration diagram for EffectSettingsAccess:
[legend]

Public Member Functions

virtual ~EffectSettingsAccess ()
 
virtual const EffectSettingsGet ()=0
 
virtual void Set (EffectSettings &&settings)=0
 
virtual void Flush ()=0
 Make the last Set changes "persistent" in underlying storage. More...
 
virtual bool IsSameAs (const EffectSettingsAccess &other) const =0
 
template<typename Function >
void ModifySettings (Function &&function)
 Do a correct read-modify-write of settings. More...
 

Detailed Description

Interface for accessing an EffectSettings that may change asynchronously in another thread; to be used in the main thread, only.

Updates are communicated atomically both ways. The address of Get() should not be relied on as unchanging between calls.

Definition at line 129 of file EffectInterface.h.

Constructor & Destructor Documentation

◆ ~EffectSettingsAccess()

EffectSettingsAccess::~EffectSettingsAccess ( )
virtualdefault

Member Function Documentation

◆ Flush()

virtual void EffectSettingsAccess::Flush ( )
pure virtual

Make the last Set changes "persistent" in underlying storage.

Implemented in SimpleEffectSettingsAccess, anonymous_namespace{EffectUI.cpp}::EffectSettingsAccessTee, and RealtimeEffectState::Access.

Referenced by VST3UIValidator::OnClose(), LV2Validator::OnIdle(), and VST3UIValidator::UpdateUI().

Here is the caller graph for this function:

◆ Get()

virtual const EffectSettings & EffectSettingsAccess::Get ( )
pure virtual

◆ IsSameAs()

virtual bool EffectSettingsAccess::IsSameAs ( const EffectSettingsAccess other) const
pure virtual
Returns
whether this and the other give access to the same settings

Implemented in SimpleEffectSettingsAccess, anonymous_namespace{EffectUI.cpp}::EffectSettingsAccessTee, and RealtimeEffectState::Access.

◆ ModifySettings()

template<typename Function >
void EffectSettingsAccess::ModifySettings ( Function &&  function)
inline

Do a correct read-modify-write of settings.

Parameters
functiontakes EffectSettings & and its return is ignored. If it throws an exception, then the settings will not be updated. Thus, a strong exception safety guarantee.

Definition at line 149 of file EffectInterface.h.

149 {
150 auto settings = this->Get();
151 std::forward<Function>(function)(settings);
152 this->Set(std::move(settings));
153 }
static Settings & settings()
Definition: TrackInfo.cpp:87
virtual const EffectSettings & Get()=0
virtual void Set(EffectSettings &&settings)=0

References BasicUI::Get(), and settings().

Referenced by LV2Validator::OnChoice(), VST3UIValidator::OnClose(), LV2Validator::OnSlider(), LV2Validator::OnText(), LV2Validator::OnToggle(), LV2Validator::OnTrigger(), EffectBase::Preview(), NyquistEffect::ShowHostInterface(), LV2Validator::suil_port_write(), VST3UIValidator::UpdateUI(), AudioUnitValidator::ValidateUI(), DefaultEffectUIValidator::ValidateUI(), LV2Validator::ValidateUI(), EffectReverb::Validator::ValidateUI(), VST3UIValidator::ValidateUI(), and EffectWahwah::Validator::ValidateUI().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Set()

virtual void EffectSettingsAccess::Set ( EffectSettings &&  settings)
pure virtual

The documentation for this class was generated from the following files: