9#ifndef __AUDACITY_REALTIMEEFFECTLIST_H__
10#define __AUDACITY_REALTIMEEFFECTLIST_H__
47 :
public std::enable_shared_from_this<RealtimeEffectList>
59 using States = std::vector<std::shared_ptr<RealtimeEffectState>>;
68 std::unique_ptr<ClientData::Cloneable<>>
Clone()
const override;
74 const std::shared_ptr<RealtimeEffectList> &list);
85 template<
typename StateVisitor>
86 void Visit(
const StateVisitor &func)
88 for (
auto &state : mStates)
89 func(*state, IsActive());
93 template<
typename StateVisitor>
94 void Visit(
const StateVisitor &func)
const
96 for (
const auto &state : mStates)
97 func(*state, IsActive());
106 bool AddState(std::shared_ptr<RealtimeEffectState> pState);
114 bool ReplaceState(
size_t index, std::shared_ptr<RealtimeEffectState> pState);
118 void RemoveState(std::shared_ptr<RealtimeEffectState> pState);
124 std::optional<size_t> FindState(
125 const std::shared_ptr<RealtimeEffectState> &pState)
const;
129 size_t GetStatesCount() const noexcept;
146 void MoveEffect(
size_t fromIndex,
size_t toIndex);
148 static const
std::
string &XMLTag();
161 bool IsActive() const;
164 void SetActive(
bool value);
172 std::atomic<
bool> mActive{
true };
Generalized interface for discovery of plug-ins for one protocol.
std::vector< Attribute > AttributesList
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
An object that sends messages to an open-ended list of subscribed callbacks.
void Visit(const StateVisitor &func)
Apply the function to all states sequentially.
RealtimeEffectList(const RealtimeEffectList &)=delete
std::lock_guard< Lock > LockGuard
std::vector< std::shared_ptr< RealtimeEffectState > > States
void Visit(const StateVisitor &func) const
Apply the function to all states sequentially.
RealtimeEffectList & operator=(const RealtimeEffectList &)=delete
Abstract base class for an object holding data associated with points on a time axis.
Base class for extra information attached to undo/redo states.
This class is an interface which should be implemented by classes which wish to be able to load and s...
Base class for XMLFileWriter and XMLStringWriter that provides the general functionality for creating...
Intended for locking of resources that are only lightly contended and locked for very short times,...
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
A convenient default parameter for class template Site.
A convenient base class defining abstract virtual Clone() for a given kind of pointer.
virtual PointerType Clone() const =0
std::shared_ptr< RealtimeEffectState > affectedState