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

Constructor & Destructor Documentation

◆ Iterator() [1/3]

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

Iterates all, even disabled.

Definition at line 1083 of file PluginManager.cpp.

1084: mPm{ manager }
1085, mIterator{ manager.mRegisteredPlugins.begin() }
1086{
1087}
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 1089 of file PluginManager.cpp.

1090: mPm{ manager }
1091, mIterator{ manager.mRegisteredPlugins.begin() }
1092, mPluginType{ type }
1093{
1094 Advance(false);
1095}
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 1097 of file PluginManager.cpp.

1098: mPm{ manager }
1099, mIterator{ manager.mRegisteredPlugins.begin() }
1100, mEffectType{ type }
1101{
1102 Advance(false);
1103}

References Advance().

Here is the call graph for this function:

Member Function Documentation

◆ Advance()

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

Definition at line 1058 of file PluginManager.cpp.

1059{
1060 const auto end = mPm.mRegisteredPlugins.end();
1061 if (incrementing && mIterator != end)
1062 ++mIterator;
1064 for (; mIterator != end; ++mIterator) {
1065 auto &plug = mIterator->second;
1066 if (!all && !(plug.IsValid() && plug.IsEnabled()))
1067 continue;
1068 auto plugType = plug.GetPluginType();
1069 if ((mPluginType == PluginTypeNone || (plugType & mPluginType)) &&
1070 (mEffectType == EffectTypeNone || plug.GetEffectType() == mEffectType)) {
1071 if (!all && (plugType & PluginTypeEffect)) {
1072 // This preference may be written by EffectsPrefs
1073 auto setting = mPm.GetPluginEnabledSetting( plug );
1074 if (!(setting.empty() || gPrefs->Read( setting, true )))
1075 continue;
1076 }
1077 // Pause iteration at this match
1078 break;
1079 }
1080 }
1081}
@ EffectTypeNone
@ PluginTypeNone
@ PluginTypeEffect
FileConfig * gPrefs
Definition: Prefs.cpp:70
RegistryPath GetPluginEnabledSetting(const PluginID &ID) const
PluginMap mRegisteredPlugins
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
Definition: PackedArray.h:159

References EffectTypeNone, PackedArray::end(), PluginManager::GetPluginEnabledSetting(), gPrefs, mEffectType, mIterator, mPluginType, mPm, PluginManager::mRegisteredPlugins, PluginTypeEffect, and PluginTypeNone.

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 135 of file PluginManager.h.

135 {
136 return mIterator != mPm.mRegisteredPlugins.end();
137 }

◆ operator*()

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

Definition at line 139 of file PluginManager.h.

139{ return mIterator->second; }

◆ operator++()

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

Definition at line 1105 of file PluginManager.cpp.

1106{
1107 Advance(true);
1108 return *this;
1109}

Member Data Documentation

◆ mEffectType

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

Definition at line 144 of file PluginManager.h.

Referenced by Advance().

◆ mIterator

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

Definition at line 143 of file PluginManager.h.

Referenced by Advance().

◆ mPluginType

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

Definition at line 145 of file PluginManager.h.

Referenced by Advance().

◆ mPm

const PluginManager& PluginManager::Iterator::mPm
private

Definition at line 142 of file PluginManager.h.

Referenced by Advance().


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