| 1056 | } |
| 1057 | |
| 1058 | void PluginManager::Iterator::Advance(bool incrementing) |
| 1059 | { |
| 1060 | const auto end = mPm.mRegisteredPlugins.end(); |
| 1061 | if (incrementing && mIterator != end) |
| 1062 | ++mIterator; |
| 1063 | bool all = mPluginType == PluginTypeNone && mEffectType == EffectTypeNone; |
| 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 | (mFilter == nullptr || mFilter(plug))) { |
| 1072 | if (!all && (plugType & PluginTypeEffect)) { |
| 1073 | // This preference may be written by EffectsPrefs |
| 1074 | auto setting = mPm.GetPluginEnabledSetting( plug ); |
| 1075 | if (!(setting.empty() || gPrefs->Read( setting, true ))) |
| 1076 | continue; |
| 1077 | } |
| 1078 | // Pause iteration at this match |
| 1079 | break; |
| 1080 | } |
| 1081 | } |
| 1082 | } |
| 1083 | |
| 1084 | PluginManager::Iterator::Iterator(PluginManager &manager) |
| 1085 | : mPm{ manager } |
no test coverage detected