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

Constructor & Destructor Documentation

◆ Iterator() [1/3]

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

Iterates all, even disabled.

Definition at line 1069 of file PluginManager.cpp.

1070: mPm{ manager }
1071, mIterator{ manager.mRegisteredPlugins.begin() }
1072{
1073}
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 1075 of file PluginManager.cpp.

1076: mPm{ manager }
1077, mIterator{ manager.mRegisteredPlugins.begin() }
1078, mPluginType{ type }
1079{
1080 Advance(false);
1081}
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 1083 of file PluginManager.cpp.

1084: mPm{ manager }
1085, mIterator{ manager.mRegisteredPlugins.begin() }
1086, mEffectType{ type }
1087{
1088 Advance(false);
1089}

References Advance().

Here is the call graph for this function:

Member Function Documentation

◆ Advance()

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

Definition at line 1044 of file PluginManager.cpp.

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

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

◆ operator*()

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

Definition at line 143 of file PluginManager.h.

143{ return mIterator->second; }

◆ operator++()

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

Definition at line 1091 of file PluginManager.cpp.

1092{
1093 Advance(true);
1094 return *this;
1095}

Member Data Documentation

◆ mEffectType

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

Definition at line 148 of file PluginManager.h.

Referenced by Advance().

◆ mIterator

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

Definition at line 147 of file PluginManager.h.

Referenced by Advance().

◆ mPluginType

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

Definition at line 149 of file PluginManager.h.

Referenced by Advance().

◆ mPm

const PluginManager& PluginManager::Iterator::mPm
private

Definition at line 146 of file PluginManager.h.

Referenced by Advance().


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