Audacity  3.0.3
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 252 of file PluginManager.h.

Constructor & Destructor Documentation

◆ Iterator() [1/3]

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

Iterates all, even disabled.

Definition at line 1478 of file PluginManager.cpp.

1479 : mPm{ manager }
1480 , mIterator{ manager.mPlugins.begin() }
1481 {
1482 }

◆ 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 1484 of file PluginManager.cpp.

1485 : mPm{ manager }
1486 , mIterator{ manager.mPlugins.begin() }
1487 , mPluginType{ type }
1488 {
1489  Advance(false);
1490 }

◆ Iterator() [3/3]

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

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

Definition at line 1492 of file PluginManager.cpp.

1493 : mPm{ manager }
1494 , mIterator{ manager.mPlugins.begin() }
1495 , mEffectType{ type }
1496 {
1497  Advance(false);
1498 }

Member Function Documentation

◆ Advance()

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

Definition at line 1453 of file PluginManager.cpp.

1454 {
1455  const auto end = mPm.mPlugins.end();
1456  if (incrementing && mIterator != end)
1457  ++mIterator;
1459  for (; mIterator != end; ++mIterator) {
1460  auto &plug = mIterator->second;
1461  if (!all && !(plug.IsValid() && plug.IsEnabled()))
1462  continue;
1463  auto plugType = plug.GetPluginType();
1464  if ((mPluginType == PluginTypeNone || (plugType & mPluginType)) &&
1465  (mEffectType == EffectTypeNone || plug.GetEffectType() == mEffectType)) {
1466  if (!all && (plugType & PluginTypeEffect)) {
1467  // This preference may be written by EffectsPrefs
1468  auto setting = mPm.GetPluginEnabledSetting( plug );
1469  if (!(setting.empty() || gPrefs->Read( setting, true )))
1470  continue;
1471  }
1472  // Pause iteration at this match
1473  break;
1474  }
1475  }
1476 }

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

Here is the call graph for this function:

◆ operator!=()

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

Definition at line 262 of file PluginManager.h.

262  {
263  return mIterator != mPm.mPlugins.end();
264  }

◆ operator*()

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

Definition at line 266 of file PluginManager.h.

266 { return mIterator->second; }

◆ operator++()

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

Definition at line 1500 of file PluginManager.cpp.

1501 {
1502  Advance(true);
1503  return *this;
1504 }

Member Data Documentation

◆ mEffectType

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

Definition at line 271 of file PluginManager.h.

Referenced by Advance().

◆ mIterator

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

Definition at line 270 of file PluginManager.h.

Referenced by Advance().

◆ mPluginType

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

Definition at line 272 of file PluginManager.h.

Referenced by Advance().

◆ mPm

const PluginManager& PluginManager::Iterator::mPm
private

Definition at line 269 of file PluginManager.h.

Referenced by Advance().


The documentation for this class was generated from the following files:
PluginTypeEffect
@ PluginTypeEffect
Definition: PluginManager.h:35
PluginManager::Iterator::mPluginType
int mPluginType
Definition: PluginManager.h:272
PluginManager::mPlugins
PluginMap mPlugins
Definition: PluginManager.h:354
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
EffectTypeNone
@ EffectTypeNone
Definition: EffectInterface.h:56
PluginManager::Iterator::mPm
const PluginManager & mPm
Definition: PluginManager.h:269
PluginManager::Iterator::mEffectType
EffectType mEffectType
Definition: PluginManager.h:271
PluginManager::Iterator::mIterator
PluginMap::iterator mIterator
Definition: PluginManager.h:270
PluginTypeNone
@ PluginTypeNone
Definition: PluginManager.h:33
PluginManager::GetPluginEnabledSetting
RegistryPath GetPluginEnabledSetting(const PluginID &ID) const
Definition: PluginManager.cpp:352
PluginManager::Iterator::Advance
void Advance(bool incrementing)
Definition: PluginManager.cpp:1453