9#ifndef __AUDACITY_REALTIMEEFFECTLIST_H__
10#define __AUDACITY_REALTIMEEFFECTLIST_H__
45 :
public std::enable_shared_from_this<RealtimeEffectList>
57 using States = std::vector<std::shared_ptr<RealtimeEffectState>>;
72 const std::shared_ptr<RealtimeEffectList> &list);
83 template<
typename StateVisitor>
84 void Visit(
const StateVisitor &func)
86 for (
auto &state : mStates)
87 func(*state, IsActive());
91 template<
typename StateVisitor>
92 void Visit(
const StateVisitor &func)
const
94 for (
const auto &state : mStates)
95 func(*state, IsActive());
104 bool AddState(std::shared_ptr<RealtimeEffectState> pState);
112 bool ReplaceState(
size_t index, std::shared_ptr<RealtimeEffectState> pState);
116 void RemoveState(std::shared_ptr<RealtimeEffectState> pState);
122 std::optional<size_t> FindState(
123 const std::shared_ptr<RealtimeEffectState> &pState)
const;
127 size_t GetStatesCount() const noexcept;
144 void MoveEffect(
size_t fromIndex,
size_t toIndex);
146 static const
std::
string &XMLTag();
159 bool IsActive() const;
162 void SetActive(
bool value);
170 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
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.
template struct REGISTRIES_API Cloneable<>
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