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

Constructor & Destructor Documentation

◆ Iterator() [1/3]

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

Iterates all, even disabled.

Definition at line 1076 of file PluginManager.cpp.

1077: mPm{ manager }
1078, mIterator{ manager.mRegisteredPlugins.begin() }
1079{
1080}
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 1082 of file PluginManager.cpp.

1083: mPm{ manager }
1084, mIterator{ manager.mRegisteredPlugins.begin() }
1085, mPluginType{ type }
1086{
1087 Advance(false);
1088}
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 1090 of file PluginManager.cpp.

1091: mPm{ manager }
1092, mIterator{ manager.mRegisteredPlugins.begin() }
1093, mEffectType{ type }
1094{
1095 Advance(false);
1096}

References Advance().

Here is the call graph for this function:

Member Function Documentation

◆ Advance()

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

Definition at line 1051 of file PluginManager.cpp.

1052{
1053 const auto end = mPm.mRegisteredPlugins.end();
1054 if (incrementing && mIterator != end)
1055 ++mIterator;
1057 for (; mIterator != end; ++mIterator) {
1058 auto &plug = mIterator->second;
1059 if (!all && !(plug.IsValid() && plug.IsEnabled()))
1060 continue;
1061 auto plugType = plug.GetPluginType();
1062 if ((mPluginType == PluginTypeNone || (plugType & mPluginType)) &&
1063 (mEffectType == EffectTypeNone || plug.GetEffectType() == mEffectType)) {
1064 if (!all && (plugType & PluginTypeEffect)) {
1065 // This preference may be written by EffectsPrefs
1066 auto setting = mPm.GetPluginEnabledSetting( plug );
1067 if (!(setting.empty() || gPrefs->Read( setting, true )))
1068 continue;
1069 }
1070 // Pause iteration at this match
1071 break;
1072 }
1073 }
1074}
@ 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 130 of file PluginManager.h.

130 {
131 return mIterator != mPm.mRegisteredPlugins.end();
132 }

◆ operator*()

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

Definition at line 134 of file PluginManager.h.

134{ return mIterator->second; }

◆ operator++()

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

Definition at line 1098 of file PluginManager.cpp.

1099{
1100 Advance(true);
1101 return *this;
1102}

Member Data Documentation

◆ mEffectType

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

Definition at line 139 of file PluginManager.h.

Referenced by Advance().

◆ mIterator

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

Definition at line 138 of file PluginManager.h.

Referenced by Advance().

◆ mPluginType

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

Definition at line 140 of file PluginManager.h.

Referenced by Advance().

◆ mPm

const PluginManager& PluginManager::Iterator::mPm
private

Definition at line 137 of file PluginManager.h.

Referenced by Advance().


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