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
 
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 125 of file EffectInterface.h.

Constructor & Destructor Documentation

◆ ~EffectSettingsAccess()

EffectSettingsAccess::~EffectSettingsAccess ( )
virtualdefault

Member Function Documentation

◆ Get()

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

◆ 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 139 of file EffectInterface.h.

139 {
140 auto settings = this->Get();
141 std::forward<Function>(function)(settings);
142 this->Set(std::move(settings));
143 }
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 EffectEqualization::PopulateOrExchange(), VST3Effect::PopulateUI(), EffectBase::Preview(), NyquistEffect::ShowHostInterface(), DefaultEffectUIValidator::ValidateUI(), AudioUnitValidator::ValidateUI(), EffectReverb::Validator::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: