Skip to content

RIP pluginregistry.cfg - #10597

Merged
saintmatthieu merged 50 commits into
audacity:masterfrom
saintmatthieu:10593-no-more-pluginregistry.cfg
Apr 15, 2026
Merged

saintmatthieu merged 50 commits into
audacity:masterfrom
saintmatthieu:10593-no-more-pluginregistry.cfg

Conversation

@saintmatthieu

@saintmatthieu saintmatthieu commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

Resolves: #10593

With these changes, the pluginregistry.cfg doesn't get created or updated anymore. All effect info lands in known_audio_plugins.json. Au4 EffectMeta structs can be entirely constructed from entries in known_audio_plugins.json, and new fields were added that were present in pluginregistry.cfg. This will ease the enabling/disabling of effects and thereby the implementation of the plugin manager in AU4.

Steps:

  1. A BuiltinEffect entry is added in the framework's AudioResourceType
  2. The attributes member of framework's AudioResourceMeta is used to record properties of AU3 PluginDescriptor that are needed by PluginManager (e.g. EFFECT_TITLE_ATTRIBUTE in effectstypes.h)
  3. Helpers are added
  • to au3effectsutils.h to convert between PluginDescriptor and EffectMeta when effects are first discovered by the various AU3 effect modules or when the PluginManager wants to read or write its mRegisteredPlugins from or to disc,
  • to effectsutils.h to convert between AU4 EffectMeta and framework AudioResourceMeta
  1. EffectsRepositoryHelper, AbstractAudioPluginMetaReader, NyquistEffectsRepository, NyquistPluginsMetaReader, BuiltinEffectsLoader and BuiltinEffectsLoader are drastically simplified because they now use these helpers
  2. StartupScenario registers directly effects of type AudioResourceType::NyquistPlugin and AudioResourceType::BuiltinEffect (not with the out-of-process scanning)
  3. AbstractAudioPluginMetaReader is renamed Au3AudioPluginMetaReader
  4. Au3AudioPluginScanner is introduced and reused by all effect families except built-ins, cleaning up and reducing the amount of code duplication some more
  5. BuiltinEffectsScanner and a BuiltinEffectsMetaReader are introduced, and now built-in effects are also recorded in known_audio_plugins.json
  6. now that all effect families are in known_audio_plugins.json, EffectsProvider::reloadEffects() can be simplified and read everything from the framework's IKnownAudioPluginsRegister 🎉
  7. introduce IEffectLoader and IEffectLoadersRegister, for use by EffectsProvider, and break the circular dependencies we had between effects_base and the vst, lv2 and audio-units effect repositories (that are now renamed "loaders") 🎉
  8. go-to-eleven: introduce IPluginRegistry in AU3 for the PluginManager to read and write plugin states to and from disk - the implementation is in AU4 and interacts with the IKnownAudioPluginsRegister. RIP pluginregistry.cfg.
  • I signed CLA
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

  • Each commit compiles and runs on my machine without known undesirable changes of behavior

QA:

  • Nyquist prompt still available and functional
  • All third-party effects (AU, LV2, etc) as well as Nyquist work one multiple-clip selection. Some built-in effects (like Limiter) too, and others (like Amplify) don't.
  • If a nyquist plugin has several installations, it is grouped properly in the effects menu
  • Autobot test cases have been run

@saintmatthieu saintmatthieu self-assigned this Mar 25, 2026
@saintmatthieu
saintmatthieu force-pushed the 10593-no-more-pluginregistry.cfg branch 2 times, most recently from 8d0b30d to 878be8b Compare March 26, 2026 15:07
@saintmatthieu
saintmatthieu marked this pull request as ready for review March 26, 2026 15:15
@saintmatthieu saintmatthieu changed the title 10593 no more pluginregistry.cfg RIP pluginregistry.cfg Mar 26, 2026
@saintmatthieu
saintmatthieu force-pushed the 10593-no-more-pluginregistry.cfg branch from 878be8b to c0bdd1a Compare March 27, 2026 13:17
@saintmatthieu

Copy link
Copy Markdown
Contributor Author

@coderabbitai

@coderabbitai

coderabbitai Bot commented Mar 30, 2026

Copy link
Copy Markdown

@saintmatthieu Sure! I'll review the changes in this PR right away.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Mar 30, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 194 files, which is 44 over the limit of 150.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 35833298-cd33-4205-92a6-601eb98c18dc

📥 Commits

Reviewing files that changed from the base of the PR and between 89458bc8221abcc1d911fb872c850f38be6a74be and 61e3224.

📒 Files selected for processing (194)
  • au3/libraries/au3-audio-unit/AudioUnitEffectBase.cpp
  • au3/libraries/au3-audio-unit/AudioUnitEffectBase.h
  • au3/libraries/au3-builtin-effects/ChangePitchBase.h
  • au3/libraries/au3-builtin-effects/ChangeTempoBase.cpp
  • au3/libraries/au3-builtin-effects/ChangeTempoBase.h
  • au3/libraries/au3-builtin-effects/EqualizationBase.h
  • au3/libraries/au3-builtin-effects/Generator.h
  • au3/libraries/au3-builtin-effects/SBSMSBase.h
  • au3/libraries/au3-builtin-effects/ToneGenBase.h
  • au3/libraries/au3-builtin-effects/TruncSilenceBase.h
  • au3/libraries/au3-components/EffectInterface.h
  • au3/libraries/au3-effects/EffectBase.h
  • au3/libraries/au3-effects/EffectManager.cpp
  • au3/libraries/au3-effects/EffectManager.h
  • au3/libraries/au3-effects/LoadEffects.cpp
  • au3/libraries/au3-exceptions/AudacityException.h
  • au3/libraries/au3-files/FileException.h
  • au3/libraries/au3-lv2/LV2EffectBase.cpp
  • au3/libraries/au3-lv2/LV2EffectBase.h
  • au3/libraries/au3-lv2/LoadLV2.cpp
  • au3/libraries/au3-module-manager/CMakeLists.txt
  • au3/libraries/au3-module-manager/IPluginRegistry.h
  • au3/libraries/au3-module-manager/PluginDescriptor.cpp
  • au3/libraries/au3-module-manager/PluginDescriptor.h
  • au3/libraries/au3-module-manager/PluginInterface.cpp
  • au3/libraries/au3-module-manager/PluginInterface.h
  • au3/libraries/au3-module-manager/PluginManager.cpp
  • au3/libraries/au3-module-manager/PluginManager.h
  • au3/libraries/au3-nyquist-effects/NyquistBase.cpp
  • au3/libraries/au3-nyquist-effects/NyquistBase.h
  • au3/libraries/au3-vst3/VST3EffectBase.cpp
  • au3/libraries/au3-vst3/VST3EffectBase.h
  • au3/libraries/au3-xml/XMLWriter.h
  • muse_framework
  • src/appshell/internal/startupscenario.cpp
  • src/appshell/internal/startupscenario.h
  • src/appshell/qml/Audacity/AppShell/appmenumodel.h
  • src/effects/audio_unit/CMakeLists.txt
  • src/effects/audio_unit/audiouniteffectsmodule.cpp
  • src/effects/audio_unit/audiouniteffectsmodule.h
  • src/effects/audio_unit/iaudiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiouniteffectloader.h
  • src/effects/audio_unit/internal/audiouniteffectsrepository.cpp
  • src/effects/audio_unit/internal/audiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiounitpluginsmetareader.cpp
  • src/effects/audio_unit/internal/audiounitpluginsmetareader.h
  • src/effects/audio_unit/internal/audiounitpluginsscanner.cpp
  • src/effects/audio_unit/internal/audiounitpluginsscanner.h
  • src/effects/audio_unit/view/audiounitview.h
  • src/effects/audio_unit/view/audiounitviewmodel.cpp
  • src/effects/audio_unit/view/audiounitviewmodel.h
  • src/effects/builtin/CMakeLists.txt
  • src/effects/builtin/builtineffectsmodule.cpp
  • src/effects/builtin/builtineffectsmodule.h
  • src/effects/builtin/ibuiltineffectsrepository.h
  • src/effects/builtin/internal/builtineffectsloader.h
  • src/effects/builtin/internal/builtineffectsmetareader.cpp
  • src/effects/builtin/internal/builtineffectsmetareader.h
  • src/effects/builtin/internal/builtineffectsrepository.cpp
  • src/effects/builtin/internal/builtineffectsrepository.h
  • src/effects/builtin/internal/builtineffectsscanner.h
  • src/effects/builtin/view/builtineffectmodel.cpp
  • src/effects/builtin/view/builtineffectmodel.h
  • src/effects/builtin/view/builtineffectviewloader.cpp
  • src/effects/builtin/view/builtineffectviewloader.h
  • src/effects/builtin_collection/CMakeLists.txt
  • src/effects/builtin_collection/amplify/amplifyeffect.h
  • src/effects/builtin_collection/builtineffectscollectionmodule.cpp
  • src/effects/builtin_collection/builtineffectscollectionmodule.h
  • src/effects/builtin_collection/clickremoval/clickremovaleffect.h
  • src/effects/builtin_collection/dtmfgen/dtmfgenerator.h
  • src/effects/builtin_collection/dynamics/compressor/compressoreffect.h
  • src/effects/builtin_collection/dynamics/limiter/limitereffect.h
  • src/effects/builtin_collection/dynamics/timeline/abstractdynamicseffectinstancemodel.h
  • src/effects/builtin_collection/fade/fadeeffect.h
  • src/effects/builtin_collection/internal/builtincollectionloader.cpp
  • src/effects/builtin_collection/internal/builtincollectionloader.h
  • src/effects/builtin_collection/internal/builtineffectsloader.cpp
  • src/effects/builtin_collection/internal/builtineffectsloader.h
  • src/effects/builtin_collection/invert/inverteffect.h
  • src/effects/builtin_collection/loudness/normalizeloudnesseffect.h
  • src/effects/builtin_collection/noisegen/noisegenerator.h
  • src/effects/builtin_collection/noisereduction/noisereductioneffect.h
  • src/effects/builtin_collection/normalize/normalizeeffect.h
  • src/effects/builtin_collection/removedcoffset/removedcoffseteffect.h
  • src/effects/builtin_collection/repair/repaireffect.h
  • src/effects/builtin_collection/reverb/reverbeffect.h
  • src/effects/builtin_collection/reverse/reverseeffect.h
  • src/effects/effects_base/CMakeLists.txt
  • src/effects/effects_base/effectsmodule.cpp
  • src/effects/effects_base/effectsmodule.h
  • src/effects/effects_base/effectstypes.h
  • src/effects/effects_base/ieffectexecutionscenario.h
  • src/effects/effects_base/ieffectinstancesregister.h
  • src/effects/effects_base/ieffectloader.h
  • src/effects/effects_base/ieffectloadersregister.h
  • src/effects/effects_base/ieffectsprovider.h
  • src/effects/effects_base/ieffectsproviderinitializer.h
  • src/effects/effects_base/ieffectviewcontroller.h
  • src/effects/effects_base/ieffectviewlaunchregister.h
  • src/effects/effects_base/internal/abstractaudiopluginmetareader.cpp
  • src/effects/effects_base/internal/abstractviewlauncher.h
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.cpp
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.h
  • src/effects/effects_base/internal/au3/au3audiopluginscanner.cpp
  • src/effects/effects_base/internal/au3/au3audiopluginscanner.h
  • src/effects/effects_base/internal/au3/au3effectsutils.cpp
  • src/effects/effects_base/internal/au3/au3effectsutils.h
  • src/effects/effects_base/internal/au3effectloader.cpp
  • src/effects/effects_base/internal/au3effectloader.h
  • src/effects/effects_base/internal/effectexecutionscenario.cpp
  • src/effects/effects_base/internal/effectexecutionscenario.h
  • src/effects/effects_base/internal/effectinstancesregister.h
  • src/effects/effects_base/internal/effectloadersregister.cpp
  • src/effects/effects_base/internal/effectloadersregister.h
  • src/effects/effects_base/internal/effectparametersprovider.h
  • src/effects/effects_base/internal/effectpresetsprovider.cpp
  • src/effects/effects_base/internal/effectpresetsprovider.h
  • src/effects/effects_base/internal/effectpresetsscenario.h
  • src/effects/effects_base/internal/effectsactionscontroller.h
  • src/effects/effects_base/internal/effectsmenuprovider.h
  • src/effects/effects_base/internal/effectsprovider.cpp
  • src/effects/effects_base/internal/effectsprovider.h
  • src/effects/effects_base/internal/effectsproviderinitializer.cpp
  • src/effects/effects_base/internal/effectsproviderinitializer.h
  • src/effects/effects_base/internal/effectsrepositoryhelper.cpp
  • src/effects/effects_base/internal/effectsrepositoryhelper.h
  • src/effects/effects_base/internal/effectsuiactions.h
  • src/effects/effects_base/internal/effectsutils.cpp
  • src/effects/effects_base/internal/effectsutils.h
  • src/effects/effects_base/internal/effectviewcontroller.cpp
  • src/effects/effects_base/internal/effectviewcontroller.h
  • src/effects/effects_base/internal/effectviewlaunchregister.cpp
  • src/effects/effects_base/internal/effectviewlaunchregister.h
  • src/effects/effects_base/internal/realtimeeffectservice.cpp
  • src/effects/effects_base/internal/realtimeeffectservice.h
  • src/effects/effects_base/iparameterextractorregistry.h
  • src/effects/effects_base/view/abstracteffectviewmodel.h
  • src/effects/effects_base/view/destructiveeffectviewerdialogmodel.h
  • src/effects/effects_base/view/effectparameterslistmodel.h
  • src/effects/effects_base/view/effectpresetsbarmodel.h
  • src/effects/effects_base/view/effectsavecontextmenu.h
  • src/effects/effects_base/view/generatedeffectviewermodel.cpp
  • src/effects/effects_base/view/generatedeffectviewermodel.h
  • src/effects/effects_base/view/presetscontextmenumodel.h
  • src/effects/effects_base/view/realtimeeffectviewerdialogmodel.cpp
  • src/effects/effects_base/view/realtimeeffectviewerdialogmodel.h
  • src/effects/lv2/CMakeLists.txt
  • src/effects/lv2/ilv2effectsrepository.h
  • src/effects/lv2/internal/lv2effectloader.h
  • src/effects/lv2/internal/lv2effectsrepository.cpp
  • src/effects/lv2/internal/lv2effectsrepository.h
  • src/effects/lv2/internal/lv2pluginmetareader.cpp
  • src/effects/lv2/internal/lv2pluginmetareader.h
  • src/effects/lv2/internal/lv2pluginsscanner.cpp
  • src/effects/lv2/internal/lv2pluginsscanner.h
  • src/effects/lv2/lv2effectsmodule.cpp
  • src/effects/lv2/lv2effectsmodule.h
  • src/effects/lv2/view/lv2viewmodel.cpp
  • src/effects/lv2/view/lv2viewmodel.h
  • src/effects/nyquist/CMakeLists.txt
  • src/effects/nyquist/internal/nyquisteffectsloader.h
  • src/effects/nyquist/internal/nyquisteffectsrepository.cpp
  • src/effects/nyquist/internal/nyquisteffectsrepository.h
  • src/effects/nyquist/internal/nyquistpluginsmetareader.cpp
  • src/effects/nyquist/internal/nyquistpluginsmetareader.h
  • src/effects/nyquist/internal/nyquistpluginsscanner.cpp
  • src/effects/nyquist/internal/nyquistpluginsscanner.h
  • src/effects/nyquist/inyquisteffectsrepository.h
  • src/effects/nyquist/nyquisteffectsmodule.cpp
  • src/effects/nyquist/nyquisteffectsmodule.h
  • src/effects/nyquist/nyquistprompt/nyquistprompteffect.cpp
  • src/effects/nyquist/nyquistprompt/nyquistpromptloader.cpp
  • src/effects/nyquist/nyquistprompt/nyquistpromptloader.h
  • src/effects/vst/CMakeLists.txt
  • src/effects/vst/internal/musevstmodulesrepository.cpp
  • src/effects/vst/internal/musevstmodulesrepository.h
  • src/effects/vst/internal/vst3effectloader.h
  • src/effects/vst/internal/vst3pluginsmetareader.cpp
  • src/effects/vst/internal/vst3pluginsmetareader.h
  • src/effects/vst/internal/vst3pluginsscanner.cpp
  • src/effects/vst/internal/vst3pluginsscanner.h
  • src/effects/vst/internal/vsteffectsrepository.cpp
  • src/effects/vst/internal/vsteffectsrepository.h
  • src/effects/vst/ivsteffectsrepository.h
  • src/effects/vst/view/vstviewmodel.cpp
  • src/effects/vst/view/vstviewmodel.h
  • src/effects/vst/vsteffectsmodule.cpp
  • src/effects/vst/vsteffectsmodule.h
  • src/projectscene/view/trackspanel/addeffectmenumodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmenumodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmodel.h
  • src/projectscene/view/trackspanel/realtimeeffectmenumodelbase.h

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR refactors the effects system architecture to unify plugin discovery, registration, and metadata handling across different effect families (built-in, VST, LV2, Nyquist, Audio Unit). Key changes include: (1) introducing IPluginRegistry abstraction with Au3PluginRegistry implementation to consolidate plugin state persistence, (2) renaming and refactoring metadata readers from AbstractAudioPluginMetaReader to Au3AudioPluginMetaReader, (3) consolidating plugin scanners through Au3AudioPluginScanner base class, (4) introducing IEffectLoader interface to abstract plugin loading per effect family, (5) moving plugin discovery and initialization logic to EffectsProviderInitializer and EffectsProvider.initOnce(), (6) introducing IEffectViewController to separate effect UI control from the provider, (7) removing repository-based effect metadata patterns, (8) refactoring dependency injection throughout to use global injection instead of context-bound injection, and (9) adding SupportsMultipleClipSelection() capability to all effect definitions.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

Suggested reviewers

  • kryksyh

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 15

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
au3/libraries/au3-effects/LoadEffects.cpp (1)

147-157: ⚠️ Potential issue | 🟠 Major

Excluded plugins may remain enabled after being registered if the exclusion flag changes in subsequent versions.

At line 147, the check if (!pm.IsPluginRegistered(...)) gates the callback where EnablePlugin(..., false) is applied. Already-registered plugins skip this path entirely. Since the excluded flag is compile-time metadata stored only in the Entry registry—not persisted in PluginDescriptor—and there is no reconciliation logic in InitializePlugins(), a plugin marked as excluded after being previously registered as enabled will remain enabled indefinitely.

If an effect's exclusion status is intended to be changeable (e.g., deprecating a built-in effect), this creates a stale state where user configurations preserve the old enabled status.

au3/libraries/au3-module-manager/PluginManager.cpp (1)

389-403: ⚠️ Potential issue | 🔴 Critical

Auto-registration is re-enabling persisted effects on startup.

Load() restores the saved Enabled/Valid flags first, but the following module->AutoRegisterPlugins(*this) path calls RegisterPlugin(...), which resets them to true on Lines 200-201 and Lines 597-599. Disabled built-in and Nyquist effects will therefore come back enabled every launch unless those flags are preserved when an entry already exists.

🧹 Nitpick comments (11)
au3/libraries/au3-module-manager/IPluginRegistry.h (1)

17-18: Consider adding brief documentation for interface methods.

The overwrite parameter semantics in Save() and the expected behavior of Load() (e.g., does it clear the map first, or merge?) would benefit from brief documentation to guide implementers.

📝 Suggested documentation
 class IPluginRegistry
 {
 public:
     virtual ~IPluginRegistry() = default;
+    //! Load plugin descriptors into the provided map
     virtual void Load(PluginMap&) = 0;
+    //! Save plugin descriptors; if overwrite is true, replace existing entries
     virtual void Save(const PluginMap&, bool overwrite) = 0;
 };
src/effects/builtin/internal/builtineffectsscanner.cpp (1)

11-15: Optional: pre-reserve output vector capacity.

Small perf/readability win for this hot-ish aggregation path.

Suggested diff
 muse::io::paths_t paths;
 const auto metas = builtinEffectsRepository()->effectMetaList();
+paths.reserve(metas.size());
 for (const EffectMeta& meta : metas) {
     paths.push_back(meta.path);
 }
src/effects/lv2/internal/lv2pluginmetareader.cpp (1)

23-27: Keep canReadMeta() side-effect free.

Line 26 now loads the LV2 bundle just to answer a predicate. If this method is hit more than once per path, metadata probing starts doing real bundle work again and can re-trigger registration side effects. Please verify LoadBundle() is cheap/idempotent here, or move it into the actual metadata-read path.

src/effects/nyquist/nyquistprompt/nyquistpromptloader.cpp (1)

35-39: Verify the Nyquist Prompt multi-clip flag before hard-coding true.

The right? comment suggests this capability wasn't confirmed. This metadata now drives capability/UI decisions, so if the prompt cannot safely target multiple clips, we'll advertise an unsupported workflow. Prefer deriving it from the effect's actual capability or documenting how this value was validated.

src/effects/effects_base/internal/au3/au3audiopluginmetareader.cpp (1)

110-122: LGTM with a note on the TODO.

The refactored conversion pipeline using shared utilities (toEffectMeta, auToMuseEffectMeta) is cleaner and more maintainable. The TODO on line 115-116 about supportsMultipleClipSelection is acceptable for incremental development.

Would you like me to open an issue to track the TODO for making supportsMultipleClipSelection a property of the AU3 effect type?

src/effects/vst/internal/vst3effectloader.h (1)

10-18: Consider safer initialization pattern to decouple module construction.

While the current code works in practice because Au3EffectLoader only stores the reference without using it during construction, passing an unconstructed member to the base class is a fragile pattern. If Au3EffectLoader is later modified to access the provider reference during construction, this would cause undefined behavior. The same pattern is used in Lv2EffectLoader, suggesting this is intentional design.

For clarity and robustness, consider using deferred initialization to explicitly show that module initialization happens after base class setup:

Suggested alternative
 class Vst3EffectLoader final : public Au3EffectLoader
 {
 public:
     Vst3EffectLoader()
-        : Au3EffectLoader(m_module, muse::audio::AudioResourceType::VstPlugin) {}
+        : Au3EffectLoader(m_module, muse::audio::AudioResourceType::VstPlugin)
+    {
+    }

 private:
     VST3EffectsModule m_module;
 };

This makes explicit that the pattern relies on m_module being constructed after the base class initializer completes.

src/effects/effects_base/internal/au3/au3effectsutils.cpp (1)

5-11: Minor: Leading whitespace on preprocessor directives.

Lines 5-11 have leading spaces before #include directives. While this compiles, it's unconventional and may cause issues with some preprocessors or static analysis tools.

Suggested fix
-
- `#include` "au3effectsutils.h"
- `#include` "../effectsutils.h"
-
- `#include` "au3wrap/internal/wxtypes_convert.h"
-
- `#include` "au3-module-manager/PluginDescriptor.h"
+
+#include "au3effectsutils.h"
+#include "../effectsutils.h"
+
+#include "au3wrap/internal/wxtypes_convert.h"
+
+#include "au3-module-manager/PluginDescriptor.h"
src/effects/effects_base/internal/au3effectloader.cpp (1)

16-32: Duplicate mapping logic with effectsutils.h.

The toEffectFamily(AudioResourceType) function duplicates the logic in utils::fromMuseAudioResourceType() defined in effectsutils.h (lines 50-63). Consider reusing the utility function to avoid maintenance burden.

♻️ Proposed refactor to reuse existing utility
+#include "effectsutils.h"
+
 namespace au::effects {
-constexpr EffectFamily toEffectFamily(muse::audio::AudioResourceType type)
-{
-    switch (type) {
-    case muse::audio::AudioResourceType::VstPlugin:      return EffectFamily::VST3;
-    case muse::audio::AudioResourceType::Lv2Plugin:      return EffectFamily::LV2;
-    case muse::audio::AudioResourceType::AudioUnit:      return EffectFamily::AudioUnit;
-    case muse::audio::AudioResourceType::NyquistPlugin:  return EffectFamily::Nyquist;
-    case muse::audio::AudioResourceType::BuiltinEffect:  return EffectFamily::Builtin;
-    case muse::audio::AudioResourceType::FluidSoundfont:
-    case muse::audio::AudioResourceType::MusePlugin:
-    case muse::audio::AudioResourceType::MuseSamplerSoundPack:
-        return EffectFamily::Unknown;
-    default:
-        assert(false && "Unknown AudioResourceType");
-        return EffectFamily::Unknown;
-    }
-}

Then replace usages of toEffectFamily(...) with utils::fromMuseAudioResourceType(...).

src/effects/effects_base/internal/effectsutils.cpp (2)

134-149: Inconsistent string literal types in effectTypeFromString.

The function compares against narrow string literals (e.g., "Analyzer") while effectTypeToString uses wide string literals (e.g., u"Analyzer"). While muse::String likely handles this correctly, using consistent literal types (u"...") would be clearer and safer.

♻️ Suggested consistency fix
 EffectType utils::effectTypeFromString(const muse::String& type)
 {
-    if (type == "Analyzer") {
+    if (type == u"Analyzer") {
         return EffectType::Analyzer;
-    } else if (type == "Generator") {
+    } else if (type == u"Generator") {
         return EffectType::Generator;
-    } else if (type == "Processor") {
+    } else if (type == u"Processor") {
         return EffectType::Processor;
-    } else if (type == "Tool") {
+    } else if (type == u"Tool") {
         return EffectType::Tool;
-    } else if (type == "Unknown") {
+    } else if (type == u"Unknown") {
         return EffectType::Unknown;
     }
     assert(false);
     return EffectType::Unknown;
 }

187-195: Silent failure for missing attributes may mask data issues.

The attributeValue helper logs an assertion failure but returns a default-constructed value when an attribute is missing. This could lead to EffectMeta objects with invalid/default fields that silently propagate through the system. Consider whether a more explicit error handling strategy (e.g., returning std::optional or throwing) would be more appropriate for catching data corruption issues.

au3/libraries/au3-module-manager/PluginManager.h (1)

234-235: REGVERCUR appears to be unused dead code.

No functional code references REGVERCUR. Its only mention is in a comment in EffectInterface.h:299 as a reminder for developers to update it when modifying the RealtimeSince enum. Since pluginregistry.cfg is still present in the codebase (FileNames.cpp still returns its path), the constant is not tied to its removal. Consider removing REGVERCUR if it has no active purpose, or document its intended use if it's meant for versioning tracking.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: a407f9b2-b612-4682-9bf9-dae10dfe9c81

📥 Commits

Reviewing files that changed from the base of the PR and between 75ecf7c and c0bdd1adb7428a57280a7396f5158170d3415c13.

📒 Files selected for processing (86)
  • au3/libraries/au3-effects/LoadEffects.cpp
  • au3/libraries/au3-exceptions/AudacityException.h
  • au3/libraries/au3-files/FileException.h
  • au3/libraries/au3-module-manager/CMakeLists.txt
  • au3/libraries/au3-module-manager/IPluginRegistry.h
  • au3/libraries/au3-module-manager/PluginDescriptor.h
  • au3/libraries/au3-module-manager/PluginInterface.cpp
  • au3/libraries/au3-module-manager/PluginInterface.h
  • au3/libraries/au3-module-manager/PluginManager.cpp
  • au3/libraries/au3-module-manager/PluginManager.h
  • au3/libraries/au3-xml/XMLWriter.h
  • muse_framework
  • src/appshell/internal/startupscenario.cpp
  • src/appshell/internal/startupscenario.h
  • src/effects/audio_unit/CMakeLists.txt
  • src/effects/audio_unit/audiouniteffectsmodule.cpp
  • src/effects/audio_unit/audiouniteffectsmodule.h
  • src/effects/audio_unit/iaudiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiouniteffectloader.h
  • src/effects/audio_unit/internal/audiouniteffectsrepository.cpp
  • src/effects/audio_unit/internal/audiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiounitpluginsscanner.cpp
  • src/effects/audio_unit/internal/audiounitpluginsscanner.h
  • src/effects/builtin/CMakeLists.txt
  • src/effects/builtin/builtineffectsmodule.cpp
  • src/effects/builtin/internal/builtineffectsmetareader.cpp
  • src/effects/builtin/internal/builtineffectsmetareader.h
  • src/effects/builtin/internal/builtineffectsscanner.cpp
  • src/effects/builtin/internal/builtineffectsscanner.h
  • src/effects/builtin_collection/internal/builtineffectsloader.cpp
  • src/effects/effects_base/CMakeLists.txt
  • src/effects/effects_base/effectsmodule.cpp
  • src/effects/effects_base/effectstypes.h
  • src/effects/effects_base/ieffectloader.h
  • src/effects/effects_base/ieffectloadersregister.h
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.cpp
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.h
  • src/effects/effects_base/internal/au3/au3audiopluginscanner.cpp
  • src/effects/effects_base/internal/au3/au3audiopluginscanner.h
  • src/effects/effects_base/internal/au3/au3effectsutils.cpp
  • src/effects/effects_base/internal/au3/au3effectsutils.h
  • src/effects/effects_base/internal/au3/au3pluginregistry.cpp
  • src/effects/effects_base/internal/au3/au3pluginregistry.h
  • src/effects/effects_base/internal/au3effectloader.cpp
  • src/effects/effects_base/internal/au3effectloader.h
  • src/effects/effects_base/internal/effectloadersregister.cpp
  • src/effects/effects_base/internal/effectloadersregister.h
  • src/effects/effects_base/internal/effectsprovider.cpp
  • src/effects/effects_base/internal/effectsprovider.h
  • src/effects/effects_base/internal/effectsrepositoryhelper.h
  • src/effects/effects_base/internal/effectsutils.cpp
  • src/effects/effects_base/internal/effectsutils.h
  • src/effects/lv2/CMakeLists.txt
  • src/effects/lv2/ilv2effectsrepository.h
  • src/effects/lv2/internal/lv2effectloader.h
  • src/effects/lv2/internal/lv2effectsrepository.cpp
  • src/effects/lv2/internal/lv2effectsrepository.h
  • src/effects/lv2/internal/lv2pluginmetareader.cpp
  • src/effects/lv2/internal/lv2pluginmetareader.h
  • src/effects/lv2/internal/lv2pluginsscanner.cpp
  • src/effects/lv2/internal/lv2pluginsscanner.h
  • src/effects/lv2/lv2effectsmodule.cpp
  • src/effects/lv2/lv2effectsmodule.h
  • src/effects/lv2/view/lv2viewmodel.cpp
  • src/effects/nyquist/CMakeLists.txt
  • src/effects/nyquist/internal/nyquisteffectsrepository.cpp
  • src/effects/nyquist/internal/nyquisteffectsrepository.h
  • src/effects/nyquist/internal/nyquistpluginsmetareader.cpp
  • src/effects/nyquist/internal/nyquistpluginsmetareader.h
  • src/effects/nyquist/internal/nyquistpluginsscanner.cpp
  • src/effects/nyquist/internal/nyquistpluginsscanner.h
  • src/effects/nyquist/inyquisteffectsrepository.h
  • src/effects/nyquist/nyquisteffectsmodule.cpp
  • src/effects/nyquist/nyquisteffectsmodule.h
  • src/effects/nyquist/nyquistprompt/nyquistpromptloader.cpp
  • src/effects/vst/CMakeLists.txt
  • src/effects/vst/internal/vst3effectloader.h
  • src/effects/vst/internal/vst3pluginsmetareader.cpp
  • src/effects/vst/internal/vst3pluginsmetareader.h
  • src/effects/vst/internal/vst3pluginsscanner.cpp
  • src/effects/vst/internal/vst3pluginsscanner.h
  • src/effects/vst/internal/vsteffectsrepository.cpp
  • src/effects/vst/internal/vsteffectsrepository.h
  • src/effects/vst/ivsteffectsrepository.h
  • src/effects/vst/vsteffectsmodule.cpp
  • src/effects/vst/vsteffectsmodule.h
💤 Files with no reviewable changes (22)
  • src/effects/audio_unit/audiouniteffectsmodule.h
  • au3/libraries/au3-module-manager/PluginInterface.cpp
  • src/effects/audio_unit/iaudiouniteffectsrepository.h
  • src/effects/nyquist/CMakeLists.txt
  • src/effects/audio_unit/internal/audiouniteffectsrepository.cpp
  • src/effects/vst/vsteffectsmodule.h
  • src/effects/lv2/view/lv2viewmodel.cpp
  • src/effects/vst/internal/vst3pluginsscanner.cpp
  • src/effects/lv2/lv2effectsmodule.h
  • src/effects/nyquist/inyquisteffectsrepository.h
  • src/effects/lv2/internal/lv2pluginsscanner.cpp
  • src/effects/lv2/ilv2effectsrepository.h
  • src/effects/nyquist/internal/nyquistpluginsscanner.cpp
  • src/effects/vst/ivsteffectsrepository.h
  • src/effects/lv2/internal/lv2effectsrepository.cpp
  • src/effects/lv2/internal/lv2effectsrepository.h
  • src/effects/audio_unit/internal/audiouniteffectsrepository.h
  • src/effects/vst/internal/vsteffectsrepository.h
  • src/effects/vst/internal/vsteffectsrepository.cpp
  • au3/libraries/au3-module-manager/PluginInterface.h
  • src/effects/audio_unit/internal/audiounitpluginsscanner.cpp
  • src/effects/effects_base/internal/effectsrepositoryhelper.h

Comment on lines +15 to +19
Lv2PluginsScanner()
: Au3AudioPluginScanner(m_lv2Module) {}

private:
::LV2EffectsModule m_lv2Module;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

fd -t f -e h -e cpp | grep -E "(Au3AudioPluginScanner|lv2pluginsscanner)" | head -20

Repository: audacity/audacity

Length of output: 105


🏁 Script executed:

find . -name "*.h" -o -name "*.cpp" | xargs grep -l "class Au3AudioPluginScanner" 2>/dev/null

Repository: audacity/audacity

Length of output: 126


🏁 Script executed:

rg "class Au3AudioPluginScanner" -A 20

Repository: audacity/audacity

Length of output: 989


🏁 Script executed:

rg "class Lv2PluginsScanner" -A 10 src/effects/lv2/internal/lv2pluginsscanner.h

Repository: audacity/audacity

Length of output: 248


🏁 Script executed:

rg "class LV2EffectsModule|struct LV2EffectsModule" -A 10

Repository: audacity/audacity

Length of output: 843


🏁 Script executed:

rg "LV2EffectsModule" src/effects/lv2/internal/lv2pluginsscanner.h -B 5 -A 15

Repository: audacity/audacity

Length of output: 191


🏁 Script executed:

find . -name "*.h" -o -name "*.cpp" | xargs grep -l "LV2EffectsModule" 2>/dev/null | head -10

Repository: audacity/audacity

Length of output: 385


🏁 Script executed:

rg "class LV2EffectsModule" au3/libraries/au3-lv2/ -A 20

Repository: audacity/audacity

Length of output: 965


🏁 Script executed:

cat au3/libraries/au3-lv2/LoadLV2.h | head -100

Repository: audacity/audacity

Length of output: 2710


🏁 Script executed:

cat src/effects/effects_base/internal/au3/au3audiopluginscanner.h

Repository: audacity/audacity

Length of output: 469


🏁 Script executed:

rg "class Au3AudioPluginScanner" -A 50 src/effects/effects_base/internal/au3/au3audiopluginscanner.h

Repository: audacity/audacity

Length of output: 307


🏁 Script executed:

find . -name "au3audiopluginscanner.cpp" | head -5

Repository: audacity/audacity

Length of output: 126


🏁 Script executed:

cat src/effects/effects_base/internal/au3/au3audiopluginscanner.cpp 2>/dev/null || echo "File not found"

Repository: audacity/audacity

Length of output: 995


Base-from-member lifetime bug: member m_lv2Module is referenced by base class before construction.

In C++, base classes are always initialized before member variables. When Lv2PluginsScanner() runs, Au3AudioPluginScanner(m_lv2Module) executes and stores a reference to m_lv2Module in m_pluginProvider before m_lv2Module is constructed. This violates object lifetime rules.

Restructure to construct the module before the base is initialized, or move module ownership into the base class.

@saintmatthieu
saintmatthieu force-pushed the 10593-no-more-pluginregistry.cfg branch from c0bdd1a to bf62f67 Compare March 30, 2026 12:38

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

♻️ Duplicate comments (2)
src/effects/effects_base/internal/effectloadersregister.cpp (1)

8-17: ⚠️ Potential issue | 🟠 Major

Guard null and duplicate registrations in the loader registry.

registerLoader() currently allows null and duplicate-family entries. That can crash lookup at Line 16 (l->family()) and silently shadow later registrations.

Proposed fix
+#include <algorithm>
+
 void EffectLoadersRegister::registerLoader(IEffectLoaderPtr loader)
 {
-    m_loaders.push_back(std::move(loader));
+    if (!loader) {
+        return;
+    }
+
+    const auto it = std::find_if(m_loaders.begin(), m_loaders.end(),
+                                 [&loader](const auto& current) {
+                                     return current && current->family() == loader->family();
+                                 });
+    if (it != m_loaders.end()) {
+        *it = std::move(loader);
+        return;
+    }
+
+    m_loaders.push_back(std::move(loader));
 }
 
 IEffectLoaderPtr EffectLoadersRegister::loader(EffectFamily family) const
 {
     for (const auto& l : m_loaders) {
-        if (l->family() == family) {
+        if (l && l->family() == family) {
             return l;
         }
     }
     return nullptr;
 }
src/effects/effects_base/internal/au3/au3pluginregistry.cpp (1)

76-79: ⚠️ Potential issue | 🔴 Critical

path is still not a safe merge key.

Different effects can legitimately share the same backing file, so Lines 76-79 can still collapse distinct descriptors into one registry entry and overwrite or drop the wrong plugin. Use a stable plugin identity such as meta.id, or (id, path).

Suggested key change
-        const auto it = std::find_if(existingPlugins.begin(), existingPlugins.end(),
-                                     [&info](const AudioPluginInfo& existingInfo) {
-            return existingInfo.path == info.path;
-        });
+        const auto it = std::find_if(existingPlugins.begin(), existingPlugins.end(),
+                                     [&info](const AudioPluginInfo& existingInfo) {
+            return existingInfo.path == info.path
+                && existingInfo.meta.id == info.meta.id;
+        });
🧹 Nitpick comments (7)
src/effects/effects_base/internal/au3effectloader.h (1)

19-28: The reference binding is fragile and couples base construction to member initialization order.

The derived loaders pass m_module (uninitialized at base ctor time) to Au3EffectLoader, binding it to m_pluginProvider. While the constructor currently only performs assertions and defers actual provider use to init(), this is a footgun: any future refactoring that touches the provider during construction will break silently. Owning the provider directly or deferring the reference binding until init() would eliminate this coupling.

src/projectscene/view/trackspanel/realtimeeffectlistitemmodel.cpp (1)

66-69: showEffect is null-safe via callOnLauncher, but consider local guard for consistency.

The method is already safe—callOnLauncher checks for null and returns early. However, line 31 (hideEffect) uses a local guard pattern, and other callers in the codebase check state before forwarding. For consistency, consider applying the same pattern here:

Suggested local guard
 void RealtimeEffectListItemModel::showEffectDialog()
 {
-    effectViewController()->showEffect(m_effectState.lock());
+    const auto state = m_effectState.lock();
+    IF_ASSERT_FAILED(state) {
+        return;
+    }
+    effectViewController()->showEffect(state);
 }
src/effects/effects_base/internal/effectviewcontroller.h (1)

13-15: Unused forward declarations.

EffectBase, EffectSettingsAccess, and TrackList are forward-declared but not referenced in this header. Consider removing them if they're not needed.

🧹 Suggested cleanup
-class EffectBase;
-class EffectSettingsAccess;
-class TrackList;
-
 namespace au::effects {
src/effects/effects_base/effectstypes.h (1)

46-54: Consider inline for header-defined constants to avoid ODR issues.

These static const string definitions in a header will create separate copies in each translation unit that includes this file, potentially leading to linker bloat. Using inline constexpr (C++17) or moving definitions to a source file would be cleaner.

♻️ Suggested change
-static const muse::String EFFECT_TITLE_ATTRIBUTE(u"title");
-static const muse::String EFFECT_TYPE_ATTRIBUTE(u"type");
-static const muse::String EFFECT_CATEGORY_ATTRIBUTE(u"category");
-static const muse::String EFFECT_IS_REALTIME_CAPABLE_ATTRIBUTE(u"isRealtimeCapable");
-static const muse::String EFFECT_SUPPORTS_MULTIPLE_CLIP_SELECTION_ATTRIBUTE(u"supportsMultipleClipSelection");
-static const muse::String EFFECT_VERSION_ATTRIBUTE(u"version");
-static const muse::String EFFECT_MODULE_ATTRIBUTE(u"module");
-static const muse::String EFFECT_ACTIVATED_ATTRIBUTE(u"activated");
+inline const muse::String EFFECT_TITLE_ATTRIBUTE(u"title");
+inline const muse::String EFFECT_TYPE_ATTRIBUTE(u"type");
+inline const muse::String EFFECT_CATEGORY_ATTRIBUTE(u"category");
+inline const muse::String EFFECT_IS_REALTIME_CAPABLE_ATTRIBUTE(u"isRealtimeCapable");
+inline const muse::String EFFECT_SUPPORTS_MULTIPLE_CLIP_SELECTION_ATTRIBUTE(u"supportsMultipleClipSelection");
+inline const muse::String EFFECT_VERSION_ATTRIBUTE(u"version");
+inline const muse::String EFFECT_MODULE_ATTRIBUTE(u"module");
+inline const muse::String EFFECT_ACTIVATED_ATTRIBUTE(u"activated");
src/effects/effects_base/internal/effectsutils.cpp (1)

136-149: String literal type mismatch: narrow vs. wide strings.

effectTypeFromString compares against narrow string literals (e.g., "Analyzer") while effectTypeToString returns wide string literals (e.g., u"Analyzer"). Although muse::String likely handles implicit conversion, this inconsistency could cause issues and is inconsistent with the pattern used in effectFamilyFromString (lines 26-35) which correctly uses wide literals like u"Audacity".

♻️ Use wide string literals for consistency
 EffectType utils::effectTypeFromString(const muse::String& type)
 {
-    if (type == "Analyzer") {
+    if (type == u"Analyzer") {
         return EffectType::Analyzer;
-    } else if (type == "Generator") {
+    } else if (type == u"Generator") {
         return EffectType::Generator;
-    } else if (type == "Processor") {
+    } else if (type == u"Processor") {
         return EffectType::Processor;
-    } else if (type == "Tool") {
+    } else if (type == u"Tool") {
         return EffectType::Tool;
-    } else if (type == "Unknown") {
+    } else if (type == u"Unknown") {
         return EffectType::Unknown;
     }
     assert(false);
     return EffectType::Unknown;
 }
src/effects/effects_base/internal/effectsprovider.h (1)

17-17: Remove the unused TrackList forward declaration.

The TrackList class is forward-declared at line 17 but is not used anywhere in this header or its corresponding implementation file. Remove it to keep the header clean.

src/effects/effects_base/internal/effectexecutionscenario.cpp (1)

863-868: Field naming is confusing but restoration logic is correct.

The field EffectContext::preparingPreviewProgress is misleadingly named. At line 663, originCtx captures the original effect.mProgress value (which may be nullptr or an existing dialog), and this is correctly restored at line 867. The field name suggests it stores "the preparing preview progress dialog," but it actually stores the original progress state that existed before preview started. The new preview dialog created at line 774 is only assigned to newCtx.preparingPreviewProgress and applied temporarily; the original is preserved in originCtx for restoration. The restoration at line 867 is therefore correct. Consider renaming preparingPreviewProgress to originalProgress for clarity.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 8bb8f830-52ff-4986-93ff-83de5da4b6a6

📥 Commits

Reviewing files that changed from the base of the PR and between c0bdd1adb7428a57280a7396f5158170d3415c13 and bf62f67933430f60e2df364a6c0e80bb3b924ec6.

📒 Files selected for processing (137)
  • au3/libraries/au3-effects/LoadEffects.cpp
  • au3/libraries/au3-exceptions/AudacityException.h
  • au3/libraries/au3-files/FileException.h
  • au3/libraries/au3-module-manager/CMakeLists.txt
  • au3/libraries/au3-module-manager/IPluginRegistry.h
  • au3/libraries/au3-module-manager/PluginDescriptor.h
  • au3/libraries/au3-module-manager/PluginInterface.cpp
  • au3/libraries/au3-module-manager/PluginInterface.h
  • au3/libraries/au3-module-manager/PluginManager.cpp
  • au3/libraries/au3-module-manager/PluginManager.h
  • au3/libraries/au3-xml/XMLWriter.h
  • muse_framework
  • src/appshell/internal/startupscenario.cpp
  • src/appshell/internal/startupscenario.h
  • src/appshell/qml/Audacity/AppShell/appmenumodel.h
  • src/effects/audio_unit/CMakeLists.txt
  • src/effects/audio_unit/audiouniteffectsmodule.cpp
  • src/effects/audio_unit/audiouniteffectsmodule.h
  • src/effects/audio_unit/iaudiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiouniteffectloader.h
  • src/effects/audio_unit/internal/audiouniteffectsrepository.cpp
  • src/effects/audio_unit/internal/audiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiounitpluginsscanner.cpp
  • src/effects/audio_unit/internal/audiounitpluginsscanner.h
  • src/effects/audio_unit/view/audiounitview.h
  • src/effects/audio_unit/view/audiounitviewmodel.h
  • src/effects/builtin/CMakeLists.txt
  • src/effects/builtin/builtineffectsmodule.cpp
  • src/effects/builtin/builtineffectsmodule.h
  • src/effects/builtin/internal/builtineffectsloader.h
  • src/effects/builtin/internal/builtineffectsmetareader.cpp
  • src/effects/builtin/internal/builtineffectsmetareader.h
  • src/effects/builtin/internal/builtineffectsscanner.cpp
  • src/effects/builtin/internal/builtineffectsscanner.h
  • src/effects/builtin/view/builtineffectmodel.cpp
  • src/effects/builtin/view/builtineffectmodel.h
  • src/effects/builtin/view/builtineffectviewloader.h
  • src/effects/builtin_collection/CMakeLists.txt
  • src/effects/builtin_collection/builtineffectscollectionmodule.cpp
  • src/effects/builtin_collection/builtineffectscollectionmodule.h
  • src/effects/builtin_collection/dynamics/timeline/abstractdynamicseffectinstancemodel.h
  • src/effects/builtin_collection/internal/builtincollectionloader.cpp
  • src/effects/builtin_collection/internal/builtincollectionloader.h
  • src/effects/effects_base/CMakeLists.txt
  • src/effects/effects_base/effectsmodule.cpp
  • src/effects/effects_base/effectsmodule.h
  • src/effects/effects_base/effectstypes.h
  • src/effects/effects_base/ieffectexecutionscenario.h
  • src/effects/effects_base/ieffectinstancesregister.h
  • src/effects/effects_base/ieffectloader.h
  • src/effects/effects_base/ieffectloadersregister.h
  • src/effects/effects_base/ieffectsprovider.h
  • src/effects/effects_base/ieffectviewcontroller.h
  • src/effects/effects_base/internal/abstractviewlauncher.h
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.cpp
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.h
  • src/effects/effects_base/internal/au3/au3audiopluginscanner.cpp
  • src/effects/effects_base/internal/au3/au3audiopluginscanner.h
  • src/effects/effects_base/internal/au3/au3effectsutils.cpp
  • src/effects/effects_base/internal/au3/au3effectsutils.h
  • src/effects/effects_base/internal/au3/au3pluginregistry.cpp
  • src/effects/effects_base/internal/au3/au3pluginregistry.h
  • src/effects/effects_base/internal/au3effectloader.cpp
  • src/effects/effects_base/internal/au3effectloader.h
  • src/effects/effects_base/internal/effectexecutionscenario.cpp
  • src/effects/effects_base/internal/effectexecutionscenario.h
  • src/effects/effects_base/internal/effectinstancesregister.h
  • src/effects/effects_base/internal/effectloadersregister.cpp
  • src/effects/effects_base/internal/effectloadersregister.h
  • src/effects/effects_base/internal/effectparametersprovider.h
  • src/effects/effects_base/internal/effectpresetsprovider.h
  • src/effects/effects_base/internal/effectpresetsscenario.h
  • src/effects/effects_base/internal/effectsactionscontroller.h
  • src/effects/effects_base/internal/effectsmenuprovider.h
  • src/effects/effects_base/internal/effectsprovider.cpp
  • src/effects/effects_base/internal/effectsprovider.h
  • src/effects/effects_base/internal/effectsrepositoryhelper.h
  • src/effects/effects_base/internal/effectsuiactions.h
  • src/effects/effects_base/internal/effectsutils.cpp
  • src/effects/effects_base/internal/effectsutils.h
  • src/effects/effects_base/internal/effectviewcontroller.cpp
  • src/effects/effects_base/internal/effectviewcontroller.h
  • src/effects/effects_base/internal/realtimeeffectservice.h
  • src/effects/effects_base/iparameterextractorregistry.h
  • src/effects/effects_base/view/abstracteffectviewmodel.h
  • src/effects/effects_base/view/destructiveeffectviewerdialogmodel.h
  • src/effects/effects_base/view/effectparameterslistmodel.h
  • src/effects/effects_base/view/effectpresetsbarmodel.h
  • src/effects/effects_base/view/effectsavecontextmenu.h
  • src/effects/effects_base/view/generatedeffectviewermodel.cpp
  • src/effects/effects_base/view/generatedeffectviewermodel.h
  • src/effects/effects_base/view/presetscontextmenumodel.h
  • src/effects/effects_base/view/realtimeeffectviewerdialogmodel.h
  • src/effects/lv2/CMakeLists.txt
  • src/effects/lv2/ilv2effectsrepository.h
  • src/effects/lv2/internal/lv2effectloader.h
  • src/effects/lv2/internal/lv2effectsrepository.cpp
  • src/effects/lv2/internal/lv2effectsrepository.h
  • src/effects/lv2/internal/lv2pluginmetareader.cpp
  • src/effects/lv2/internal/lv2pluginmetareader.h
  • src/effects/lv2/internal/lv2pluginsscanner.cpp
  • src/effects/lv2/internal/lv2pluginsscanner.h
  • src/effects/lv2/lv2effectsmodule.cpp
  • src/effects/lv2/lv2effectsmodule.h
  • src/effects/lv2/view/lv2viewmodel.cpp
  • src/effects/lv2/view/lv2viewmodel.h
  • src/effects/nyquist/CMakeLists.txt
  • src/effects/nyquist/internal/nyquisteffectsloader.h
  • src/effects/nyquist/internal/nyquisteffectsrepository.cpp
  • src/effects/nyquist/internal/nyquisteffectsrepository.h
  • src/effects/nyquist/internal/nyquistpluginsmetareader.cpp
  • src/effects/nyquist/internal/nyquistpluginsmetareader.h
  • src/effects/nyquist/internal/nyquistpluginsscanner.cpp
  • src/effects/nyquist/internal/nyquistpluginsscanner.h
  • src/effects/nyquist/inyquisteffectsrepository.h
  • src/effects/nyquist/nyquisteffectsmodule.cpp
  • src/effects/nyquist/nyquisteffectsmodule.h
  • src/effects/nyquist/nyquistprompt/nyquistpromptloader.cpp
  • src/effects/nyquist/nyquistprompt/nyquistpromptviewmodel.h
  • src/effects/vst/CMakeLists.txt
  • src/effects/vst/internal/vst3effectloader.h
  • src/effects/vst/internal/vst3pluginsmetareader.cpp
  • src/effects/vst/internal/vst3pluginsmetareader.h
  • src/effects/vst/internal/vst3pluginsscanner.cpp
  • src/effects/vst/internal/vst3pluginsscanner.h
  • src/effects/vst/internal/vsteffectsrepository.cpp
  • src/effects/vst/internal/vsteffectsrepository.h
  • src/effects/vst/ivsteffectsrepository.h
  • src/effects/vst/view/vstviewmodel.cpp
  • src/effects/vst/view/vstviewmodel.h
  • src/effects/vst/vsteffectsmodule.cpp
  • src/effects/vst/vsteffectsmodule.h
  • src/projectscene/view/trackspanel/addeffectmenumodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmenumodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmodel.h
  • src/projectscene/view/trackspanel/realtimeeffectmenumodelbase.h
💤 Files with no reviewable changes (19)
  • au3/libraries/au3-module-manager/PluginInterface.cpp
  • src/effects/audio_unit/iaudiouniteffectsrepository.h
  • src/effects/lv2/view/lv2viewmodel.h
  • src/effects/vst/ivsteffectsrepository.h
  • src/effects/vst/internal/vst3pluginsscanner.cpp
  • src/effects/lv2/internal/lv2pluginsscanner.cpp
  • src/effects/lv2/internal/lv2effectsrepository.cpp
  • src/effects/lv2/ilv2effectsrepository.h
  • src/effects/vst/view/vstviewmodel.h
  • src/effects/nyquist/inyquisteffectsrepository.h
  • src/effects/audio_unit/internal/audiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiouniteffectsrepository.cpp
  • src/effects/lv2/internal/lv2effectsrepository.h
  • src/effects/nyquist/internal/nyquistpluginsscanner.cpp
  • src/effects/vst/internal/vsteffectsrepository.h
  • au3/libraries/au3-module-manager/PluginInterface.h
  • src/effects/effects_base/internal/effectsrepositoryhelper.h
  • src/effects/vst/internal/vsteffectsrepository.cpp
  • src/effects/audio_unit/internal/audiounitpluginsscanner.cpp
✅ Files skipped from review due to trivial changes (12)
  • au3/libraries/au3-module-manager/CMakeLists.txt
  • src/appshell/internal/startupscenario.h
  • src/effects/builtin/CMakeLists.txt
  • src/effects/effects_base/internal/au3/au3pluginregistry.h
  • src/effects/vst/internal/vst3effectloader.h
  • src/effects/audio_unit/CMakeLists.txt
  • src/effects/vst/internal/vst3pluginsscanner.h
  • src/effects/effects_base/ieffectloadersregister.h
  • src/effects/effects_base/ieffectloader.h
  • au3/libraries/au3-module-manager/IPluginRegistry.h
  • src/effects/audio_unit/internal/audiouniteffectloader.h
  • au3/libraries/au3-files/FileException.h
🚧 Files skipped from review as they are similar to previous changes (36)
  • au3/libraries/au3-effects/LoadEffects.cpp
  • src/effects/lv2/CMakeLists.txt
  • src/effects/nyquist/CMakeLists.txt
  • src/effects/vst/internal/vst3pluginsmetareader.cpp
  • src/appshell/internal/startupscenario.cpp
  • src/effects/lv2/internal/lv2pluginmetareader.h
  • src/effects/vst/internal/vst3pluginsmetareader.h
  • src/effects/effects_base/internal/effectloadersregister.h
  • au3/libraries/au3-xml/XMLWriter.h
  • src/effects/lv2/internal/lv2pluginsscanner.h
  • src/effects/lv2/internal/lv2pluginmetareader.cpp
  • src/effects/lv2/view/lv2viewmodel.cpp
  • src/effects/builtin/internal/builtineffectsscanner.h
  • src/effects/effects_base/internal/au3/au3audiopluginscanner.h
  • src/effects/builtin/internal/builtineffectsscanner.cpp
  • src/effects/nyquist/nyquisteffectsmodule.h
  • src/effects/lv2/internal/lv2effectloader.h
  • muse_framework
  • src/effects/vst/vsteffectsmodule.h
  • src/effects/builtin/builtineffectsmodule.cpp
  • src/effects/nyquist/nyquistprompt/nyquistpromptloader.cpp
  • src/effects/lv2/lv2effectsmodule.h
  • src/effects/builtin/internal/builtineffectsmetareader.h
  • src/effects/audio_unit/audiouniteffectsmodule.h
  • src/effects/effects_base/internal/au3/au3effectsutils.cpp
  • src/effects/nyquist/internal/nyquistpluginsscanner.h
  • src/effects/audio_unit/internal/audiounitpluginsscanner.h
  • src/effects/effects_base/internal/au3/au3audiopluginscanner.cpp
  • au3/libraries/au3-module-manager/PluginDescriptor.h
  • au3/libraries/au3-exceptions/AudacityException.h
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.cpp
  • src/effects/audio_unit/audiouniteffectsmodule.cpp
  • src/effects/builtin/internal/builtineffectsmetareader.cpp
  • src/effects/lv2/lv2effectsmodule.cpp
  • src/effects/effects_base/internal/au3effectloader.cpp
  • src/effects/effects_base/internal/au3/au3effectsutils.h

@saintmatthieu
saintmatthieu force-pushed the 10593-no-more-pluginregistry.cfg branch 2 times, most recently from c0929a9 to b46f145 Compare March 31, 2026 15:41
@saintmatthieu

Copy link
Copy Markdown
Contributor Author

@coderabbitai a lot has changed since, please one more time.

@coderabbitai

coderabbitai Bot commented Mar 31, 2026

Copy link
Copy Markdown

@saintmatthieu Sure! I'll do a full re-review of all the changes right away.

✅ Actions performed

Full review triggered.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 31

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
au3/libraries/au3-lv2/LoadLV2.cpp (1)

210-220: 🧹 Nitpick | 🔵 Trivial

Consider adding a TODO comment or issue reference for custom paths support.

The commented-out ReadCustomPaths code explains the current limitation but leaves the implementation path unclear. A // TODO(AU4): marker or issue reference would help track this for future implementation.

src/effects/effects_base/internal/au3effectloader.cpp (1)

53-99: ⚠️ Potential issue | 🟠 Major

Check that the requested effect was actually registered.

DiscoverPluginsAtPath() can yield multiple descriptors for one bundle/path. This implementation only remembers the last returned PluginID, so ensurePluginIsLoaded() can return true even when the requested effectId was never registered. The failure is then deferred to EffectsProvider::effect() on the original id.

💡 Suggested fix
-    PluginID pluginId;
+    bool requestedPluginRegistered = false;
     TranslatableString errorMessage{};
     int numPlugins = m_pluginProvider.DiscoverPluginsAtPath(
         au3::wxFromString(path.toString()), errorMessage,
         [&](PluginProvider* provider, ComponentInterface* ident) -> const PluginID&
     {
-        pluginId = PluginManager::DefaultRegistrationCallback(provider, ident);
-        return pluginId;
+        const auto& id = PluginManager::DefaultRegistrationCallback(provider, ident);
+        requestedPluginRegistered = (au3::wxToStdString(id) == effectId.toStdString());
+        return id;
     });
@@
-    const auto ptr = PluginManager::Get().GetPlugin(pluginId);
-    if (!ptr) {
-        LOGE() << "failed register plugin: " << au3::wxToStdString(pluginId) << ", path: " << path;
+    if (!requestedPluginRegistered) {
+        LOGE() << "failed to register requested plugin: " << effectId << ", path: " << path;
         return false;
     }
♻️ Duplicate comments (6)
src/effects/vst/internal/vst3pluginsscanner.h (1)

14-18: ⚠️ Potential issue | 🔴 Critical

Undefined behavior: member passed to base class before construction.

The constructor passes m_vst3Module to Au3AudioPluginScanner in the initializer list, but C++ constructs base classes before members. At the point Au3AudioPluginScanner(m_vst3Module) runs, m_vst3Module does not yet exist.

Use the base-from-member idiom (a private base class holding VST3EffectsModule before Au3AudioPluginScanner) or refactor Au3AudioPluginScanner to accept ownership differently.

Example fix using base-from-member idiom
+namespace detail {
+struct Vst3ModuleHolder {
+    ::VST3EffectsModule m_vst3Module;
+};
+}
+
-class Vst3PluginsScanner : public Au3AudioPluginScanner
+class Vst3PluginsScanner : private detail::Vst3ModuleHolder, public Au3AudioPluginScanner
 {
 public:
     Vst3PluginsScanner()
         : Au3AudioPluginScanner(m_vst3Module) {}
-
-private:
-    ::VST3EffectsModule m_vst3Module;
 };

,

au3/libraries/au3-module-manager/IPluginRegistry.h (1)

6-6: 🧹 Nitpick | 🔵 Trivial

Drop the direct PluginProvider.h include.

Line 6 is redundant: PluginDescriptor.h already provides PluginID, so this just widens coupling and rebuild surface.

src/effects/nyquist/internal/nyquistpluginsmetareader.h (1)

11-16: ⚠️ Potential issue | 🔴 Critical

Restore readMeta() for the synthetic Nyquist prompt.

Line 16 still lets "Nyquist Prompt" through canReadMeta(), but after removing the Nyquist-specific readMeta() override the base reader will try normal discovery on that synthetic path. Add the override back and synthesize the prompt metadata there.

Minimal header change
 class NyquistPluginsMetaReader : public Au3AudioPluginMetaReader
 {
 public:
     NyquistPluginsMetaReader();
     muse::audio::AudioResourceType metaType() const override;
     bool canReadMeta(const muse::io::path_t& pluginPath) const override;
+    muse::audio::AudioResourceMeta readMeta(const muse::io::path_t& pluginPath) const override;
src/effects/audio_unit/internal/audiounitpluginsscanner.h (1)

14-19: ⚠️ Potential issue | 🔴 Critical

Critical: base constructor receives an uninitialized member reference.

At Line 15, m_auModule is passed to Au3AudioPluginScanner(...) before m_auModule is constructed (Line 18), which is undefined behavior in C++ initialization order.

💡 Safer construction pattern
+class AudioUnitModuleHolder
+{
+protected:
+    ::AudioUnitEffectsModule m_auModule;
+};
+
-class AudioUnitPluginsScanner : public Au3AudioPluginScanner
+class AudioUnitPluginsScanner : private AudioUnitModuleHolder, public Au3AudioPluginScanner
 {
 public:
     AudioUnitPluginsScanner()
         : Au3AudioPluginScanner(m_auModule) {}
-
-private:
-    ::AudioUnitEffectsModule m_auModule;
 };
#!/bin/bash
# Verify constructors that pass members into Au3AudioPluginScanner base init.
rg -nP --type=cpp --type=h ':\s*Au3AudioPluginScanner\s*\(\s*m_[A-Za-z0-9_]+\s*\)' src/effects

# Inspect this class with surrounding lines.
rg -n -C4 'class AudioUnitPluginsScanner|AudioUnitPluginsScanner\(|m_auModule' src/effects/audio_unit/internal/audiounitpluginsscanner.h
src/effects/effects_base/internal/au3/au3pluginregistry.cpp (1)

68-76: ⚠️ Potential issue | 🟠 Major

Metadata loss and hardcoded enabled state.

Two issues in this block:

  1. Line 70: toEffectMeta is called with an empty description and supportsMultipleClipSelection = false. This loses metadata that may have been previously persisted in known_audio_plugins.json.

  2. Line 76: info.enabled is hardcoded to true, ignoring the plugin's actual enabled state from plug.IsEnabled(). This means user toggle changes made via EnablePlugin() will be silently lost on save.

🔧 Suggested fix for enabled state
-        info.enabled = true;
+        info.enabled = plug.IsEnabled();

For the metadata loss, consider looking up the existing plugin info to preserve description and supportsMultipleClipSelection when available.

au3/libraries/au3-module-manager/PluginManager.cpp (1)

334-345: ⚠️ Potential issue | 🔴 Critical

Loaded disabled flags are still overwritten during startup.

Load() now hydrates mRegisteredPlugins before provider discovery, but AutoRegisterPlugins() still routes through RegisterPlugin(...), which unconditionally calls SetEnabled(true) on reused descriptors. A plugin disabled in the unified registry will be re-enabled on startup and then saved back enabled on exit.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4afcb0f9-5609-4f42-92bb-34711b1ade63

📥 Commits

Reviewing files that changed from the base of the PR and between bf62f67933430f60e2df364a6c0e80bb3b924ec6 and b46f14574e05b7d2aafecdb36d5dd71de57dc8a3.

📒 Files selected for processing (145)
  • au3/libraries/au3-effects/LoadEffects.cpp
  • au3/libraries/au3-exceptions/AudacityException.h
  • au3/libraries/au3-files/FileException.h
  • au3/libraries/au3-lv2/LoadLV2.cpp
  • au3/libraries/au3-module-manager/CMakeLists.txt
  • au3/libraries/au3-module-manager/IPluginRegistry.h
  • au3/libraries/au3-module-manager/PluginDescriptor.h
  • au3/libraries/au3-module-manager/PluginInterface.cpp
  • au3/libraries/au3-module-manager/PluginInterface.h
  • au3/libraries/au3-module-manager/PluginManager.cpp
  • au3/libraries/au3-module-manager/PluginManager.h
  • au3/libraries/au3-xml/XMLWriter.h
  • src/appshell/internal/startupscenario.cpp
  • src/appshell/internal/startupscenario.h
  • src/appshell/qml/Audacity/AppShell/appmenumodel.h
  • src/effects/audio_unit/CMakeLists.txt
  • src/effects/audio_unit/audiouniteffectsmodule.cpp
  • src/effects/audio_unit/audiouniteffectsmodule.h
  • src/effects/audio_unit/iaudiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiouniteffectloader.h
  • src/effects/audio_unit/internal/audiouniteffectsrepository.cpp
  • src/effects/audio_unit/internal/audiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiounitpluginsscanner.cpp
  • src/effects/audio_unit/internal/audiounitpluginsscanner.h
  • src/effects/audio_unit/view/audiounitview.h
  • src/effects/audio_unit/view/audiounitviewmodel.h
  • src/effects/builtin/CMakeLists.txt
  • src/effects/builtin/builtineffectsmodule.cpp
  • src/effects/builtin/builtineffectsmodule.h
  • src/effects/builtin/ibuiltineffectsrepository.h
  • src/effects/builtin/internal/builtineffectsloader.h
  • src/effects/builtin/internal/builtineffectsmetareader.cpp
  • src/effects/builtin/internal/builtineffectsmetareader.h
  • src/effects/builtin/internal/builtineffectsrepository.cpp
  • src/effects/builtin/internal/builtineffectsrepository.h
  • src/effects/builtin/internal/builtineffectsscanner.h
  • src/effects/builtin/view/builtineffectmodel.cpp
  • src/effects/builtin/view/builtineffectmodel.h
  • src/effects/builtin/view/builtineffectviewloader.h
  • src/effects/builtin_collection/CMakeLists.txt
  • src/effects/builtin_collection/builtineffectscollectionmodule.cpp
  • src/effects/builtin_collection/builtineffectscollectionmodule.h
  • src/effects/builtin_collection/dynamics/timeline/abstractdynamicseffectinstancemodel.h
  • src/effects/builtin_collection/internal/builtincollectionloader.cpp
  • src/effects/builtin_collection/internal/builtincollectionloader.h
  • src/effects/builtin_collection/internal/builtineffectsloader.cpp
  • src/effects/effects_base/CMakeLists.txt
  • src/effects/effects_base/effectsmodule.cpp
  • src/effects/effects_base/effectsmodule.h
  • src/effects/effects_base/effectstypes.h
  • src/effects/effects_base/ieffectexecutionscenario.h
  • src/effects/effects_base/ieffectinstancesregister.h
  • src/effects/effects_base/ieffectloader.h
  • src/effects/effects_base/ieffectloadersregister.h
  • src/effects/effects_base/ieffectsprovider.h
  • src/effects/effects_base/ieffectsproviderinitializer.h
  • src/effects/effects_base/ieffectviewcontroller.h
  • src/effects/effects_base/internal/abstractaudiopluginmetareader.cpp
  • src/effects/effects_base/internal/abstractviewlauncher.h
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.cpp
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.h
  • src/effects/effects_base/internal/au3/au3audiopluginscanner.cpp
  • src/effects/effects_base/internal/au3/au3audiopluginscanner.h
  • src/effects/effects_base/internal/au3/au3effectsutils.cpp
  • src/effects/effects_base/internal/au3/au3effectsutils.h
  • src/effects/effects_base/internal/au3/au3pluginregistry.cpp
  • src/effects/effects_base/internal/au3/au3pluginregistry.h
  • src/effects/effects_base/internal/au3effectloader.cpp
  • src/effects/effects_base/internal/au3effectloader.h
  • src/effects/effects_base/internal/effectexecutionscenario.cpp
  • src/effects/effects_base/internal/effectexecutionscenario.h
  • src/effects/effects_base/internal/effectinstancesregister.h
  • src/effects/effects_base/internal/effectloadersregister.cpp
  • src/effects/effects_base/internal/effectloadersregister.h
  • src/effects/effects_base/internal/effectparametersprovider.h
  • src/effects/effects_base/internal/effectpresetsprovider.h
  • src/effects/effects_base/internal/effectpresetsscenario.h
  • src/effects/effects_base/internal/effectsactionscontroller.h
  • src/effects/effects_base/internal/effectsmenuprovider.h
  • src/effects/effects_base/internal/effectsprovider.cpp
  • src/effects/effects_base/internal/effectsprovider.h
  • src/effects/effects_base/internal/effectsproviderinitializer.cpp
  • src/effects/effects_base/internal/effectsproviderinitializer.h
  • src/effects/effects_base/internal/effectsrepositoryhelper.h
  • src/effects/effects_base/internal/effectsuiactions.h
  • src/effects/effects_base/internal/effectsutils.cpp
  • src/effects/effects_base/internal/effectsutils.h
  • src/effects/effects_base/internal/effectviewcontroller.cpp
  • src/effects/effects_base/internal/effectviewcontroller.h
  • src/effects/effects_base/internal/realtimeeffectservice.h
  • src/effects/effects_base/iparameterextractorregistry.h
  • src/effects/effects_base/view/abstracteffectviewmodel.h
  • src/effects/effects_base/view/destructiveeffectviewerdialogmodel.h
  • src/effects/effects_base/view/effectparameterslistmodel.h
  • src/effects/effects_base/view/effectpresetsbarmodel.h
  • src/effects/effects_base/view/effectsavecontextmenu.h
  • src/effects/effects_base/view/generatedeffectviewermodel.cpp
  • src/effects/effects_base/view/generatedeffectviewermodel.h
  • src/effects/effects_base/view/presetscontextmenumodel.h
  • src/effects/effects_base/view/realtimeeffectviewerdialogmodel.h
  • src/effects/lv2/CMakeLists.txt
  • src/effects/lv2/ilv2effectsrepository.h
  • src/effects/lv2/internal/lv2effectloader.h
  • src/effects/lv2/internal/lv2effectsrepository.cpp
  • src/effects/lv2/internal/lv2effectsrepository.h
  • src/effects/lv2/internal/lv2pluginmetareader.cpp
  • src/effects/lv2/internal/lv2pluginmetareader.h
  • src/effects/lv2/internal/lv2pluginsscanner.cpp
  • src/effects/lv2/internal/lv2pluginsscanner.h
  • src/effects/lv2/lv2effectsmodule.cpp
  • src/effects/lv2/lv2effectsmodule.h
  • src/effects/lv2/view/lv2viewmodel.cpp
  • src/effects/lv2/view/lv2viewmodel.h
  • src/effects/nyquist/CMakeLists.txt
  • src/effects/nyquist/internal/nyquisteffectsloader.h
  • src/effects/nyquist/internal/nyquisteffectsrepository.cpp
  • src/effects/nyquist/internal/nyquisteffectsrepository.h
  • src/effects/nyquist/internal/nyquistpluginsmetareader.cpp
  • src/effects/nyquist/internal/nyquistpluginsmetareader.h
  • src/effects/nyquist/internal/nyquistpluginsscanner.cpp
  • src/effects/nyquist/internal/nyquistpluginsscanner.h
  • src/effects/nyquist/inyquisteffectsrepository.h
  • src/effects/nyquist/nyquisteffectsmodule.cpp
  • src/effects/nyquist/nyquisteffectsmodule.h
  • src/effects/nyquist/nyquistprompt/nyquistpromptloader.cpp
  • src/effects/nyquist/nyquistprompt/nyquistpromptloader.h
  • src/effects/nyquist/nyquistprompt/nyquistpromptviewmodel.h
  • src/effects/vst/CMakeLists.txt
  • src/effects/vst/internal/vst3effectloader.h
  • src/effects/vst/internal/vst3pluginsmetareader.cpp
  • src/effects/vst/internal/vst3pluginsmetareader.h
  • src/effects/vst/internal/vst3pluginsscanner.cpp
  • src/effects/vst/internal/vst3pluginsscanner.h
  • src/effects/vst/internal/vsteffectsrepository.cpp
  • src/effects/vst/internal/vsteffectsrepository.h
  • src/effects/vst/ivsteffectsrepository.h
  • src/effects/vst/view/vstviewmodel.cpp
  • src/effects/vst/view/vstviewmodel.h
  • src/effects/vst/vsteffectsmodule.cpp
  • src/effects/vst/vsteffectsmodule.h
  • src/projectscene/view/trackspanel/addeffectmenumodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmenumodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmodel.h
  • src/projectscene/view/trackspanel/realtimeeffectmenumodelbase.h
💤 Files with no reviewable changes (23)
  • au3/libraries/au3-module-manager/PluginInterface.cpp
  • au3/libraries/au3-module-manager/PluginInterface.h
  • src/effects/audio_unit/iaudiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiouniteffectsrepository.cpp
  • src/effects/audio_unit/internal/audiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiounitpluginsscanner.cpp
  • src/effects/builtin/ibuiltineffectsrepository.h
  • src/effects/builtin/internal/builtineffectsrepository.cpp
  • src/effects/builtin/internal/builtineffectsrepository.h
  • src/effects/builtin_collection/internal/builtineffectsloader.cpp
  • src/effects/lv2/internal/lv2effectsrepository.cpp
  • src/effects/vst/view/vstviewmodel.h
  • src/effects/lv2/view/lv2viewmodel.h
  • src/effects/lv2/internal/lv2effectsrepository.h
  • src/effects/vst/internal/vst3pluginsscanner.cpp
  • src/effects/vst/internal/vsteffectsrepository.h
  • src/effects/vst/ivsteffectsrepository.h
  • src/effects/lv2/ilv2effectsrepository.h
  • src/effects/effects_base/internal/abstractaudiopluginmetareader.cpp
  • src/effects/effects_base/internal/effectsrepositoryhelper.h
  • src/effects/nyquist/inyquisteffectsrepository.h
  • src/effects/lv2/internal/lv2pluginsscanner.cpp
  • src/effects/vst/internal/vsteffectsrepository.cpp

@coderabbitai

coderabbitai Bot commented Mar 31, 2026

Copy link
Copy Markdown

@saintmatthieu Sure! I'll do a full re-review of all the changes right away.

✅ Actions performed

Full review triggered.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 18

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
au3/libraries/au3-lv2/LoadLV2.cpp (1)

210-220: ⚠️ Potential issue | 🟠 Major

Custom LV2 plugin paths are now effectively ignored.

On Line 210, the ReadCustomPaths() block is disabled entirely, so user-configured LV2 directories are no longer appended to LV2_PATH. This is a functional regression for custom-path discovery and can make previously available plugins disappear.

Please keep the crash fix, but move custom path application to a point where PluginManagerInterface is guaranteed initialized (or gate it with a safe readiness check).

src/effects/nyquist/nyquisteffectsmodule.cpp (1)

87-96: 🧹 Nitpick | 🔵 Trivial

Consider documenting the initialization order dependency.

The initialization sequence (meta reader → loader → scanner → repository) appears intentional. A brief comment explaining why this order matters would help future maintainers.

♻️ Duplicate comments (21)
src/effects/vst/internal/vst3pluginsmetareader.cpp (1)

10-12: ⚠️ Potential issue | 🟠 Major

Initialization-order risk remains in constructor base argument.

Line 11 still passes m_module to the base constructor before m_module is constructed. If Au3AudioPluginMetaReader uses it during base construction, behavior is unsafe.

#!/bin/bash
set -euo pipefail

echo "Inspect Vst3PluginsMetaReader declaration/member order:"
rg -n -C4 'class\s+Vst3PluginsMetaReader|m_module|Vst3PluginsMetaReader\s*\(' src/effects/vst/internal/vst3pluginsmetareader.h src/effects/vst/internal/vst3pluginsmetareader.cpp

echo
echo "Inspect Au3AudioPluginMetaReader constructor behavior:"
rg -n -C6 'class\s+Au3AudioPluginMetaReader|Au3AudioPluginMetaReader\s*\(' src/effects

Expected result: either (a) base constructor does not touch the passed module, or (b) construction pattern is refactored to avoid passing an unconstructed member.

src/effects/builtin/internal/builtineffectsscanner.h (1)

14-18: ⚠️ Potential issue | 🔴 Critical

Base constructor uses m_module before member construction (UB).

On Line 15, Au3AudioPluginScanner(m_module) passes a reference to a member that is not yet constructed (Line 18). This is undefined behavior in C++ object initialization order.

💡 Proposed fix
 class BuiltinEffectsScanner : public Au3AudioPluginScanner
 {
 public:
     BuiltinEffectsScanner()
-        : Au3AudioPluginScanner(m_module) {}
+        : Au3AudioPluginScanner(module()) {}

 private:
-    ::BuiltinEffectsModule m_module;
+    static ::BuiltinEffectsModule& module()
+    {
+        static ::BuiltinEffectsModule instance;
+        return instance;
+    }
 };
#!/bin/bash
set -euo pipefail
FILE="src/effects/builtin/internal/builtineffectsscanner.h"

echo "=== Constructor/base init and member declaration order ==="
rg -n -A8 -B3 'class BuiltinEffectsScanner|BuiltinEffectsScanner\(\)|Au3AudioPluginScanner\(m_module\)|BuiltinEffectsModule m_module' "$FILE"

Expected result: constructor initializer references m_module before member declaration, confirming the construction-order hazard.

src/effects/nyquist/internal/nyquisteffectsloader.h (1)

13-17: ⚠️ Potential issue | 🔴 Critical

Base constructor receives a member before that member is constructed.

Au3EffectLoader(m_module, ...) is initialized before m_module, which is a lifetime/order hazard in C++ and can yield undefined behavior if the base stores that reference.

🔧 Safer construction pattern (module-holder base initialized first)
 class NyquistEffectsLoader final : public Au3EffectLoader
 {
+    struct ModuleHolder {
+        ::NyquistEffectsModule module;
+    };
+
 public:
     NyquistEffectsLoader()
-        : Au3EffectLoader(m_module, muse::audio::AudioResourceType::NyquistPlugin) {}
+        : ModuleHolder()
+        , Au3EffectLoader(ModuleHolder::module, muse::audio::AudioResourceType::NyquistPlugin) {}

 private:
-    ::NyquistEffectsModule m_module;
+    // moved into ModuleHolder so it is initialized before Au3EffectLoader
 };
#!/bin/bash
set -euo pipefail

# Verify whether Au3EffectLoader stores the module by reference/pointer
rg -n -C3 --type=cpp --type=h 'class\s+Au3EffectLoader|Au3EffectLoader\s*\(|m_.*module|module' src/effects/effects_base/internal/au3effectloader.h src/effects/effects_base/internal/au3effectloader.cpp

# Verify this loader passes a member to the base constructor before member construction
cat -n src/effects/nyquist/internal/nyquisteffectsloader.h
src/effects/audio_unit/internal/audiouniteffectloader.h (1)

13-17: ⚠️ Potential issue | 🔴 Critical

Same base-from-member initialization-order bug here.

Au3EffectLoader(m_module, ...) runs before m_module is constructed; this is unsafe if the base stores or dereferences it later.

Please apply the same module-holder/base-order fix pattern as in src/effects/nyquist/internal/nyquisteffectsloader.h.

#!/bin/bash
set -euo pipefail

cat -n src/effects/audio_unit/internal/audiouniteffectloader.h
rg -n -C3 --type=cpp --type=h 'class\s+Au3EffectLoader|Au3EffectLoader\s*\(|m_.*module|module' src/effects/effects_base/internal/au3effectloader.h src/effects/effects_base/internal/au3effectloader.cpp
src/effects/effects_base/internal/effectloadersregister.cpp (1)

8-21: ⚠️ Potential issue | 🟠 Major

Reject null or duplicate loader registrations.

registerLoader() blindly appends without null-checking or checking for duplicates. Meanwhile, loader() dereferences entries without null-check on line 16. A null registration would crash on lookup, and duplicate families silently shadow later registrations.

♻️ Proposed fix to enforce invariants
+#include <algorithm>
+
 void EffectLoadersRegister::registerLoader(IEffectLoaderPtr loader)
 {
+    if (!loader) {
+        return;
+    }
+
+    const auto it = std::find_if(m_loaders.begin(), m_loaders.end(),
+                                 [&loader](const auto& current) {
+                                     return current && current->family() == loader->family();
+                                 });
+    if (it != m_loaders.end()) {
+        *it = std::move(loader);
+        return;
+    }
+
     m_loaders.push_back(std::move(loader));
 }
src/effects/vst/internal/vst3effectloader.h (1)

10-18: ⚠️ Potential issue | 🔴 Critical

Base-from-member initialization order: undefined behavior.

Au3EffectLoader base is constructed before m_module member, so passing m_module to the base constructor binds a reference to uninitialized memory. This is undefined behavior that may cause crashes or corruption.

🔧 Proposed fix using base-from-member idiom
+namespace detail {
+struct Vst3ModuleHolder {
+    VST3EffectsModule m_module;
+};
+}
+
-class Vst3EffectLoader final : public Au3EffectLoader
+class Vst3EffectLoader final : private detail::Vst3ModuleHolder, public Au3EffectLoader
 {
 public:
     Vst3EffectLoader()
-        : Au3EffectLoader(m_module, muse::audio::AudioResourceType::VstPlugin) {}
-
-private:
-    VST3EffectsModule m_module;
+        : Au3EffectLoader(m_module, muse::audio::AudioResourceType::VstPlugin) {}
 };
src/effects/lv2/internal/lv2effectloader.h (1)

11-26: ⚠️ Potential issue | 🔴 Critical

Same base-from-member initialization order problem as Vst3EffectLoader.

The constructor passes m_module to Au3EffectLoader base before m_module is constructed, resulting in undefined behavior.

🔧 Proposed fix using base-from-member idiom
+namespace detail {
+struct Lv2ModuleHolder {
+    LV2EffectsModule m_module;
+};
+}
+
-class Lv2EffectLoader final : public Au3EffectLoader
+class Lv2EffectLoader final : private detail::Lv2ModuleHolder, public Au3EffectLoader
 {
 public:
     Lv2EffectLoader()
         : Au3EffectLoader(m_module, muse::audio::AudioResourceType::Lv2Plugin) {}

 private:
     void doInit() override
     {
         // This won't actually register the LV2 plugins on the manager
         // but is needed to load the plugins in gWorld.
         m_module.AutoRegisterPlugins(::PluginManager::Get());
     }
-
-    LV2EffectsModule m_module;
 };
src/effects/builtin/internal/builtineffectsloader.h (1)

13-17: ⚠️ Potential issue | 🟠 Major

Still unresolved: m_module is forwarded before it is constructed.

Line 14 passes m_module into Au3EffectLoader, but base subobjects are initialized before members in C++. That means the base is bound to storage whose BuiltinEffectsModule lifetime has not started yet. Please use a base-from-member holder (or move module ownership into the base) so the module is fully constructed first.

Suggested fix
+class BuiltinEffectsLoaderModuleHolder
+{
+protected:
+    ::BuiltinEffectsModule m_module;
+};
-class BuiltinEffectsLoader final : public Au3EffectLoader
+class BuiltinEffectsLoader final : private BuiltinEffectsLoaderModuleHolder, public Au3EffectLoader
 {
 public:
     BuiltinEffectsLoader()
         : Au3EffectLoader(m_module, muse::audio::AudioResourceType::BuiltinEffect) {}
-
-private:
-    ::BuiltinEffectsModule m_module;
 };

Run this to inspect the construction order and the base ctor dependency:

#!/bin/bash
set -e
echo "=== BuiltinEffectsLoader ==="
sed -n '1,80p' src/effects/builtin/internal/builtineffectsloader.h
echo
echo "=== Au3EffectLoader declaration ==="
sed -n '1,160p' src/effects/effects_base/internal/au3effectloader.h
echo
echo "=== Au3EffectLoader implementation ==="
sed -n '1,220p' src/effects/effects_base/internal/au3effectloader.cpp
src/effects/vst/internal/vst3pluginsscanner.h (1)

14-18: ⚠️ Potential issue | 🔴 Critical

Still unresolved: m_vst3Module is passed to the base before its lifetime begins.

Line 15 forwards m_vst3Module into Au3AudioPluginScanner, but the base is constructed before member initialization. That leaves the scanner base holding a reference to an unconstructed VST3EffectsModule, which is a real lifetime hazard. Please switch to a base-from-member holder or move module ownership into the base.

Suggested fix
+class Vst3PluginsScannerModuleHolder
+{
+protected:
+    ::VST3EffectsModule m_vst3Module;
+};
-class Vst3PluginsScanner : public Au3AudioPluginScanner
+class Vst3PluginsScanner : private Vst3PluginsScannerModuleHolder, public Au3AudioPluginScanner
 {
 public:
     Vst3PluginsScanner()
         : Au3AudioPluginScanner(m_vst3Module) {}
-
-private:
-    ::VST3EffectsModule m_vst3Module;
 };

Run this to inspect the derived/base constructor relationship:

#!/bin/bash
set -e
echo "=== Vst3PluginsScanner ==="
sed -n '1,80p' src/effects/vst/internal/vst3pluginsscanner.h
echo
echo "=== Au3AudioPluginScanner declaration ==="
sed -n '1,160p' src/effects/effects_base/internal/au3/au3audiopluginscanner.h
echo
echo "=== Au3AudioPluginScanner implementation ==="
sed -n '1,220p' src/effects/effects_base/internal/au3/au3audiopluginscanner.cpp
src/effects/builtin/internal/builtineffectsmetareader.h (1)

11-21: ⚠️ Potential issue | 🔴 Critical

Fix C++ initialization order: m_builtinEffectsModule is uninitialized when passed to base class.

The constructor passes m_builtinEffectsModule to Au3AudioPluginMetaReader in the initializer list, but C++ initializes base classes before member variables. This results in undefined behavior as the base class receives a reference to an uninitialized object.

Use a holder base class pattern to ensure proper initialization order:

Suggested fix
+namespace detail {
+struct BuiltinEffectsModuleHolder {
+    ::BuiltinEffectsModule m_builtinEffectsModule;
+};
+}
+
-class BuiltinEffectsMetaReader : public Au3AudioPluginMetaReader
+class BuiltinEffectsMetaReader : private detail::BuiltinEffectsModuleHolder, public Au3AudioPluginMetaReader
 {
 public:
     BuiltinEffectsMetaReader();

     muse::audio::AudioResourceType metaType() const override;
     bool canReadMeta(const muse::io::path_t& pluginPath) const override;
-
-private:
-    ::BuiltinEffectsModule m_builtinEffectsModule;
 };
au3/libraries/au3-module-manager/PluginDescriptor.h (1)

88-88: ⚠️ Potential issue | 🟠 Major

Unimplemented methods: GetImporterFilterDescription and SetImporterFilterDescription lack backing storage.

These methods are declared but have no corresponding TranslatableString member variable (line 159 area shows only mImporterIdentifier and mImporterExtensions). Either remove these declarations if not needed, or add the member variable and implement the methods.

The ::TranslatableString global namespace qualification is correct and should be retained in any implementation.

Also applies to: 127-127

src/effects/audio_unit/internal/audiounitpluginsscanner.h (1)

11-19: ⚠️ Potential issue | 🔴 Critical

Fix C++ initialization order: m_auModule is uninitialized when passed to base class.

Same issue as flagged in BuiltinEffectsMetaReader and NyquistPluginsScanner. The base class Au3AudioPluginScanner receives a reference to m_auModule before the member is constructed. This is undefined behavior.

Apply the holder base class pattern:

Suggested fix
+namespace detail {
+struct AudioUnitModuleHolder {
+    ::AudioUnitEffectsModule m_auModule;
+};
+}
+
-class AudioUnitPluginsScanner : public Au3AudioPluginScanner
+class AudioUnitPluginsScanner : private detail::AudioUnitModuleHolder, public Au3AudioPluginScanner
 {
 public:
     AudioUnitPluginsScanner()
-        : Au3AudioPluginScanner(m_auModule) {}
-
-private:
-    ::AudioUnitEffectsModule m_auModule;
+        : Au3AudioPluginScanner(m_auModule) {}
 };
src/effects/nyquist/internal/nyquistpluginsscanner.cpp (1)

12-12: 🧹 Nitpick | 🔵 Trivial

Hardcoded "Nyquist prompt" string should be a shared constant.

This magic string is fragile and could drift from wherever the prompt is registered. Consider defining a shared constant to ensure consistency.

src/effects/lv2/internal/lv2pluginsscanner.h (1)

16-17: ⚠️ Potential issue | 🔴 Critical

Fix the base-from-member lifetime bug.

Line 17 forwards m_lv2Module into au::effects::Au3AudioPluginScanner before Line 27 constructs m_lv2Module. Base subobjects are initialized before member subobjects in C++, so this binds the base to an object whose lifetime has not started yet. Please construct the LV2 module in a preceding base/helper, or defer wiring the provider until after member construction.

Also applies to: 27-27

src/effects/lv2/internal/lv2pluginmetareader.cpp (1)

8-9: ⚠️ Potential issue | 🔴 Critical

Do not pass m_module to the base before m_module exists.

Line 9 calls au::effects::Au3AudioPluginMetaReader{m_module} during base construction, but m_module is a member and is not constructed until after the base finishes. This is undefined behavior under the C++ object model. Please ensure the provider/module is constructed first or bind it after member construction.

src/effects/effects_base/internal/effectsproviderinitializer.h (1)

17-17: ⚠️ Potential issue | 🟡 Minor

Missing include for muse::IInteractive.

Line 17 uses muse::IInteractive but the header is not included. This may cause a compilation error if IInteractive is not transitively included through other headers.

Proposed fix
 `#include` "framework/global/modularity/ioc.h"
 `#include` "framework/audioplugins/iregisteraudiopluginsscenario.h"
+#include "framework/global/iinteractive.h"
src/effects/nyquist/internal/nyquisteffectsrepository.cpp (1)

56-64: ⚠️ Potential issue | 🟠 Major

Disabled Nyquist effects still flow through effectMetaList().

This loop now materializes every Nyquist record from known_audio_plugins.json, but it never excludes invalid or deactivated entries. init() consumes this list to register spectrogram actions, so disabling a Nyquist effect will not fully remove it from the UI.

🔧 Minimal filter
-    for (const AudioPluginInfo& info : allEffects) {
-        if (info.meta.type != AudioResourceType::NyquistPlugin) {
+    for (const AudioPluginInfo& info : allEffects) {
+        if (info.meta.type != AudioResourceType::NyquistPlugin || !info.enabled) {
             continue;
         }
 
         EffectMeta meta = utils::museToAuEffectMeta(info.path, info.meta);
+        if (!meta.isActivated) {
+            continue;
+        }
         effects.push_back(std::move(meta));
     }
src/effects/effects_base/internal/au3/au3pluginregistry.cpp (1)

70-76: ⚠️ Potential issue | 🟠 Major

Save() still degrades persisted effect metadata.

Line 70 recreates EffectMeta with an empty description and supportsMultipleClipSelection = false, and Line 76 then hard-codes AudioPluginInfo.enabled = true even though Load() reads that field back as validity. After one save, multi-clip-capable or previously invalid effects no longer round-trip through known_audio_plugins.json.

au3/libraries/au3-module-manager/PluginManager.cpp (2)

389-391: ⚠️ Potential issue | 🟠 Major

Guard sRegistryFactory before invoking to prevent std::bad_function_call.

If Initialize() is called with an empty PluginRegistryFactory, invoking sRegistryFactory() directly will throw std::bad_function_call before the null pointer check on the result runs. This was flagged in a previous review but appears unaddressed.

🐛 Proposed fix
-    if (const auto registry = sRegistryFactory()) {
+    if (sRegistryFactory) {
+        if (const auto registry = sRegistryFactory()) {
         registry->Save(mRegisteredPlugins);
+        }
     }

Apply the same pattern to Load() and Save() methods.


525-537: ⚠️ Potential issue | 🟠 Major

Same guard needed for Load() and Save() methods.

Both methods invoke sRegistryFactory() without first checking if the factory is valid, creating the same std::bad_function_call risk.

🐛 Proposed fix
 void PluginManager::Load()
 {
-    if (const auto registry = sRegistryFactory()) {
+    if (sRegistryFactory) {
+        if (const auto registry = sRegistryFactory()) {
         registry->Load(mRegisteredPlugins);
+        }
     }
 }

 void PluginManager::Save()
 {
-    if (const auto registry = sRegistryFactory()) {
+    if (sRegistryFactory) {
+        if (const auto registry = sRegistryFactory()) {
         registry->Save(mRegisteredPlugins);
+        }
     }
 }
src/effects/effects_base/internal/au3/au3audiopluginmetareader.cpp (1)

99-103: 🧹 Nitpick | 🔵 Trivial

Include plugin path in catch-all error message for debugging.

The catch(...) block only logs "unknown error", making it difficult to diagnose failures. Including the plugin path aids troubleshooting.

♻️ Proposed improvement
     catch (...)
     {
         ok = false;
-        errorStr = "unknown error";
+        errorStr = muse::String("unknown error while loading plugin: ") + pluginPath.toString();
     }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: d71d04b7-f3fb-45da-82c5-f51900df7f7f

📥 Commits

Reviewing files that changed from the base of the PR and between e7be04e and b46f14574e05b7d2aafecdb36d5dd71de57dc8a3.

📒 Files selected for processing (146)
  • au3/libraries/au3-effects/LoadEffects.cpp
  • au3/libraries/au3-exceptions/AudacityException.h
  • au3/libraries/au3-files/FileException.h
  • au3/libraries/au3-lv2/LoadLV2.cpp
  • au3/libraries/au3-module-manager/CMakeLists.txt
  • au3/libraries/au3-module-manager/IPluginRegistry.h
  • au3/libraries/au3-module-manager/PluginDescriptor.h
  • au3/libraries/au3-module-manager/PluginInterface.cpp
  • au3/libraries/au3-module-manager/PluginInterface.h
  • au3/libraries/au3-module-manager/PluginManager.cpp
  • au3/libraries/au3-module-manager/PluginManager.h
  • au3/libraries/au3-xml/XMLWriter.h
  • muse_framework
  • src/appshell/internal/startupscenario.cpp
  • src/appshell/internal/startupscenario.h
  • src/appshell/qml/Audacity/AppShell/appmenumodel.h
  • src/effects/audio_unit/CMakeLists.txt
  • src/effects/audio_unit/audiouniteffectsmodule.cpp
  • src/effects/audio_unit/audiouniteffectsmodule.h
  • src/effects/audio_unit/iaudiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiouniteffectloader.h
  • src/effects/audio_unit/internal/audiouniteffectsrepository.cpp
  • src/effects/audio_unit/internal/audiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiounitpluginsscanner.cpp
  • src/effects/audio_unit/internal/audiounitpluginsscanner.h
  • src/effects/audio_unit/view/audiounitview.h
  • src/effects/audio_unit/view/audiounitviewmodel.h
  • src/effects/builtin/CMakeLists.txt
  • src/effects/builtin/builtineffectsmodule.cpp
  • src/effects/builtin/builtineffectsmodule.h
  • src/effects/builtin/ibuiltineffectsrepository.h
  • src/effects/builtin/internal/builtineffectsloader.h
  • src/effects/builtin/internal/builtineffectsmetareader.cpp
  • src/effects/builtin/internal/builtineffectsmetareader.h
  • src/effects/builtin/internal/builtineffectsrepository.cpp
  • src/effects/builtin/internal/builtineffectsrepository.h
  • src/effects/builtin/internal/builtineffectsscanner.h
  • src/effects/builtin/view/builtineffectmodel.cpp
  • src/effects/builtin/view/builtineffectmodel.h
  • src/effects/builtin/view/builtineffectviewloader.h
  • src/effects/builtin_collection/CMakeLists.txt
  • src/effects/builtin_collection/builtineffectscollectionmodule.cpp
  • src/effects/builtin_collection/builtineffectscollectionmodule.h
  • src/effects/builtin_collection/dynamics/timeline/abstractdynamicseffectinstancemodel.h
  • src/effects/builtin_collection/internal/builtincollectionloader.cpp
  • src/effects/builtin_collection/internal/builtincollectionloader.h
  • src/effects/builtin_collection/internal/builtineffectsloader.cpp
  • src/effects/effects_base/CMakeLists.txt
  • src/effects/effects_base/effectsmodule.cpp
  • src/effects/effects_base/effectsmodule.h
  • src/effects/effects_base/effectstypes.h
  • src/effects/effects_base/ieffectexecutionscenario.h
  • src/effects/effects_base/ieffectinstancesregister.h
  • src/effects/effects_base/ieffectloader.h
  • src/effects/effects_base/ieffectloadersregister.h
  • src/effects/effects_base/ieffectsprovider.h
  • src/effects/effects_base/ieffectsproviderinitializer.h
  • src/effects/effects_base/ieffectviewcontroller.h
  • src/effects/effects_base/internal/abstractaudiopluginmetareader.cpp
  • src/effects/effects_base/internal/abstractviewlauncher.h
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.cpp
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.h
  • src/effects/effects_base/internal/au3/au3audiopluginscanner.cpp
  • src/effects/effects_base/internal/au3/au3audiopluginscanner.h
  • src/effects/effects_base/internal/au3/au3effectsutils.cpp
  • src/effects/effects_base/internal/au3/au3effectsutils.h
  • src/effects/effects_base/internal/au3/au3pluginregistry.cpp
  • src/effects/effects_base/internal/au3/au3pluginregistry.h
  • src/effects/effects_base/internal/au3effectloader.cpp
  • src/effects/effects_base/internal/au3effectloader.h
  • src/effects/effects_base/internal/effectexecutionscenario.cpp
  • src/effects/effects_base/internal/effectexecutionscenario.h
  • src/effects/effects_base/internal/effectinstancesregister.h
  • src/effects/effects_base/internal/effectloadersregister.cpp
  • src/effects/effects_base/internal/effectloadersregister.h
  • src/effects/effects_base/internal/effectparametersprovider.h
  • src/effects/effects_base/internal/effectpresetsprovider.h
  • src/effects/effects_base/internal/effectpresetsscenario.h
  • src/effects/effects_base/internal/effectsactionscontroller.h
  • src/effects/effects_base/internal/effectsmenuprovider.h
  • src/effects/effects_base/internal/effectsprovider.cpp
  • src/effects/effects_base/internal/effectsprovider.h
  • src/effects/effects_base/internal/effectsproviderinitializer.cpp
  • src/effects/effects_base/internal/effectsproviderinitializer.h
  • src/effects/effects_base/internal/effectsrepositoryhelper.h
  • src/effects/effects_base/internal/effectsuiactions.h
  • src/effects/effects_base/internal/effectsutils.cpp
  • src/effects/effects_base/internal/effectsutils.h
  • src/effects/effects_base/internal/effectviewcontroller.cpp
  • src/effects/effects_base/internal/effectviewcontroller.h
  • src/effects/effects_base/internal/realtimeeffectservice.h
  • src/effects/effects_base/iparameterextractorregistry.h
  • src/effects/effects_base/view/abstracteffectviewmodel.h
  • src/effects/effects_base/view/destructiveeffectviewerdialogmodel.h
  • src/effects/effects_base/view/effectparameterslistmodel.h
  • src/effects/effects_base/view/effectpresetsbarmodel.h
  • src/effects/effects_base/view/effectsavecontextmenu.h
  • src/effects/effects_base/view/generatedeffectviewermodel.cpp
  • src/effects/effects_base/view/generatedeffectviewermodel.h
  • src/effects/effects_base/view/presetscontextmenumodel.h
  • src/effects/effects_base/view/realtimeeffectviewerdialogmodel.h
  • src/effects/lv2/CMakeLists.txt
  • src/effects/lv2/ilv2effectsrepository.h
  • src/effects/lv2/internal/lv2effectloader.h
  • src/effects/lv2/internal/lv2effectsrepository.cpp
  • src/effects/lv2/internal/lv2effectsrepository.h
  • src/effects/lv2/internal/lv2pluginmetareader.cpp
  • src/effects/lv2/internal/lv2pluginmetareader.h
  • src/effects/lv2/internal/lv2pluginsscanner.cpp
  • src/effects/lv2/internal/lv2pluginsscanner.h
  • src/effects/lv2/lv2effectsmodule.cpp
  • src/effects/lv2/lv2effectsmodule.h
  • src/effects/lv2/view/lv2viewmodel.cpp
  • src/effects/lv2/view/lv2viewmodel.h
  • src/effects/nyquist/CMakeLists.txt
  • src/effects/nyquist/internal/nyquisteffectsloader.h
  • src/effects/nyquist/internal/nyquisteffectsrepository.cpp
  • src/effects/nyquist/internal/nyquisteffectsrepository.h
  • src/effects/nyquist/internal/nyquistpluginsmetareader.cpp
  • src/effects/nyquist/internal/nyquistpluginsmetareader.h
  • src/effects/nyquist/internal/nyquistpluginsscanner.cpp
  • src/effects/nyquist/internal/nyquistpluginsscanner.h
  • src/effects/nyquist/inyquisteffectsrepository.h
  • src/effects/nyquist/nyquisteffectsmodule.cpp
  • src/effects/nyquist/nyquisteffectsmodule.h
  • src/effects/nyquist/nyquistprompt/nyquistpromptloader.cpp
  • src/effects/nyquist/nyquistprompt/nyquistpromptloader.h
  • src/effects/nyquist/nyquistprompt/nyquistpromptviewmodel.h
  • src/effects/vst/CMakeLists.txt
  • src/effects/vst/internal/vst3effectloader.h
  • src/effects/vst/internal/vst3pluginsmetareader.cpp
  • src/effects/vst/internal/vst3pluginsmetareader.h
  • src/effects/vst/internal/vst3pluginsscanner.cpp
  • src/effects/vst/internal/vst3pluginsscanner.h
  • src/effects/vst/internal/vsteffectsrepository.cpp
  • src/effects/vst/internal/vsteffectsrepository.h
  • src/effects/vst/ivsteffectsrepository.h
  • src/effects/vst/view/vstviewmodel.cpp
  • src/effects/vst/view/vstviewmodel.h
  • src/effects/vst/vsteffectsmodule.cpp
  • src/effects/vst/vsteffectsmodule.h
  • src/projectscene/view/trackspanel/addeffectmenumodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmenumodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmodel.h
  • src/projectscene/view/trackspanel/realtimeeffectmenumodelbase.h
💤 Files with no reviewable changes (23)
  • src/effects/audio_unit/internal/audiounitpluginsscanner.cpp
  • src/effects/audio_unit/iaudiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiouniteffectsrepository.cpp
  • src/effects/builtin/internal/builtineffectsrepository.cpp
  • src/effects/lv2/internal/lv2effectsrepository.cpp
  • src/effects/vst/internal/vsteffectsrepository.cpp
  • src/effects/vst/ivsteffectsrepository.h
  • src/effects/vst/view/vstviewmodel.h
  • src/effects/lv2/view/lv2viewmodel.h
  • src/effects/lv2/internal/lv2effectsrepository.h
  • src/effects/vst/internal/vst3pluginsscanner.cpp
  • src/effects/lv2/internal/lv2pluginsscanner.cpp
  • src/effects/builtin/internal/builtineffectsrepository.h
  • src/effects/nyquist/inyquisteffectsrepository.h
  • src/effects/builtin_collection/internal/builtineffectsloader.cpp
  • src/effects/builtin/ibuiltineffectsrepository.h
  • au3/libraries/au3-module-manager/PluginInterface.h
  • src/effects/vst/internal/vsteffectsrepository.h
  • src/effects/effects_base/internal/effectsrepositoryhelper.h
  • au3/libraries/au3-module-manager/PluginInterface.cpp
  • src/effects/audio_unit/internal/audiouniteffectsrepository.h
  • src/effects/effects_base/internal/abstractaudiopluginmetareader.cpp
  • src/effects/lv2/ilv2effectsrepository.h

Comment on lines +17 to +18
virtual void Load(PluginMap&) = 0;
virtual void Save(const PluginMap&) = 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Return a status from registry persistence calls.

Once pluginregistry.cfg is gone, this interface becomes the only path for persisting plugin enabled/disabled state. void Load() / void Save() give PluginManager no way to distinguish “no persisted state” from “JSON parse failed” or “write failed”, so user toggles can be silently lost. Please return a status/result and make the caller handle failures explicitly.

Comment on lines +17 to +20
bool BuiltinEffectsMetaReader::canReadMeta(const muse::io::path_t& pluginPath) const
{
return pluginPath.toStdString().find("Built-in Effect:") == 0;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider extracting the "Built-in Effect:" prefix to a shared constant.

This magic string is used to identify built-in effects. If this prefix is used elsewhere (e.g., in effect registration or path construction), a shared constant would prevent drift and improve maintainability.

Optional improvement
+namespace {
+constexpr const char* kBuiltinEffectPrefix = "Built-in Effect:";
+}
+
 bool BuiltinEffectsMetaReader::canReadMeta(const muse::io::path_t& pluginPath) const
 {
-    return pluginPath.toStdString().find("Built-in Effect:") == 0;
+    return pluginPath.toStdString().find(kBuiltinEffectPrefix) == 0;
 }

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/effects/nyquist/nyquisteffectsmodule.cpp (1)

87-101: ⚠️ Potential issue | 🟠 Major

Deinit the loader and scanner you initialize here.

onInit() now initializes m_effectLoader and m_pluginsScanner, but onDeinit() only tears down m_nyquistMetaReader. That leaves the other AU3-backed components alive past module shutdown and can leak provider/module state across reloads. Based on learnings, the scanner subclasses intentionally pass a private m_module member to Au3AudioPluginScanner, and the loader classes do the same for Au3EffectLoader, so they each carry their own module lifetime.

au3/libraries/au3-module-manager/PluginManager.h (1)

233-234: ⚠️ Potential issue | 🟡 Minor

Remove the REGVERCUR constant as dead code.

The constant is no longer used. GetRegistryVersion() and mRegver have been removed, and the only remaining reference to REGVERCUR is an obsolete comment instruction in EffectInterface.h (line 299) directing developers to "increase REGVERCUR in any release with such a change" — an instruction that no longer applies since the registry versioning logic has been eliminated.

♻️ Duplicate comments (12)
src/projectscene/view/trackspanel/realtimeeffectlistitemmodel.cpp (1)

66-69: ⚠️ Potential issue | 🟡 Minor

Guard against expired weak state before showEffect().

m_effectState.lock() can return nullptr if the weak pointer has expired. Unlike the destructor which guards with IF_ASSERT_FAILED, this method passes the result directly to showEffect().

🛠️ Proposed fix
 void RealtimeEffectListItemModel::showEffectDialog()
 {
-    effectViewController()->showEffect(m_effectState.lock());
+    const auto state = m_effectState.lock();
+    IF_ASSERT_FAILED(state) {
+        return;
+    }
+    effectViewController()->showEffect(state);
 }
src/effects/effects_base/internal/effectsproviderinitializer.h (1)

6-11: ⚠️ Potential issue | 🟡 Minor

Missing include for muse::IInteractive.

Line 17 uses muse::IInteractive but the header is not included. This could cause compilation errors if not transitively included.

Proposed fix
 `#include` "ieffectsprovider.h"
 `#include` "ieffectsproviderinitializer.h"
 
 `#include` "framework/global/modularity/ioc.h"
 `#include` "framework/audioplugins/iregisteraudiopluginsscenario.h"
+#include "framework/global/iinteractive.h"
src/effects/nyquist/nyquistprompt/nyquistpromptloader.cpp (1)

6-11: 🧹 Nitpick | 🔵 Trivial

Remove unused includes.

au3effectsutils.h does not appear to be used in this file—none of its symbols (toAu4EffectCategory, toAu3EffectGroup, toAu4EffectType, toAu3EffectType, toEffectMeta) are called. The au3::wxToString() function is defined elsewhere (likely in wxtypes_convert.h).

Similarly, translation.h appears unused—no translation macros like muse::mtrc() are visible in the code.

Proposed fix
 `#include` "nyquistpromptloader.h"
 
-#include "effects/effects_base/internal/au3/au3effectsutils.h"
-
 `#include` "au3-module-manager/PluginManager.h"
 `#include` "au3-effects/LoadEffects.h"
-
-#include "framework/global/translation.h"
src/effects/nyquist/internal/nyquistpluginsscanner.cpp (1)

12-13: ⚠️ Potential issue | 🟡 Minor

Reuse the prompt’s canonical identifier here.

"Nyquist prompt" is still a hard-coded sentinel. If that identifier ever changes, this pseudo-effect will start being scanned and persisted into known_audio_plugins.json as a normal plugin.

src/effects/effects_base/internal/au3effectloader.h (1)

21-30: ⚠️ Potential issue | 🟠 Major

Add a shutdown hook alongside init().

This base now exposes an init-only lifecycle. The sibling AU3 meta reader already has explicit deinit()/Terminate() support, but there is no corresponding loader hook here, so the modules added in this PR have no visible way to tear loader/scanner providers down on deinit.

Minimal API shape
     void init();
+    void deinit();
 
 private:
     virtual void doInit() {}
+    virtual void doDeinit() {}
Read-only verification
#!/bin/bash
# Verify that AU3 loader/scanner initialization has a matching teardown.
fd -i 'au3effectloader.*' -x sed -n '1,220p' {}
fd -i 'au3audiopluginscanner.*' -x sed -n '1,220p' {}
rg -n -C2 '\binit\s*\(|\bdeinit\s*\(|Initialize\(|Terminate\(' src/effects

Expected: Au3EffectLoader and Au3AudioPluginScanner expose a teardown path or destructors that call PluginProvider::Terminate(). If only meta readers terminate, the lifecycle is still asymmetric.

src/effects/nyquist/internal/nyquistpluginsmetareader.h (1)

11-16: ⚠️ Potential issue | 🔴 Critical

Keep a Nyquist-specific readMeta() for the synthetic prompt entry.

This class still advertises prompt metadata via canReadMeta(), but after removing the override it falls back to the shared AU3 reader, which discovers metadata from a real plugin path. The synthetic Nyquist prompt entry needs its own readMeta() path or metadata lookup for that entry will fail when the unified register asks for it.

Minimal header fix
 class NyquistPluginsMetaReader : public Au3AudioPluginMetaReader
 {
 public:
     NyquistPluginsMetaReader();
     muse::audio::AudioResourceType metaType() const override;
     bool canReadMeta(const muse::io::path_t& pluginPath) const override;
+    muse::audio::AudioResourceMeta readMeta(const muse::io::path_t& pluginPath) const override;
Read-only verification
#!/bin/bash
# Verify that the synthetic Nyquist prompt still has a dedicated metadata path.
fd -i 'nyquistpluginsmetareader.*' -x sed -n '1,220p' {}
fd -i 'au3audiopluginmetareader.*' -x sed -n '1,240p' {}
rg -n -C3 'Nyquist Prompt|Nyquist prompt|canReadMeta|readMeta|DiscoverPluginsAtPath' src/effects au3

Expected: either NyquistPluginsMetaReader::readMeta() exists, or Au3AudioPluginMetaReader::readMeta() has an explicit non-file branch for the prompt entry.

src/effects/nyquist/internal/nyquisteffectsrepository.cpp (1)

58-64: ⚠️ Potential issue | 🟠 Major

Filter deactivated Nyquist entries before returning the repository list.

Line 63 converts the stored activation flag into EffectMeta, but Line 64 still pushes every Nyquist record. That list feeds init() on Lines 20-43, so disabled spectral Nyquist effects can still be registered into the spectrogram UI.

🔧 Suggested fix
     for (const AudioPluginInfo& info : allEffects) {
         if (info.meta.type != AudioResourceType::NyquistPlugin) {
             continue;
         }
 
         EffectMeta meta = utils::museToAuEffectMeta(info.path, info.meta);
+        if (!meta.isActivated) {
+            continue;
+        }
         effects.push_back(std::move(meta));
     }
au3/libraries/au3-module-manager/PluginManager.cpp (1)

334-345: ⚠️ Potential issue | 🔴 Critical

Rediscovery still clobbers the loaded registry state.

Line 337 loads persisted descriptors, but Lines 342-344 then feed them back through the existing registration paths, which reset Enabled/Valid to true on reused entries. Disabled effects come back enabled after restart, and descriptors that are no longer rediscovered never get pruned from mRegisteredPlugins. Reconcile the discovered set against the loaded set before saving again.

src/effects/effects_base/internal/effectsprovider.cpp (1)

81-86: ⚠️ Potential issue | 🔴 Critical

Build failure: m_au3PluginsChangedSubscription is not declared.

The subscription object m_au3PluginsChangedSubscription is used here but is not declared in effectsprovider.h. This causes compilation failures on all platforms (Linux, macOS, Windows) as indicated by the pipeline failures.

Add the member declaration to the private section of effectsprovider.h:

Observer::Subscription m_au3PluginsChangedSubscription;
src/effects/effects_base/internal/effectexecutionscenario.cpp (2)

559-609: ⚠️ Potential issue | 🟠 Major

Multi-clip execution is not atomic - partial failures leave earlier clips modified.

As noted in a previous review, performEffectOnEachSelectedClip() calls performEffectInternal() once per clip, each creating its own TransactionScope. If clip N+1 fails, clips 0 through N have already been committed. This can leave the project in an inconsistent state.

Consider either:

  1. Moving the transaction boundary up to performEffectOnEachSelectedClip()
  2. Having this helper participate in an outer transaction
  3. Implementing a rollback mechanism for partial failures

627-634: 🧹 Nitpick | 🔵 Trivial

Clarify the purpose of restoreEffectStateHack.

The function name suggests this is a workaround. Consider adding a comment explaining why MakeInstance() + Init() is needed to restore state, or tracking this for future cleanup if it's a known limitation.

src/effects/effects_base/internal/effectsutils.cpp (1)

187-196: ⚠️ Potential issue | 🟡 Minor

Silent default on missing attributes may cause subtle bugs in release builds.

The attributeValue() helper returns a default-constructed value when the attribute is missing, with only a debug assertion. In release builds, critical fields like isActivated or isRealtimeCapable could silently use incorrect defaults (e.g., false for bools).

Consider logging a warning in release builds for missing required attributes to aid debugging:

💡 Suggested improvement
 template<typename T = muse::String>
 T attributeValue(const muse::audio::AudioResourceMeta& meta, const muse::String& key)
 {
     const auto valStr = meta.attributeVal(key);
-    IF_ASSERT_FAILED(!valStr.empty()) {
+    if (valStr.empty()) {
+        LOGW() << "Missing attribute: " << key << " for plugin: " << meta.id;
+        assert(false);
         return {};
     }
     return value<T>(valStr);
 }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: ca7e61d5-ee0f-45ec-895a-2b283099cc9e

📥 Commits

Reviewing files that changed from the base of the PR and between e7be04e and b46f14574e05b7d2aafecdb36d5dd71de57dc8a3.

📒 Files selected for processing (146)
  • au3/libraries/au3-effects/LoadEffects.cpp
  • au3/libraries/au3-exceptions/AudacityException.h
  • au3/libraries/au3-files/FileException.h
  • au3/libraries/au3-lv2/LoadLV2.cpp
  • au3/libraries/au3-module-manager/CMakeLists.txt
  • au3/libraries/au3-module-manager/IPluginRegistry.h
  • au3/libraries/au3-module-manager/PluginDescriptor.h
  • au3/libraries/au3-module-manager/PluginInterface.cpp
  • au3/libraries/au3-module-manager/PluginInterface.h
  • au3/libraries/au3-module-manager/PluginManager.cpp
  • au3/libraries/au3-module-manager/PluginManager.h
  • au3/libraries/au3-xml/XMLWriter.h
  • muse_framework
  • src/appshell/internal/startupscenario.cpp
  • src/appshell/internal/startupscenario.h
  • src/appshell/qml/Audacity/AppShell/appmenumodel.h
  • src/effects/audio_unit/CMakeLists.txt
  • src/effects/audio_unit/audiouniteffectsmodule.cpp
  • src/effects/audio_unit/audiouniteffectsmodule.h
  • src/effects/audio_unit/iaudiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiouniteffectloader.h
  • src/effects/audio_unit/internal/audiouniteffectsrepository.cpp
  • src/effects/audio_unit/internal/audiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiounitpluginsscanner.cpp
  • src/effects/audio_unit/internal/audiounitpluginsscanner.h
  • src/effects/audio_unit/view/audiounitview.h
  • src/effects/audio_unit/view/audiounitviewmodel.h
  • src/effects/builtin/CMakeLists.txt
  • src/effects/builtin/builtineffectsmodule.cpp
  • src/effects/builtin/builtineffectsmodule.h
  • src/effects/builtin/ibuiltineffectsrepository.h
  • src/effects/builtin/internal/builtineffectsloader.h
  • src/effects/builtin/internal/builtineffectsmetareader.cpp
  • src/effects/builtin/internal/builtineffectsmetareader.h
  • src/effects/builtin/internal/builtineffectsrepository.cpp
  • src/effects/builtin/internal/builtineffectsrepository.h
  • src/effects/builtin/internal/builtineffectsscanner.h
  • src/effects/builtin/view/builtineffectmodel.cpp
  • src/effects/builtin/view/builtineffectmodel.h
  • src/effects/builtin/view/builtineffectviewloader.h
  • src/effects/builtin_collection/CMakeLists.txt
  • src/effects/builtin_collection/builtineffectscollectionmodule.cpp
  • src/effects/builtin_collection/builtineffectscollectionmodule.h
  • src/effects/builtin_collection/dynamics/timeline/abstractdynamicseffectinstancemodel.h
  • src/effects/builtin_collection/internal/builtincollectionloader.cpp
  • src/effects/builtin_collection/internal/builtincollectionloader.h
  • src/effects/builtin_collection/internal/builtineffectsloader.cpp
  • src/effects/effects_base/CMakeLists.txt
  • src/effects/effects_base/effectsmodule.cpp
  • src/effects/effects_base/effectsmodule.h
  • src/effects/effects_base/effectstypes.h
  • src/effects/effects_base/ieffectexecutionscenario.h
  • src/effects/effects_base/ieffectinstancesregister.h
  • src/effects/effects_base/ieffectloader.h
  • src/effects/effects_base/ieffectloadersregister.h
  • src/effects/effects_base/ieffectsprovider.h
  • src/effects/effects_base/ieffectsproviderinitializer.h
  • src/effects/effects_base/ieffectviewcontroller.h
  • src/effects/effects_base/internal/abstractaudiopluginmetareader.cpp
  • src/effects/effects_base/internal/abstractviewlauncher.h
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.cpp
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.h
  • src/effects/effects_base/internal/au3/au3audiopluginscanner.cpp
  • src/effects/effects_base/internal/au3/au3audiopluginscanner.h
  • src/effects/effects_base/internal/au3/au3effectsutils.cpp
  • src/effects/effects_base/internal/au3/au3effectsutils.h
  • src/effects/effects_base/internal/au3/au3pluginregistry.cpp
  • src/effects/effects_base/internal/au3/au3pluginregistry.h
  • src/effects/effects_base/internal/au3effectloader.cpp
  • src/effects/effects_base/internal/au3effectloader.h
  • src/effects/effects_base/internal/effectexecutionscenario.cpp
  • src/effects/effects_base/internal/effectexecutionscenario.h
  • src/effects/effects_base/internal/effectinstancesregister.h
  • src/effects/effects_base/internal/effectloadersregister.cpp
  • src/effects/effects_base/internal/effectloadersregister.h
  • src/effects/effects_base/internal/effectparametersprovider.h
  • src/effects/effects_base/internal/effectpresetsprovider.h
  • src/effects/effects_base/internal/effectpresetsscenario.h
  • src/effects/effects_base/internal/effectsactionscontroller.h
  • src/effects/effects_base/internal/effectsmenuprovider.h
  • src/effects/effects_base/internal/effectsprovider.cpp
  • src/effects/effects_base/internal/effectsprovider.h
  • src/effects/effects_base/internal/effectsproviderinitializer.cpp
  • src/effects/effects_base/internal/effectsproviderinitializer.h
  • src/effects/effects_base/internal/effectsrepositoryhelper.h
  • src/effects/effects_base/internal/effectsuiactions.h
  • src/effects/effects_base/internal/effectsutils.cpp
  • src/effects/effects_base/internal/effectsutils.h
  • src/effects/effects_base/internal/effectviewcontroller.cpp
  • src/effects/effects_base/internal/effectviewcontroller.h
  • src/effects/effects_base/internal/realtimeeffectservice.h
  • src/effects/effects_base/iparameterextractorregistry.h
  • src/effects/effects_base/view/abstracteffectviewmodel.h
  • src/effects/effects_base/view/destructiveeffectviewerdialogmodel.h
  • src/effects/effects_base/view/effectparameterslistmodel.h
  • src/effects/effects_base/view/effectpresetsbarmodel.h
  • src/effects/effects_base/view/effectsavecontextmenu.h
  • src/effects/effects_base/view/generatedeffectviewermodel.cpp
  • src/effects/effects_base/view/generatedeffectviewermodel.h
  • src/effects/effects_base/view/presetscontextmenumodel.h
  • src/effects/effects_base/view/realtimeeffectviewerdialogmodel.h
  • src/effects/lv2/CMakeLists.txt
  • src/effects/lv2/ilv2effectsrepository.h
  • src/effects/lv2/internal/lv2effectloader.h
  • src/effects/lv2/internal/lv2effectsrepository.cpp
  • src/effects/lv2/internal/lv2effectsrepository.h
  • src/effects/lv2/internal/lv2pluginmetareader.cpp
  • src/effects/lv2/internal/lv2pluginmetareader.h
  • src/effects/lv2/internal/lv2pluginsscanner.cpp
  • src/effects/lv2/internal/lv2pluginsscanner.h
  • src/effects/lv2/lv2effectsmodule.cpp
  • src/effects/lv2/lv2effectsmodule.h
  • src/effects/lv2/view/lv2viewmodel.cpp
  • src/effects/lv2/view/lv2viewmodel.h
  • src/effects/nyquist/CMakeLists.txt
  • src/effects/nyquist/internal/nyquisteffectsloader.h
  • src/effects/nyquist/internal/nyquisteffectsrepository.cpp
  • src/effects/nyquist/internal/nyquisteffectsrepository.h
  • src/effects/nyquist/internal/nyquistpluginsmetareader.cpp
  • src/effects/nyquist/internal/nyquistpluginsmetareader.h
  • src/effects/nyquist/internal/nyquistpluginsscanner.cpp
  • src/effects/nyquist/internal/nyquistpluginsscanner.h
  • src/effects/nyquist/inyquisteffectsrepository.h
  • src/effects/nyquist/nyquisteffectsmodule.cpp
  • src/effects/nyquist/nyquisteffectsmodule.h
  • src/effects/nyquist/nyquistprompt/nyquistpromptloader.cpp
  • src/effects/nyquist/nyquistprompt/nyquistpromptloader.h
  • src/effects/nyquist/nyquistprompt/nyquistpromptviewmodel.h
  • src/effects/vst/CMakeLists.txt
  • src/effects/vst/internal/vst3effectloader.h
  • src/effects/vst/internal/vst3pluginsmetareader.cpp
  • src/effects/vst/internal/vst3pluginsmetareader.h
  • src/effects/vst/internal/vst3pluginsscanner.cpp
  • src/effects/vst/internal/vst3pluginsscanner.h
  • src/effects/vst/internal/vsteffectsrepository.cpp
  • src/effects/vst/internal/vsteffectsrepository.h
  • src/effects/vst/ivsteffectsrepository.h
  • src/effects/vst/view/vstviewmodel.cpp
  • src/effects/vst/view/vstviewmodel.h
  • src/effects/vst/vsteffectsmodule.cpp
  • src/effects/vst/vsteffectsmodule.h
  • src/projectscene/view/trackspanel/addeffectmenumodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmenumodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmodel.cpp
  • src/projectscene/view/trackspanel/realtimeeffectlistitemmodel.h
  • src/projectscene/view/trackspanel/realtimeeffectmenumodelbase.h
💤 Files with no reviewable changes (23)
  • src/effects/audio_unit/iaudiouniteffectsrepository.h
  • au3/libraries/au3-module-manager/PluginInterface.cpp
  • src/effects/lv2/view/lv2viewmodel.h
  • src/effects/vst/view/vstviewmodel.h
  • src/effects/lv2/ilv2effectsrepository.h
  • src/effects/audio_unit/internal/audiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiouniteffectsrepository.cpp
  • src/effects/vst/internal/vsteffectsrepository.h
  • src/effects/audio_unit/internal/audiounitpluginsscanner.cpp
  • src/effects/vst/ivsteffectsrepository.h
  • src/effects/nyquist/inyquisteffectsrepository.h
  • src/effects/lv2/internal/lv2pluginsscanner.cpp
  • src/effects/vst/internal/vsteffectsrepository.cpp
  • src/effects/lv2/internal/lv2effectsrepository.h
  • src/effects/lv2/internal/lv2effectsrepository.cpp
  • src/effects/builtin/internal/builtineffectsrepository.h
  • src/effects/builtin/ibuiltineffectsrepository.h
  • src/effects/vst/internal/vst3pluginsscanner.cpp
  • src/effects/effects_base/internal/effectsrepositoryhelper.h
  • au3/libraries/au3-module-manager/PluginInterface.h
  • src/effects/builtin_collection/internal/builtineffectsloader.cpp
  • src/effects/effects_base/internal/abstractaudiopluginmetareader.cpp
  • src/effects/builtin/internal/builtineffectsrepository.cpp

Comment thread au3/libraries/au3-lv2/LoadLV2.cpp Resolved
Comment thread muse_framework Resolved
Comment on lines +9 to +16
class IEffectsProviderInitializer : MODULE_EXPORT_INTERFACE
{
INTERFACE_ID(IEffectsProviderInitializer)

public:
virtual ~IEffectsProviderInitializer() = default;

virtual void callAfterSplashScreen() = 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Prefer an operation-oriented name over a UI-event name in this exported interface.

callAfterSplashScreen() bakes one appshell trigger into effects_base. A contract like ensureInitialized() or initializeOnce() keeps the boundary reusable for tests, headless startup, and any future caller that needs the same one-shot initialization.

Comment on lines +18 to +25
const AudioPluginInfoList plugins = knownPlugins()->pluginInfoList();

for (const AudioPluginInfo& info : plugins) {
if (!info.enabled) {
continue;
}

const EffectMeta meta = utils::museToAuEffectMeta(info.path, info.meta);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Ignore non-Fx records when hydrating PluginMap.

AudioPluginInfo is already typed, but this loop converts every enabled record into a PluginTypeEffect. If known_audio_plugins.json contains any non-Fx entries, they'll be synthesized into bogus effect descriptors here. Gate this path on info.type == AudioPluginType::Fx before calling museToAuEffectMeta().

🔧 Minimal guard
     for (const AudioPluginInfo& info : plugins) {
-        if (!info.enabled) {
+        if (info.type != AudioPluginType::Fx || !info.enabled) {
             continue;
         }
🧰 Tools
🪛 Cppcheck (2.20.0)

[style] 23-23: The function 'wxFromString' is never used.

(unusedFunction)

Comment on lines +40 to +48
}
assert(isAudacityPlugin.has_value());
if (isAudacityPlugin.has_value() && *isAudacityPlugin) {
audacityPluginPaths.push_back(*it);
it = thirdPartyPluginPaths.erase(it);
} else {
++it;
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Assertion may fail for unrecognized plugin paths.

The assertion at line 41 (assert(isAudacityPlugin.has_value())) will fail if no meta reader can read the plugin path. While this might indicate a bug in the scanning logic, an assertion failure in production could crash the application.

Consider adding defensive handling or converting to a logged warning if unrecognized plugins are possible:

💡 Suggested fix
-        assert(isAudacityPlugin.has_value());
-        if (isAudacityPlugin.has_value() && *isAudacityPlugin) {
+        if (!isAudacityPlugin.has_value()) {
+            LOGW() << "No meta reader found for plugin path: " << *it;
+            ++it;
+            continue;
+        }
+        if (*isAudacityPlugin) {
🧰 Tools
🪛 GitHub Actions: [AU4] Build: Linux

[error] g++ command failed while compiling effectsprovider.cpp (error at line 81).

@saintmatthieu
saintmatthieu force-pushed the 10593-no-more-pluginregistry.cfg branch 4 times, most recently from ef0e59d to 3c9e51d Compare April 2, 2026 17:09

@luapmartin luapmartin left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from what I reviewed it seems going in the right direction, sure we have more things to cleanup (the multi PluginProvider instantiation and getting rid of more au3 legacy code (pluginmanager)...) but we’re on track with those changes, thanks a lot

@grliszas14
grliszas14 force-pushed the 10593-no-more-pluginregistry.cfg branch from 3c9e51d to 5474bd2 Compare April 7, 2026 14:50
@saintmatthieu
saintmatthieu force-pushed the 10593-no-more-pluginregistry.cfg branch from 5474bd2 to 89458bc Compare April 13, 2026 08:17

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
au3/libraries/au3-module-manager/PluginDescriptor.h (1)

62-119: ⚠️ Potential issue | 🔴 Critical

Add missing serialization for mDescription and mSupportsMultipleClipSelection.

The new descriptor fields lack persistence: neither field is written by WriteXML() or parsed by HandleXMLTag(). Define attribute constants (e.g., AttrDescription, AttrSupportsMultipleClipSelection) and update both methods to serialize/deserialize these fields. Without this, metadata will be rebuilt on each reload, defeating the unified-registry goal.

Serialization gap details
  • Missing constants: AttrDescription, AttrSupportsMultipleClipSelection not defined in PluginDescriptor.cpp
  • WriteXML (line 292–315): does not call writer.WriteAttr() for these fields
  • HandleXMLTag (line 315–358): does not parse these fields from attributes
  • Fields are properly populated (PluginManager.cpp:193, 199) and converted (au3effectsutils.cpp:21, 28), but won't survive configuration reload
♻️ Duplicate comments (11)
au3/libraries/au3-lv2/LoadLV2.cpp (1)

156-161: ⚠️ Potential issue | 🟠 Major

One-shot load plus disabled custom-path merge regresses LV2 custom discovery.

If AutoRegisterPlugins() runs before plugin-manager custom paths are available, this now permanently skips those paths for the session. That breaks user-configured LV2 directories while SupportsCustomModulePaths() still reports support.

Also applies to: 210-221

src/effects/effects_base/ieffectloader.h (1)

16-17: 🧹 Nitpick | 🔵 Trivial

Document ensurePluginIsLoaded() boolean semantics.

The current bool contract is ambiguous (loaded now vs already loaded, and exact failure meaning). A short API comment would prevent misuse.

📝 Proposed documentation patch
 class IEffectLoader
 {
 public:
     virtual ~IEffectLoader() = default;
 
     virtual EffectFamily family() const = 0;
+    //! Ensures plugin for `effectId` is available for execution.
+    //! Returns true when plugin is ready (including already-loaded state), false on failure.
     virtual bool ensurePluginIsLoaded(const EffectId& effectId) const = 0;
 };
src/effects/effects_base/internal/effectsprovider.h (1)

20-20: ⚠️ Potential issue | 🟡 Minor

Remove unused TrackList forward declaration at line 20.

The forward declaration is not used in the implementation and should be removed.

src/effects/effects_base/internal/effectsproviderinitializer.cpp (1)

9-14: ⚠️ Potential issue | 🟠 Major

Remove the extra process-global init guard.

Line 9–Line 12 adds a second idempotency layer on top of initOnce() (Line 13). This can skip initialization for a fresh provider instance created later in the same process.

Suggested fix
 void EffectsProviderInitializer::callAfterSplashScreen()
 {
-    static bool effectsProviderInitialized = false;
-    if (effectsProviderInitialized) {
-        return;
-    }
     effectsProvider()->initOnce(*interactive(), *registerAudioPluginsScenario());
-    effectsProviderInitialized = true;
 }
au3/libraries/au3-module-manager/IPluginRegistry.h (1)

16-17: ⚠️ Potential issue | 🟠 Major

Return a result from registry persistence calls.

Once pluginregistry.cfg is gone, this interface is the only path for persisting plugin enabled/disabled state. void Load() / void Save() gives PluginManager no way to distinguish “no persisted state” from JSON read/write failure, so user toggles can be silently lost.

src/effects/effects_base/internal/effectsproviderinitializer.h (1)

6-11: ⚠️ Potential issue | 🟡 Minor

Missing include for muse::IInteractive.

Line 17 uses muse::IInteractive but the header is not included. Add the missing include to avoid compilation issues if IInteractive is not transitively included.

🔧 Proposed fix
 `#include` "ieffectsprovider.h"
 `#include` "ieffectsproviderinitializer.h"
 
 `#include` "framework/global/modularity/ioc.h"
 `#include` "framework/audioplugins/iregisteraudiopluginsscenario.h"
+#include "framework/interactive/iinteractive.h"
src/effects/effects_base/effectstypes.h (1)

46-54: 🧹 Nitpick | 🔵 Trivial

Consider using inline to avoid ODR issues.

These static const strings create separate copies in each translation unit that includes this header. Using inline const ensures a single definition across the program and reduces binary size.

src/effects/effects_base/internal/effectexecutionscenario.cpp (2)

441-473: ⚠️ Potential issue | 🟠 Major

Keep multi-clip execution atomic.

Each iteration reaches performEffectInternal(), which opens and commits its own TransactionScope. If clip N+1 fails, clips 1..N are already committed even though this method returns an error.


777-837: ⚠️ Potential issue | 🟠 Major

Restore preview context and playback region on every exit path.

After lines 779-783 swap in preview tracks/context and line 816 narrows the playback region, the early returns from Process() / playTracks() do not restore either one. stopPreview() later restores only the loop flag, so a failed or completed preview can still leave the effect bound to preview state and playback constrained to the preview window.

Also applies to: 843-873

src/effects/effects_base/internal/effectsprovider.cpp (1)

98-104: ⚠️ Potential issue | 🟠 Major

Filter the shared register down to effect resource types.

pluginInfoList() is not effect-only. This loop currently converts every enabled audio resource into an EffectMeta, so non-effect entries fall through as EffectFamily::Unknown and can leak into effect menus / loadEffect() failures.

Suggested fix
     const auto knownPlugins = knownPluginsRegister()->pluginInfoList();
     std::for_each(knownPlugins.begin(), knownPlugins.end(),
                   [this](const muse::audioplugins::AudioPluginInfo& info) {
-        if (info.enabled) {
+        if (info.enabled
+            && utils::fromMuseAudioResourceType(info.meta.type) != EffectFamily::Unknown) {
             m_effects.push_back(utils::museToAuEffectMeta(info.path, info.meta));
         }
     });
src/effects/effects_base/internal/effectsutils.cpp (1)

188-214: ⚠️ Potential issue | 🟠 Major

Don't deserialize missing persisted attributes as false/empty defaults.

attributeValue() returns {} when a key is absent. For migrated known_audio_plugins.json entries, that silently turns EFFECT_ACTIVATED_ATTRIBUTE, realtime support, and multi-clip support into false, changing plugin state just by loading the file.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6ad66e3f-db9a-4df2-b421-9e895769c73a

📥 Commits

Reviewing files that changed from the base of the PR and between b46f14574e05b7d2aafecdb36d5dd71de57dc8a3 and 89458bc8221abcc1d911fb872c850f38be6a74be.

📒 Files selected for processing (143)
  • au3/libraries/au3-audio-unit/AudioUnitEffectBase.cpp
  • au3/libraries/au3-audio-unit/AudioUnitEffectBase.h
  • au3/libraries/au3-builtin-effects/ChangePitchBase.h
  • au3/libraries/au3-builtin-effects/ChangeTempoBase.cpp
  • au3/libraries/au3-builtin-effects/ChangeTempoBase.h
  • au3/libraries/au3-builtin-effects/EqualizationBase.h
  • au3/libraries/au3-builtin-effects/Generator.h
  • au3/libraries/au3-builtin-effects/SBSMSBase.h
  • au3/libraries/au3-builtin-effects/ToneGenBase.h
  • au3/libraries/au3-builtin-effects/TruncSilenceBase.h
  • au3/libraries/au3-components/EffectInterface.h
  • au3/libraries/au3-effects/LoadEffects.cpp
  • au3/libraries/au3-exceptions/AudacityException.h
  • au3/libraries/au3-files/FileException.h
  • au3/libraries/au3-lv2/LV2EffectBase.cpp
  • au3/libraries/au3-lv2/LV2EffectBase.h
  • au3/libraries/au3-lv2/LoadLV2.cpp
  • au3/libraries/au3-module-manager/CMakeLists.txt
  • au3/libraries/au3-module-manager/IPluginRegistry.h
  • au3/libraries/au3-module-manager/PluginDescriptor.cpp
  • au3/libraries/au3-module-manager/PluginDescriptor.h
  • au3/libraries/au3-module-manager/PluginInterface.cpp
  • au3/libraries/au3-module-manager/PluginInterface.h
  • au3/libraries/au3-module-manager/PluginManager.cpp
  • au3/libraries/au3-module-manager/PluginManager.h
  • au3/libraries/au3-nyquist-effects/NyquistBase.cpp
  • au3/libraries/au3-nyquist-effects/NyquistBase.h
  • au3/libraries/au3-vst3/VST3EffectBase.cpp
  • au3/libraries/au3-vst3/VST3EffectBase.h
  • au3/libraries/au3-xml/XMLWriter.h
  • muse_framework
  • src/appshell/internal/startupscenario.cpp
  • src/appshell/internal/startupscenario.h
  • src/appshell/qml/Audacity/AppShell/appmenumodel.h
  • src/effects/audio_unit/CMakeLists.txt
  • src/effects/audio_unit/audiouniteffectsmodule.cpp
  • src/effects/audio_unit/audiouniteffectsmodule.h
  • src/effects/audio_unit/iaudiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiouniteffectloader.h
  • src/effects/audio_unit/internal/audiouniteffectsrepository.cpp
  • src/effects/audio_unit/internal/audiouniteffectsrepository.h
  • src/effects/audio_unit/internal/audiounitpluginsmetareader.cpp
  • src/effects/audio_unit/internal/audiounitpluginsmetareader.h
  • src/effects/audio_unit/internal/audiounitpluginsscanner.cpp
  • src/effects/audio_unit/internal/audiounitpluginsscanner.h
  • src/effects/audio_unit/view/audiounitview.h
  • src/effects/audio_unit/view/audiounitviewmodel.cpp
  • src/effects/audio_unit/view/audiounitviewmodel.h
  • src/effects/builtin/CMakeLists.txt
  • src/effects/builtin/builtineffectsmodule.cpp
  • src/effects/builtin/builtineffectsmodule.h
  • src/effects/builtin/ibuiltineffectsrepository.h
  • src/effects/builtin/internal/builtineffectsloader.h
  • src/effects/builtin/internal/builtineffectsmetareader.cpp
  • src/effects/builtin/internal/builtineffectsmetareader.h
  • src/effects/builtin/internal/builtineffectsrepository.cpp
  • src/effects/builtin/internal/builtineffectsrepository.h
  • src/effects/builtin/internal/builtineffectsscanner.h
  • src/effects/builtin/view/builtineffectmodel.cpp
  • src/effects/builtin/view/builtineffectmodel.h
  • src/effects/builtin/view/builtineffectviewloader.h
  • src/effects/builtin_collection/CMakeLists.txt
  • src/effects/builtin_collection/amplify/amplifyeffect.h
  • src/effects/builtin_collection/builtineffectscollectionmodule.cpp
  • src/effects/builtin_collection/builtineffectscollectionmodule.h
  • src/effects/builtin_collection/clickremoval/clickremovaleffect.h
  • src/effects/builtin_collection/dtmfgen/dtmfgenerator.h
  • src/effects/builtin_collection/dynamics/compressor/compressoreffect.h
  • src/effects/builtin_collection/dynamics/limiter/limitereffect.h
  • src/effects/builtin_collection/dynamics/timeline/abstractdynamicseffectinstancemodel.h
  • src/effects/builtin_collection/fade/fadeeffect.h
  • src/effects/builtin_collection/internal/builtincollectionloader.cpp
  • src/effects/builtin_collection/internal/builtincollectionloader.h
  • src/effects/builtin_collection/internal/builtineffectsloader.cpp
  • src/effects/builtin_collection/internal/builtineffectsloader.h
  • src/effects/builtin_collection/invert/inverteffect.h
  • src/effects/builtin_collection/loudness/normalizeloudnesseffect.h
  • src/effects/builtin_collection/noisegen/noisegenerator.h
  • src/effects/builtin_collection/noisereduction/noisereductioneffect.h
  • src/effects/builtin_collection/normalize/normalizeeffect.h
  • src/effects/builtin_collection/removedcoffset/removedcoffseteffect.h
  • src/effects/builtin_collection/repair/repaireffect.h
  • src/effects/builtin_collection/reverb/reverbeffect.h
  • src/effects/builtin_collection/reverse/reverseeffect.h
  • src/effects/effects_base/CMakeLists.txt
  • src/effects/effects_base/effectsmodule.cpp
  • src/effects/effects_base/effectsmodule.h
  • src/effects/effects_base/effectstypes.h
  • src/effects/effects_base/ieffectexecutionscenario.h
  • src/effects/effects_base/ieffectinstancesregister.h
  • src/effects/effects_base/ieffectloader.h
  • src/effects/effects_base/ieffectloadersregister.h
  • src/effects/effects_base/ieffectsprovider.h
  • src/effects/effects_base/ieffectsproviderinitializer.h
  • src/effects/effects_base/ieffectviewcontroller.h
  • src/effects/effects_base/internal/abstractaudiopluginmetareader.cpp
  • src/effects/effects_base/internal/abstractviewlauncher.h
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.cpp
  • src/effects/effects_base/internal/au3/au3audiopluginmetareader.h
  • src/effects/effects_base/internal/au3/au3audiopluginscanner.cpp
  • src/effects/effects_base/internal/au3/au3audiopluginscanner.h
  • src/effects/effects_base/internal/au3/au3effectsutils.cpp
  • src/effects/effects_base/internal/au3/au3effectsutils.h
  • src/effects/effects_base/internal/au3/au3pluginregistry.cpp
  • src/effects/effects_base/internal/au3/au3pluginregistry.h
  • src/effects/effects_base/internal/au3effectloader.cpp
  • src/effects/effects_base/internal/au3effectloader.h
  • src/effects/effects_base/internal/effectexecutionscenario.cpp
  • src/effects/effects_base/internal/effectexecutionscenario.h
  • src/effects/effects_base/internal/effectinstancesregister.h
  • src/effects/effects_base/internal/effectloadersregister.cpp
  • src/effects/effects_base/internal/effectloadersregister.h
  • src/effects/effects_base/internal/effectparametersprovider.h
  • src/effects/effects_base/internal/effectpresetsprovider.h
  • src/effects/effects_base/internal/effectpresetsscenario.h
  • src/effects/effects_base/internal/effectsactionscontroller.h
  • src/effects/effects_base/internal/effectsmenuprovider.h
  • src/effects/effects_base/internal/effectsprovider.cpp
  • src/effects/effects_base/internal/effectsprovider.h
  • src/effects/effects_base/internal/effectsproviderinitializer.cpp
  • src/effects/effects_base/internal/effectsproviderinitializer.h
  • src/effects/effects_base/internal/effectsrepositoryhelper.cpp
  • src/effects/effects_base/internal/effectsrepositoryhelper.h
  • src/effects/effects_base/internal/effectsuiactions.h
  • src/effects/effects_base/internal/effectsutils.cpp
  • src/effects/effects_base/internal/effectsutils.h
  • src/effects/effects_base/internal/effectviewcontroller.cpp
  • src/effects/effects_base/internal/effectviewcontroller.h
  • src/effects/effects_base/internal/realtimeeffectservice.h
  • src/effects/effects_base/iparameterextractorregistry.h
  • src/effects/effects_base/view/abstracteffectviewmodel.h
  • src/effects/effects_base/view/destructiveeffectviewerdialogmodel.h
  • src/effects/effects_base/view/effectparameterslistmodel.h
  • src/effects/effects_base/view/effectpresetsbarmodel.h
  • src/effects/effects_base/view/effectsavecontextmenu.h
  • src/effects/effects_base/view/generatedeffectviewermodel.cpp
  • src/effects/effects_base/view/generatedeffectviewermodel.h
  • src/effects/effects_base/view/presetscontextmenumodel.h
  • src/effects/effects_base/view/realtimeeffectviewerdialogmodel.h
  • src/effects/lv2/CMakeLists.txt
  • src/effects/lv2/ilv2effectsrepository.h
  • src/effects/lv2/internal/lv2effectloader.h
  • src/effects/lv2/internal/lv2effectsrepository.cpp
💤 Files with no reviewable changes (17)
  • src/effects/audio_unit/iaudiouniteffectsrepository.h
  • src/effects/audio_unit/view/audiounitviewmodel.h
  • src/effects/builtin_collection/internal/builtineffectsloader.h
  • src/effects/lv2/ilv2effectsrepository.h
  • au3/libraries/au3-module-manager/PluginInterface.cpp
  • src/effects/audio_unit/internal/audiounitpluginsscanner.cpp
  • src/effects/lv2/internal/lv2effectsrepository.cpp
  • src/effects/audio_unit/internal/audiouniteffectsrepository.h
  • src/effects/builtin/ibuiltineffectsrepository.h
  • src/effects/builtin/internal/builtineffectsrepository.h
  • src/effects/builtin_collection/internal/builtineffectsloader.cpp
  • src/effects/builtin/internal/builtineffectsrepository.cpp
  • au3/libraries/au3-module-manager/PluginInterface.h
  • src/effects/effects_base/internal/effectsrepositoryhelper.h
  • src/effects/effects_base/internal/effectsrepositoryhelper.cpp
  • src/effects/audio_unit/internal/audiouniteffectsrepository.cpp
  • src/effects/effects_base/internal/abstractaudiopluginmetareader.cpp

Comment on lines +78 to +81
const wxString& PluginDescriptor::GetDescription() const
{
return mDescription;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Persist the new descriptor fields through XML round-trips.

description and supportsMultipleClipSelection are now part of PluginDescriptor, but WriteXML()/HandleXMLTag() still ignore both. Any descriptor that is serialized and loaded back will silently lose them, which breaks the new persisted metadata path after restart/reload.

Suggested fix
 namespace {
 constexpr auto AttrID = "id";
 constexpr auto AttrPath = "path";
 constexpr auto AttrName = "name";
+constexpr auto AttrDescription = "description";
 constexpr auto AttrVendor = "vendor";
 constexpr auto AttrVersion = "version";
 constexpr auto AttrEffectFamily = "effect_family";
 constexpr auto AttrProviderID = "provider";
@@
 constexpr auto AttrEffectRealtime = "effect_realtime";
 constexpr auto AttrEffectAutomatable = "effect_automatable";
 constexpr auto AttrEffectInteractive = "effect_interactive";
+constexpr auto AttrEffectMultipleClipSelection = "effect_multiple_clip_selection";
 }
@@
 void PluginDescriptor::WriteXML(XMLWriter& writer) const
 {
     writer.StartTag(XMLNodeName);
@@
     writer.WriteAttr(AttrName, GetSymbol().Internal());
+    writer.WriteAttr(AttrDescription, GetDescription());
     writer.WriteAttr(AttrVendor, GetVendor());
     writer.WriteAttr(AttrVersion, GetUntranslatedVersion());
     if (GetPluginType() == PluginTypeEffect) {
         writer.WriteAttr(AttrEffectFamily, GetEffectFamily());
         writer.WriteAttr(AttrEffectType, GetEffectType());
         writer.WriteAttr(AttrEffectDefault, IsEffectDefault());
         writer.WriteAttr(AttrEffectRealtime, SerializeRealtimeSupport());
         writer.WriteAttr(AttrEffectAutomatable, IsEffectAutomatable());
         writer.WriteAttr(AttrEffectInteractive, IsEffectInteractive());
+        writer.WriteAttr(AttrEffectMultipleClipSelection, SupportsMultipleClipSelection());
     }
     writer.EndTag(XMLNodeName);
 }
@@
             } else if (key == AttrName) {
                 SetSymbol(attr.ToWString());
+            } else if (key == AttrDescription) {
+                SetDescription(attr.ToWString());
             } else if (key == AttrVendor) {
                 SetVendor(attr.ToWString());
             } else if (key == AttrVersion) {
                 SetVersion(attr.ToWString());
             } else if (key == AttrEffectFamily) {
                 SetEffectFamily(attr.ToWString());
+            } else if (key == AttrEffectMultipleClipSelection) {
+                SetSupportsMultipleClipSelection(attr.Get<bool>());
             } else if (key == AttrProviderID) {
                 SetProviderID(attr.ToWString());
             }

Also applies to: 128-131, 215-223

🧰 Tools
🪛 Cppcheck (2.20.0)

[style] 78-78: The function 'GetDescription' is never used.

(unusedFunction)

Comment on lines +81 to +87
desc.SetEffectInteractive(effect->IsInteractive());
desc.SetEffectDefault(effect->IsDefault());
desc.SetRealtimeSupport(effect->RealtimeSupport());
desc.SetEffectAutomatable(effect->SupportsAutomation());

desc.SetEnabled(true);
desc.SetValid(true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Honor the effect's default activation state on discovery.

desc.SetEnabled(true) force-enables every discovered effect, even when line 82 marks it as default-disabled. That writes the wrong initial activation state into the unified metadata store.

Suggested fix
             desc.SetEffectInteractive(effect->IsInteractive());
             desc.SetEffectDefault(effect->IsDefault());
             desc.SetRealtimeSupport(effect->RealtimeSupport());
             desc.SetEffectAutomatable(effect->SupportsAutomation());
 
-            desc.SetEnabled(true);
+            desc.SetEnabled(effect->IsDefault());
             desc.SetValid(true);

Comment on lines +59 to +87
void Au3PluginRegistry::Save(const ::PluginMap& pluginMap)
{
AudioPluginInfoList newPlugins;

for (const auto& [id, plug] : pluginMap) {
if (plug.GetPluginType() != PluginTypeEffect) {
continue;
}

const EffectMeta meta = toEffectMeta(plug);

AudioPluginInfo info;
info.type = AudioPluginType::Fx;
info.meta = utils::auToMuseEffectMeta(meta);
info.path = muse::io::path_t(au3::wxToString(plug.GetPath()));
info.enabled = true;

newPlugins.push_back(std::move(info));
}

const auto filePath = audioPluginsConfiguration()->knownAudioPluginsFilePath();
if (fileSystem()->exists(filePath)) {
// Remove the file and reload the register.
fileSystem()->remove(filePath);
knownPlugins()->load();
}

knownPlugins()->registerPlugins(newPlugins);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Clarify the two-level enabled semantics in Save().

The code correctly distinguishes two concepts:

  • info.enabled = true (Line 74): Registry-level validity — the plugin is registered and functional
  • meta.isActivated: User-level enable/disable toggle — persisted via auToMuseEffectMeta(meta) into info.meta.attributes

However, the destructive file deletion at Lines 79-84 before registerPlugins() could cause data loss if the process crashes between deletion and re-registration. Consider using an atomic write pattern (write to temp file, then rename).

♻️ Suggested atomic write pattern
-    const auto filePath = audioPluginsConfiguration()->knownAudioPluginsFilePath();
-    if (fileSystem()->exists(filePath)) {
-        // Remove the file and reload the register.
-        fileSystem()->remove(filePath);
-        knownPlugins()->load();
-    }
-
-    knownPlugins()->registerPlugins(newPlugins);
+    // Consider adding an atomic update method to IKnownAudioPluginsRegister
+    // that writes to a temp file and renames, or use a transaction pattern
+    knownPlugins()->replacePlugins(newPlugins);

If IKnownAudioPluginsRegister doesn't support atomic updates, the current approach works but has a small crash-safety window.

Comment on lines +537 to +561
au3::Au3WaveTrack* newTrack = nullptr;
{
// We don't yet know the effect type for code in the Nyquist Prompt, so
// assume it requires a track and handle errors when the effect runs.
if ((effect->GetType() == EffectTypeGenerate || effect->GetPath() == NYQUIST_PROMPT_ID) && (effect->mNumTracks == 0)) {
auto track = effect->mFactory->Create();
track->SetName(effect->mTracks->MakeUniqueTrackName(au3::Au3WaveTrack::GetDefaultAudioTrackNamePreference()));
// The track-added event should be issued synchronously.
newTrack = effect->mTracks->Add(
track, TrackList::DoAssignId::Yes,
TrackList::EventPublicationSynchrony::Synchronous);
newTrack->SetSelected(true);
globalContext()->currentTrackeditProject()->notifyAboutTrackAdded(au3::DomConverter::track(newTrack));
}
}

//! ============================================================================
//! NOTE Step 2 - process
//! ============================================================================

// common things used below
muse::Ret success = make_ret(Ret::Code::Ok);
{
//! NOTE Step 2.3 - open transaction
TransactionScope trans(project, "Effect");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Start the transaction before creating generator tracks.

newTrack is added before TransactionScope trans(project, "Effect") starts. A successful generator run can therefore leave track creation outside the undo/rollback boundary.

Comment on lines +21 to +24
muse::GlobalInject<IEffectInstancesRegister> instancesRegister;

muse::ContextInject<muse::IInteractive> interactive{ this };
muse::ContextInject<IEffectPresetsProvider> presetsProvider{ this };
muse::ContextInject<IEffectInstancesRegister> instancesRegister{ this };
muse::Inject<muse::IInteractive> interactive{ this };
muse::Inject<IEffectPresetsProvider> presetsProvider{ this };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Avoid deprecated muse::Inject; prefer ContextInject or GlobalInject.

Lines 23-24 use muse::Inject<...>{ this }, which is deprecated per codebase guidelines. Since EffectPresetsScenario inherits from muse::Contextable, these should use muse::ContextInject<...>{ this } for context-aware injection, or muse::GlobalInject if the dependencies are global singletons.

Suggested fix
     muse::GlobalInject<IEffectInstancesRegister> instancesRegister;

-    muse::Inject<muse::IInteractive> interactive{ this };
-    muse::Inject<IEffectPresetsProvider> presetsProvider{ this };
+    muse::ContextInject<muse::IInteractive> interactive{ this };
+    muse::ContextInject<IEffectPresetsProvider> presetsProvider{ this };

Based on learnings: "In the Audacity (AU4) codebase, do not use muse::Inject (deprecated). For context-aware injection, use muse::ContextInject. For global scope, use muse::GlobalInject."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
muse::GlobalInject<IEffectInstancesRegister> instancesRegister;
muse::ContextInject<muse::IInteractive> interactive{ this };
muse::ContextInject<IEffectPresetsProvider> presetsProvider{ this };
muse::ContextInject<IEffectInstancesRegister> instancesRegister{ this };
muse::Inject<muse::IInteractive> interactive{ this };
muse::Inject<IEffectPresetsProvider> presetsProvider{ this };
muse::GlobalInject<IEffectInstancesRegister> instancesRegister;
muse::ContextInject<muse::IInteractive> interactive{ this };
muse::ContextInject<IEffectPresetsProvider> presetsProvider{ this };

Comment on lines +16 to +17
muse::Inject<muse::audioplugins::IRegisterAudioPluginsScenario> registerAudioPluginsScenario { this };
muse::Inject<muse::IInteractive> interactive { this };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Use muse::ContextInject instead of deprecated muse::Inject.

Per codebase guidelines, muse::Inject is deprecated. For context-aware injection in classes inheriting from muse::Contextable, use muse::ContextInject.

♻️ Proposed fix
-    muse::Inject<muse::audioplugins::IRegisterAudioPluginsScenario> registerAudioPluginsScenario { this };
-    muse::Inject<muse::IInteractive> interactive { this };
+    muse::ContextInject<muse::audioplugins::IRegisterAudioPluginsScenario> registerAudioPluginsScenario { this };
+    muse::ContextInject<muse::IInteractive> interactive { this };

Based on learnings: "In the Audacity (AU4) codebase, do not use muse::Inject (deprecated). For context-aware injection, use muse::ContextInject."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
muse::Inject<muse::audioplugins::IRegisterAudioPluginsScenario> registerAudioPluginsScenario { this };
muse::Inject<muse::IInteractive> interactive { this };
muse::ContextInject<muse::audioplugins::IRegisterAudioPluginsScenario> registerAudioPluginsScenario { this };
muse::ContextInject<muse::IInteractive> interactive { this };

Comment on lines +20 to +21
muse::GlobalInject<IEffectsProvider> effectsProvider;
muse::Inject<IEffectViewLaunchRegister> viewLaunchRegister{ this };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if the file exists and examine its structure
if [ -f "src/effects/effects_base/internal/effectviewcontroller.h" ]; then
  echo "=== File exists: effectviewcontroller.h ==="
  cat -n "src/effects/effects_base/internal/effectviewcontroller.h"
else
  echo "File not found. Searching for similar files..."
  fd "effectviewcontroller" --type f
fi

Repository: audacity/audacity

Length of output: 1208


🏁 Script executed:

#!/bin/bash
# Check the referenced learning file to understand the pattern
echo "=== Checking referenced learning file ==="
cat -n "src/record/view/common/leadinrecordingindicatormodel.h" | head -30

echo -e "\n=== Searching for muse::ContextInject usage patterns ==="
rg "muse::ContextInject" --type cpp --type h -A 1 -B 1 | head -50

echo -e "\n=== Searching for muse::Inject usage in Contextable classes ==="
rg "public muse::Contextable" --type cpp --type h -A 10 | head -80

Repository: audacity/audacity

Length of output: 12863


Replace deprecated muse::Inject with muse::ContextInject for context-aware injection.

EffectViewController inherits from muse::Contextable, so dependencies should be resolved from the context scope using muse::ContextInject, not the deprecated muse::Inject. Using muse::Inject here violates the AU4 dependency injection pattern observed throughout the codebase.

Proposed fix
     muse::GlobalInject<IEffectsProvider> effectsProvider;
-    muse::Inject<IEffectViewLaunchRegister> viewLaunchRegister{ this };
+    muse::ContextInject<IEffectViewLaunchRegister> viewLaunchRegister{ this };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
muse::GlobalInject<IEffectsProvider> effectsProvider;
muse::Inject<IEffectViewLaunchRegister> viewLaunchRegister{ this };
muse::GlobalInject<IEffectsProvider> effectsProvider;
muse::ContextInject<IEffectViewLaunchRegister> viewLaunchRegister{ this };

@saintmatthieu
saintmatthieu force-pushed the 10593-no-more-pluginregistry.cfg branch from a18cc21 to 61e3224 Compare April 15, 2026 09:13
@saintmatthieu
saintmatthieu merged commit d14d3c6 into audacity:master Apr 15, 2026
5 checks passed
saintmatthieu added a commit to saintmatthieu/audacity that referenced this pull request Apr 15, 2026
This reverts commit d14d3c6, reversing
changes made to eb4f557.
@coderabbitai coderabbitai Bot mentioned this pull request Apr 15, 2026
9 of 10 tasks
saintmatthieu added a commit that referenced this pull request Apr 15, 2026
This reverts commit d14d3c6, reversing
changes made to eb4f557.
saintmatthieu added a commit to saintmatthieu/audacity that referenced this pull request Apr 15, 2026
saintmatthieu added a commit that referenced this pull request Apr 15, 2026
This reverts commit 410ae3e, reversing
changes made to 0fdad64.
@coderabbitai coderabbitai Bot mentioned this pull request Apr 16, 2026
10 of 12 tasks
dozzzzer added a commit to dozzzzer/audacity that referenced this pull request Apr 16, 2026
Plugins cached by older code lack attributes like 'type' in
known_audio_plugins.json. Reading them via museToAuEffectMeta()
triggered IF_ASSERT_FAILED → abort() on every startup.

reloadEffects() now detects entries with an empty 'type' attribute
(the sentinel for old-format records), unregisters them so they are
evicted from the cache, and continues without crashing. They will be
re-scanned with current metadata on the next plugin registration pass.

Fixes crash introduced by RIP pluginregistry.cfg (audacity#10597).

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@saintmatthieu
saintmatthieu deleted the 10593-no-more-pluginregistry.cfg branch August 28, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Effect-enabled toggle implementation

3 participants