Audacity 3.2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PluginManager::Iterator Class Reference

#include <PluginManager.h>

Collaboration diagram for PluginManager::Iterator:
[legend]

Public Member Functions

 Iterator (PluginManager &manager)
 Iterates all, even disabled. More...
 
 Iterator (PluginManager &manager, int pluginType)
 Iterates only enabled and matching plugins, with family enabled too if an effect. More...
 
 Iterator (PluginManager &manager, EffectType type)
 Iterates only enabled and matching effects, with family enabled too. More...
 
bool operator!= (int) const
 
Iteratoroperator++ ()
 
auto & operator* () const
 

Private Member Functions

void Advance (bool incrementing)
 

Private Attributes

const PluginManagermPm
 
PluginMap::iterator mIterator
 
EffectType mEffectType { EffectTypeNone }
 
int mPluginType { PluginTypeNone }
 

Detailed Description

Definition at line 130 of file PluginManager.h.

Constructor & Destructor Documentation

◆ Iterator() [1/3]

PluginManager::Iterator::Iterator ( PluginManager manager)
explicit

Iterates all, even disabled.

Definition at line 1090 of file PluginManager.cpp.

1091: mPm{ manager }
1092, mIterator{ manager.mRegisteredPlugins.begin() }
1093{
1094}
static const AttachedProjectObjects::RegisteredFactory manager
const PluginManager & mPm
PluginMap::iterator mIterator

◆ Iterator() [2/3]

PluginManager::Iterator::Iterator ( PluginManager manager,
int  pluginType 
)

Iterates only enabled and matching plugins, with family enabled too if an effect.

Parameters
pluginTypebitwise or of values in PluginType

Definition at line 1096 of file PluginManager.cpp.

1097: mPm{ manager }
1098, mIterator{ manager.mRegisteredPlugins.begin() }
1099, mPluginType{ type }
1100{
1101 Advance(false);
1102}
void Advance(bool incrementing)

References Advance().

Here is the call graph for this function:

◆ Iterator() [3/3]

PluginManager::Iterator::Iterator ( PluginManager manager,
EffectType  type 
)

Iterates only enabled and matching effects, with family enabled too.

Definition at line 1104 of file PluginManager.cpp.

1105: mPm{ manager }
1106, mIterator{ manager.mRegisteredPlugins.begin() }
1107, mEffectType{ type }
1108{
1109 Advance(false);
1110}

References Advance().

Here is the call graph for this function:

Member Function Documentation

◆ Advance()

void PluginManager::Iterator::Advance ( bool  incrementing)
private

Definition at line 1065 of file PluginManager.cpp.

1066{
1067 const auto end = mPm.mRegisteredPlugins.end();
1068 if (incrementing && mIterator != end)
1069 ++mIterator;
1071 for (; mIterator != end; ++mIterator) {
1072 auto &plug = mIterator->second;
1073 if (!all && !(plug.IsValid() && plug.IsEnabled()))
1074 continue;
1075 auto plugType = plug.GetPluginType();
1076 if ((mPluginType == PluginTypeNone || (plugType & mPluginType)) &&
1077 (mEffectType == EffectTypeNone || plug.GetEffectType() == mEffectType)) {
1078 if (!all && (plugType & PluginTypeEffect)) {
1079 // This preference may be written by EffectsPrefs
1080 auto setting = mPm.GetPluginEnabledSetting( plug );
1081 if (!(setting.empty() || gPrefs->Read( setting, true )))
1082 continue;
1083 }
1084 // Pause iteration at this match
1085 break;
1086 }
1087 }
1088}
@ EffectTypeNone
@ PluginTypeNone
@ PluginTypeEffect
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
RegistryPath GetPluginEnabledSetting(const PluginID &ID) const
PluginMap mRegisteredPlugins
virtual bool Read(const wxString &key, bool *value) const =0
const char * end(const char *str) noexcept
Definition: StringUtils.h:106

References EffectTypeNone, details::end(), PluginManager::GetPluginEnabledSetting(), gPrefs, mEffectType, mIterator, mPluginType, mPm, PluginManager::mRegisteredPlugins, PluginTypeEffect, PluginTypeNone, and audacity::BasicSettings::Read().

Referenced by Iterator().

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

◆ operator!=()

bool PluginManager::Iterator::operator!= ( int  ) const
inline

Definition at line 140 of file PluginManager.h.

140 {
141 return mIterator != mPm.mRegisteredPlugins.end();
142 }

◆ operator*()

auto & PluginManager::Iterator::operator* ( ) const
inline

Definition at line 144 of file PluginManager.h.

144{ return mIterator->second; }

◆ operator++()

auto PluginManager::Iterator::operator++ ( )

Definition at line 1112 of file PluginManager.cpp.

1113{
1114 Advance(true);
1115 return *this;
1116}

Member Data Documentation

◆ mEffectType

EffectType PluginManager::Iterator::mEffectType { EffectTypeNone }
private

Definition at line 149 of file PluginManager.h.

Referenced by Advance().

◆ mIterator

PluginMap::iterator PluginManager::Iterator::mIterator
private

Definition at line 148 of file PluginManager.h.

Referenced by Advance().

◆ mPluginType

int PluginManager::Iterator::mPluginType { PluginTypeNone }
private

Definition at line 150 of file PluginManager.h.

Referenced by Advance().

◆ mPm

const PluginManager& PluginManager::Iterator::mPm
private

Definition at line 147 of file PluginManager.h.

Referenced by Advance().


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