Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
SimpleEffectSettingsAccess Class Referencefinal

Implementation of EffectSettings for cases where there is only one thread. More...

#include <EffectInterface.h>

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

Public Member Functions

 SimpleEffectSettingsAccess (EffectSettings &settings)
 
 ~SimpleEffectSettingsAccess () override
 
const EffectSettingsGet () override
 
void Set (EffectSettings &&settings, std::unique_ptr< Message > pMessage) override
 
void Set (std::unique_ptr< Message > pMessage) override
 Message-only overload of Set(). In future, this should be the only one. More...
 
void Flush () override
 Make the last Set changes "persistent" in underlying storage. More...
 
bool IsSameAs (const EffectSettingsAccess &other) const override
 
- Public Member Functions inherited from EffectSettingsAccess
virtual ~EffectSettingsAccess ()
 
virtual const EffectSettingsGet ()=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. More...
 
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...
 

Private Attributes

EffectSettingsmSettings
 

Detailed Description

Implementation of EffectSettings for cases where there is only one thread.

Definition at line 219 of file EffectInterface.h.

Constructor & Destructor Documentation

◆ SimpleEffectSettingsAccess()

SimpleEffectSettingsAccess::SimpleEffectSettingsAccess ( EffectSettings settings)
inlineexplicit

Definition at line 222 of file EffectInterface.h.

223 : mSettings{settings} {}
static Settings & settings()
Definition: TrackInfo.cpp:51

◆ ~SimpleEffectSettingsAccess()

SimpleEffectSettingsAccess::~SimpleEffectSettingsAccess ( )
overridedefault

Member Function Documentation

◆ Flush()

void SimpleEffectSettingsAccess::Flush ( )
overridevirtual

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

Precondition
called on the main thread only

Implements EffectSettingsAccess.

Definition at line 40 of file EffectInterface.cpp.

41{
42}

◆ Get()

const EffectSettings & SimpleEffectSettingsAccess::Get ( )
overridevirtual

Implements EffectSettingsAccess.

Definition at line 25 of file EffectInterface.cpp.

26{
27 return mSettings;
28}

References mSettings.

◆ IsSameAs()

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

Implements EffectSettingsAccess.

Definition at line 44 of file EffectInterface.cpp.

46{
47 if (auto pOther =
48 dynamic_cast<const SimpleEffectSettingsAccess*>(&other))
49 return &this->mSettings == &pOther->mSettings;
50 return false;
51}
Implementation of EffectSettings for cases where there is only one thread.

References mSettings.

◆ Set() [1/2]

void SimpleEffectSettingsAccess::Set ( EffectSettings &&  settings,
std::unique_ptr< Message pMessage 
)
overridevirtual

Implements EffectSettingsAccess.

Definition at line 30 of file EffectInterface.cpp.

32{
33 mSettings = std::move(settings);
34}

References mSettings, and settings().

Here is the call graph for this function:

◆ Set() [2/2]

void SimpleEffectSettingsAccess::Set ( std::unique_ptr< Message pMessage)
overridevirtual

Message-only overload of Set(). In future, this should be the only one.

Implements EffectSettingsAccess.

Definition at line 36 of file EffectInterface.cpp.

37{
38}

Member Data Documentation

◆ mSettings

EffectSettings& SimpleEffectSettingsAccess::mSettings
private

Definition at line 232 of file EffectInterface.h.

Referenced by Get(), IsSameAs(), and Set().


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