Repository navigation
RIP pluginregistry.cfg - #10597
RIP pluginregistry.cfg#10597saintmatthieu merged 50 commits into
Conversation
8d0b30d to
878be8b
Compare
878be8b to
c0bdd1a
Compare
|
✅ Actions performedReview triggered.
|
|
Important Review skippedToo many files! This PR contains 194 files, which is 44 over the limit of 150. ⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 89458bc8221abcc1d911fb872c850f38be6a74be and 61e3224. 📒 Files selected for processing (194)
You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis 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 Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Suggested reviewers
|
There was a problem hiding this comment.
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 | 🟠 MajorExcluded 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 whereEnablePlugin(..., false)is applied. Already-registered plugins skip this path entirely. Since theexcludedflag is compile-time metadata stored only in theEntryregistry—not persisted inPluginDescriptor—and there is no reconciliation logic inInitializePlugins(), a plugin marked asexcludedafter 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 | 🔴 CriticalAuto-registration is re-enabling persisted effects on startup.
Load()restores the savedEnabled/Validflags first, but the followingmodule->AutoRegisterPlugins(*this)path callsRegisterPlugin(...), which resets them totrueon 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
overwriteparameter semantics inSave()and the expected behavior ofLoad()(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: KeepcanReadMeta()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-codingtrue.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 aboutsupportsMultipleClipSelectionis acceptable for incremental development.Would you like me to open an issue to track the TODO for making
supportsMultipleClipSelectiona 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
Au3EffectLoaderonly stores the reference without using it during construction, passing an unconstructed member to the base class is a fragile pattern. IfAu3EffectLoaderis later modified to access the provider reference during construction, this would cause undefined behavior. The same pattern is used inLv2EffectLoader, 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_modulebeing 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
#includedirectives. 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 witheffectsutils.h.The
toEffectFamily(AudioResourceType)function duplicates the logic inutils::fromMuseAudioResourceType()defined ineffectsutils.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(...)withutils::fromMuseAudioResourceType(...).src/effects/effects_base/internal/effectsutils.cpp (2)
134-149: Inconsistent string literal types ineffectTypeFromString.The function compares against narrow string literals (e.g.,
"Analyzer") whileeffectTypeToStringuses wide string literals (e.g.,u"Analyzer"). Whilemuse::Stringlikely 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
attributeValuehelper logs an assertion failure but returns a default-constructed value when an attribute is missing. This could lead toEffectMetaobjects with invalid/default fields that silently propagate through the system. Consider whether a more explicit error handling strategy (e.g., returningstd::optionalor throwing) would be more appropriate for catching data corruption issues.au3/libraries/au3-module-manager/PluginManager.h (1)
234-235:REGVERCURappears to be unused dead code.No functional code references
REGVERCUR. Its only mention is in a comment inEffectInterface.h:299as a reminder for developers to update it when modifying theRealtimeSinceenum. Sincepluginregistry.cfgis still present in the codebase (FileNames.cppstill returns its path), the constant is not tied to its removal. Consider removingREGVERCURif 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.cppau3/libraries/au3-exceptions/AudacityException.hau3/libraries/au3-files/FileException.hau3/libraries/au3-module-manager/CMakeLists.txtau3/libraries/au3-module-manager/IPluginRegistry.hau3/libraries/au3-module-manager/PluginDescriptor.hau3/libraries/au3-module-manager/PluginInterface.cppau3/libraries/au3-module-manager/PluginInterface.hau3/libraries/au3-module-manager/PluginManager.cppau3/libraries/au3-module-manager/PluginManager.hau3/libraries/au3-xml/XMLWriter.hmuse_frameworksrc/appshell/internal/startupscenario.cppsrc/appshell/internal/startupscenario.hsrc/effects/audio_unit/CMakeLists.txtsrc/effects/audio_unit/audiouniteffectsmodule.cppsrc/effects/audio_unit/audiouniteffectsmodule.hsrc/effects/audio_unit/iaudiouniteffectsrepository.hsrc/effects/audio_unit/internal/audiouniteffectloader.hsrc/effects/audio_unit/internal/audiouniteffectsrepository.cppsrc/effects/audio_unit/internal/audiouniteffectsrepository.hsrc/effects/audio_unit/internal/audiounitpluginsscanner.cppsrc/effects/audio_unit/internal/audiounitpluginsscanner.hsrc/effects/builtin/CMakeLists.txtsrc/effects/builtin/builtineffectsmodule.cppsrc/effects/builtin/internal/builtineffectsmetareader.cppsrc/effects/builtin/internal/builtineffectsmetareader.hsrc/effects/builtin/internal/builtineffectsscanner.cppsrc/effects/builtin/internal/builtineffectsscanner.hsrc/effects/builtin_collection/internal/builtineffectsloader.cppsrc/effects/effects_base/CMakeLists.txtsrc/effects/effects_base/effectsmodule.cppsrc/effects/effects_base/effectstypes.hsrc/effects/effects_base/ieffectloader.hsrc/effects/effects_base/ieffectloadersregister.hsrc/effects/effects_base/internal/au3/au3audiopluginmetareader.cppsrc/effects/effects_base/internal/au3/au3audiopluginmetareader.hsrc/effects/effects_base/internal/au3/au3audiopluginscanner.cppsrc/effects/effects_base/internal/au3/au3audiopluginscanner.hsrc/effects/effects_base/internal/au3/au3effectsutils.cppsrc/effects/effects_base/internal/au3/au3effectsutils.hsrc/effects/effects_base/internal/au3/au3pluginregistry.cppsrc/effects/effects_base/internal/au3/au3pluginregistry.hsrc/effects/effects_base/internal/au3effectloader.cppsrc/effects/effects_base/internal/au3effectloader.hsrc/effects/effects_base/internal/effectloadersregister.cppsrc/effects/effects_base/internal/effectloadersregister.hsrc/effects/effects_base/internal/effectsprovider.cppsrc/effects/effects_base/internal/effectsprovider.hsrc/effects/effects_base/internal/effectsrepositoryhelper.hsrc/effects/effects_base/internal/effectsutils.cppsrc/effects/effects_base/internal/effectsutils.hsrc/effects/lv2/CMakeLists.txtsrc/effects/lv2/ilv2effectsrepository.hsrc/effects/lv2/internal/lv2effectloader.hsrc/effects/lv2/internal/lv2effectsrepository.cppsrc/effects/lv2/internal/lv2effectsrepository.hsrc/effects/lv2/internal/lv2pluginmetareader.cppsrc/effects/lv2/internal/lv2pluginmetareader.hsrc/effects/lv2/internal/lv2pluginsscanner.cppsrc/effects/lv2/internal/lv2pluginsscanner.hsrc/effects/lv2/lv2effectsmodule.cppsrc/effects/lv2/lv2effectsmodule.hsrc/effects/lv2/view/lv2viewmodel.cppsrc/effects/nyquist/CMakeLists.txtsrc/effects/nyquist/internal/nyquisteffectsrepository.cppsrc/effects/nyquist/internal/nyquisteffectsrepository.hsrc/effects/nyquist/internal/nyquistpluginsmetareader.cppsrc/effects/nyquist/internal/nyquistpluginsmetareader.hsrc/effects/nyquist/internal/nyquistpluginsscanner.cppsrc/effects/nyquist/internal/nyquistpluginsscanner.hsrc/effects/nyquist/inyquisteffectsrepository.hsrc/effects/nyquist/nyquisteffectsmodule.cppsrc/effects/nyquist/nyquisteffectsmodule.hsrc/effects/nyquist/nyquistprompt/nyquistpromptloader.cppsrc/effects/vst/CMakeLists.txtsrc/effects/vst/internal/vst3effectloader.hsrc/effects/vst/internal/vst3pluginsmetareader.cppsrc/effects/vst/internal/vst3pluginsmetareader.hsrc/effects/vst/internal/vst3pluginsscanner.cppsrc/effects/vst/internal/vst3pluginsscanner.hsrc/effects/vst/internal/vsteffectsrepository.cppsrc/effects/vst/internal/vsteffectsrepository.hsrc/effects/vst/ivsteffectsrepository.hsrc/effects/vst/vsteffectsmodule.cppsrc/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
| Lv2PluginsScanner() | ||
| : Au3AudioPluginScanner(m_lv2Module) {} | ||
|
|
||
| private: | ||
| ::LV2EffectsModule m_lv2Module; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
fd -t f -e h -e cpp | grep -E "(Au3AudioPluginScanner|lv2pluginsscanner)" | head -20Repository: audacity/audacity
Length of output: 105
🏁 Script executed:
find . -name "*.h" -o -name "*.cpp" | xargs grep -l "class Au3AudioPluginScanner" 2>/dev/nullRepository: audacity/audacity
Length of output: 126
🏁 Script executed:
rg "class Au3AudioPluginScanner" -A 20Repository: audacity/audacity
Length of output: 989
🏁 Script executed:
rg "class Lv2PluginsScanner" -A 10 src/effects/lv2/internal/lv2pluginsscanner.hRepository: audacity/audacity
Length of output: 248
🏁 Script executed:
rg "class LV2EffectsModule|struct LV2EffectsModule" -A 10Repository: audacity/audacity
Length of output: 843
🏁 Script executed:
rg "LV2EffectsModule" src/effects/lv2/internal/lv2pluginsscanner.h -B 5 -A 15Repository: audacity/audacity
Length of output: 191
🏁 Script executed:
find . -name "*.h" -o -name "*.cpp" | xargs grep -l "LV2EffectsModule" 2>/dev/null | head -10Repository: audacity/audacity
Length of output: 385
🏁 Script executed:
rg "class LV2EffectsModule" au3/libraries/au3-lv2/ -A 20Repository: audacity/audacity
Length of output: 965
🏁 Script executed:
cat au3/libraries/au3-lv2/LoadLV2.h | head -100Repository: audacity/audacity
Length of output: 2710
🏁 Script executed:
cat src/effects/effects_base/internal/au3/au3audiopluginscanner.hRepository: audacity/audacity
Length of output: 469
🏁 Script executed:
rg "class Au3AudioPluginScanner" -A 50 src/effects/effects_base/internal/au3/au3audiopluginscanner.hRepository: audacity/audacity
Length of output: 307
🏁 Script executed:
find . -name "au3audiopluginscanner.cpp" | head -5Repository: 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.
c0bdd1a to
bf62f67
Compare
There was a problem hiding this comment.
Actionable comments posted: 5
♻️ Duplicate comments (2)
src/effects/effects_base/internal/effectloadersregister.cpp (1)
8-17:⚠️ Potential issue | 🟠 MajorGuard 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
pathis 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) toAu3EffectLoader, binding it tom_pluginProvider. While the constructor currently only performs assertions and defers actual provider use toinit(), 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 untilinit()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—
callOnLauncherchecks 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, andTrackListare 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: Considerinlinefor header-defined constants to avoid ODR issues.These
static conststring definitions in a header will create separate copies in each translation unit that includes this file, potentially leading to linker bloat. Usinginline 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.
effectTypeFromStringcompares against narrow string literals (e.g.,"Analyzer") whileeffectTypeToStringreturns wide string literals (e.g.,u"Analyzer"). Althoughmuse::Stringlikely handles implicit conversion, this inconsistency could cause issues and is inconsistent with the pattern used ineffectFamilyFromString(lines 26-35) which correctly uses wide literals likeu"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 unusedTrackListforward declaration.The
TrackListclass 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::preparingPreviewProgressis misleadingly named. At line 663,originCtxcaptures the originaleffect.mProgressvalue (which may benullptror 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 tonewCtx.preparingPreviewProgressand applied temporarily; the original is preserved inoriginCtxfor restoration. The restoration at line 867 is therefore correct. Consider renamingpreparingPreviewProgresstooriginalProgressfor 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.cppau3/libraries/au3-exceptions/AudacityException.hau3/libraries/au3-files/FileException.hau3/libraries/au3-module-manager/CMakeLists.txtau3/libraries/au3-module-manager/IPluginRegistry.hau3/libraries/au3-module-manager/PluginDescriptor.hau3/libraries/au3-module-manager/PluginInterface.cppau3/libraries/au3-module-manager/PluginInterface.hau3/libraries/au3-module-manager/PluginManager.cppau3/libraries/au3-module-manager/PluginManager.hau3/libraries/au3-xml/XMLWriter.hmuse_frameworksrc/appshell/internal/startupscenario.cppsrc/appshell/internal/startupscenario.hsrc/appshell/qml/Audacity/AppShell/appmenumodel.hsrc/effects/audio_unit/CMakeLists.txtsrc/effects/audio_unit/audiouniteffectsmodule.cppsrc/effects/audio_unit/audiouniteffectsmodule.hsrc/effects/audio_unit/iaudiouniteffectsrepository.hsrc/effects/audio_unit/internal/audiouniteffectloader.hsrc/effects/audio_unit/internal/audiouniteffectsrepository.cppsrc/effects/audio_unit/internal/audiouniteffectsrepository.hsrc/effects/audio_unit/internal/audiounitpluginsscanner.cppsrc/effects/audio_unit/internal/audiounitpluginsscanner.hsrc/effects/audio_unit/view/audiounitview.hsrc/effects/audio_unit/view/audiounitviewmodel.hsrc/effects/builtin/CMakeLists.txtsrc/effects/builtin/builtineffectsmodule.cppsrc/effects/builtin/builtineffectsmodule.hsrc/effects/builtin/internal/builtineffectsloader.hsrc/effects/builtin/internal/builtineffectsmetareader.cppsrc/effects/builtin/internal/builtineffectsmetareader.hsrc/effects/builtin/internal/builtineffectsscanner.cppsrc/effects/builtin/internal/builtineffectsscanner.hsrc/effects/builtin/view/builtineffectmodel.cppsrc/effects/builtin/view/builtineffectmodel.hsrc/effects/builtin/view/builtineffectviewloader.hsrc/effects/builtin_collection/CMakeLists.txtsrc/effects/builtin_collection/builtineffectscollectionmodule.cppsrc/effects/builtin_collection/builtineffectscollectionmodule.hsrc/effects/builtin_collection/dynamics/timeline/abstractdynamicseffectinstancemodel.hsrc/effects/builtin_collection/internal/builtincollectionloader.cppsrc/effects/builtin_collection/internal/builtincollectionloader.hsrc/effects/effects_base/CMakeLists.txtsrc/effects/effects_base/effectsmodule.cppsrc/effects/effects_base/effectsmodule.hsrc/effects/effects_base/effectstypes.hsrc/effects/effects_base/ieffectexecutionscenario.hsrc/effects/effects_base/ieffectinstancesregister.hsrc/effects/effects_base/ieffectloader.hsrc/effects/effects_base/ieffectloadersregister.hsrc/effects/effects_base/ieffectsprovider.hsrc/effects/effects_base/ieffectviewcontroller.hsrc/effects/effects_base/internal/abstractviewlauncher.hsrc/effects/effects_base/internal/au3/au3audiopluginmetareader.cppsrc/effects/effects_base/internal/au3/au3audiopluginmetareader.hsrc/effects/effects_base/internal/au3/au3audiopluginscanner.cppsrc/effects/effects_base/internal/au3/au3audiopluginscanner.hsrc/effects/effects_base/internal/au3/au3effectsutils.cppsrc/effects/effects_base/internal/au3/au3effectsutils.hsrc/effects/effects_base/internal/au3/au3pluginregistry.cppsrc/effects/effects_base/internal/au3/au3pluginregistry.hsrc/effects/effects_base/internal/au3effectloader.cppsrc/effects/effects_base/internal/au3effectloader.hsrc/effects/effects_base/internal/effectexecutionscenario.cppsrc/effects/effects_base/internal/effectexecutionscenario.hsrc/effects/effects_base/internal/effectinstancesregister.hsrc/effects/effects_base/internal/effectloadersregister.cppsrc/effects/effects_base/internal/effectloadersregister.hsrc/effects/effects_base/internal/effectparametersprovider.hsrc/effects/effects_base/internal/effectpresetsprovider.hsrc/effects/effects_base/internal/effectpresetsscenario.hsrc/effects/effects_base/internal/effectsactionscontroller.hsrc/effects/effects_base/internal/effectsmenuprovider.hsrc/effects/effects_base/internal/effectsprovider.cppsrc/effects/effects_base/internal/effectsprovider.hsrc/effects/effects_base/internal/effectsrepositoryhelper.hsrc/effects/effects_base/internal/effectsuiactions.hsrc/effects/effects_base/internal/effectsutils.cppsrc/effects/effects_base/internal/effectsutils.hsrc/effects/effects_base/internal/effectviewcontroller.cppsrc/effects/effects_base/internal/effectviewcontroller.hsrc/effects/effects_base/internal/realtimeeffectservice.hsrc/effects/effects_base/iparameterextractorregistry.hsrc/effects/effects_base/view/abstracteffectviewmodel.hsrc/effects/effects_base/view/destructiveeffectviewerdialogmodel.hsrc/effects/effects_base/view/effectparameterslistmodel.hsrc/effects/effects_base/view/effectpresetsbarmodel.hsrc/effects/effects_base/view/effectsavecontextmenu.hsrc/effects/effects_base/view/generatedeffectviewermodel.cppsrc/effects/effects_base/view/generatedeffectviewermodel.hsrc/effects/effects_base/view/presetscontextmenumodel.hsrc/effects/effects_base/view/realtimeeffectviewerdialogmodel.hsrc/effects/lv2/CMakeLists.txtsrc/effects/lv2/ilv2effectsrepository.hsrc/effects/lv2/internal/lv2effectloader.hsrc/effects/lv2/internal/lv2effectsrepository.cppsrc/effects/lv2/internal/lv2effectsrepository.hsrc/effects/lv2/internal/lv2pluginmetareader.cppsrc/effects/lv2/internal/lv2pluginmetareader.hsrc/effects/lv2/internal/lv2pluginsscanner.cppsrc/effects/lv2/internal/lv2pluginsscanner.hsrc/effects/lv2/lv2effectsmodule.cppsrc/effects/lv2/lv2effectsmodule.hsrc/effects/lv2/view/lv2viewmodel.cppsrc/effects/lv2/view/lv2viewmodel.hsrc/effects/nyquist/CMakeLists.txtsrc/effects/nyquist/internal/nyquisteffectsloader.hsrc/effects/nyquist/internal/nyquisteffectsrepository.cppsrc/effects/nyquist/internal/nyquisteffectsrepository.hsrc/effects/nyquist/internal/nyquistpluginsmetareader.cppsrc/effects/nyquist/internal/nyquistpluginsmetareader.hsrc/effects/nyquist/internal/nyquistpluginsscanner.cppsrc/effects/nyquist/internal/nyquistpluginsscanner.hsrc/effects/nyquist/inyquisteffectsrepository.hsrc/effects/nyquist/nyquisteffectsmodule.cppsrc/effects/nyquist/nyquisteffectsmodule.hsrc/effects/nyquist/nyquistprompt/nyquistpromptloader.cppsrc/effects/nyquist/nyquistprompt/nyquistpromptviewmodel.hsrc/effects/vst/CMakeLists.txtsrc/effects/vst/internal/vst3effectloader.hsrc/effects/vst/internal/vst3pluginsmetareader.cppsrc/effects/vst/internal/vst3pluginsmetareader.hsrc/effects/vst/internal/vst3pluginsscanner.cppsrc/effects/vst/internal/vst3pluginsscanner.hsrc/effects/vst/internal/vsteffectsrepository.cppsrc/effects/vst/internal/vsteffectsrepository.hsrc/effects/vst/ivsteffectsrepository.hsrc/effects/vst/view/vstviewmodel.cppsrc/effects/vst/view/vstviewmodel.hsrc/effects/vst/vsteffectsmodule.cppsrc/effects/vst/vsteffectsmodule.hsrc/projectscene/view/trackspanel/addeffectmenumodel.cppsrc/projectscene/view/trackspanel/realtimeeffectlistitemmenumodel.cppsrc/projectscene/view/trackspanel/realtimeeffectlistitemmodel.cppsrc/projectscene/view/trackspanel/realtimeeffectlistitemmodel.hsrc/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
c0929a9 to
b46f145
Compare
|
@coderabbitai a lot has changed since, please one more time. |
|
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
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 | 🔵 TrivialConsider adding a TODO comment or issue reference for custom paths support.
The commented-out
ReadCustomPathscode 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 | 🟠 MajorCheck that the requested effect was actually registered.
DiscoverPluginsAtPath()can yield multiple descriptors for one bundle/path. This implementation only remembers the last returnedPluginID, soensurePluginIsLoaded()can returntrueeven when the requestedeffectIdwas never registered. The failure is then deferred toEffectsProvider::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 | 🔴 CriticalUndefined behavior: member passed to base class before construction.
The constructor passes
m_vst3ModuletoAu3AudioPluginScannerin the initializer list, but C++ constructs base classes before members. At the pointAu3AudioPluginScanner(m_vst3Module)runs,m_vst3Moduledoes not yet exist.Use the base-from-member idiom (a private base class holding
VST3EffectsModulebeforeAu3AudioPluginScanner) or refactorAu3AudioPluginScannerto 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 | 🔵 TrivialDrop the direct
PluginProvider.hinclude.Line 6 is redundant:
PluginDescriptor.halready providesPluginID, so this just widens coupling and rebuild surface.src/effects/nyquist/internal/nyquistpluginsmetareader.h (1)
11-16:⚠️ Potential issue | 🔴 CriticalRestore
readMeta()for the synthetic Nyquist prompt.Line 16 still lets
"Nyquist Prompt"throughcanReadMeta(), but after removing the Nyquist-specificreadMeta()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 | 🔴 CriticalCritical: base constructor receives an uninitialized member reference.
At Line 15,
m_auModuleis passed toAu3AudioPluginScanner(...)beforem_auModuleis 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.hsrc/effects/effects_base/internal/au3/au3pluginregistry.cpp (1)
68-76:⚠️ Potential issue | 🟠 MajorMetadata loss and hardcoded
enabledstate.Two issues in this block:
Line 70:
toEffectMetais called with an empty description andsupportsMultipleClipSelection = false. This loses metadata that may have been previously persisted inknown_audio_plugins.json.Line 76:
info.enabledis hardcoded totrue, ignoring the plugin's actual enabled state fromplug.IsEnabled(). This means user toggle changes made viaEnablePlugin()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
supportsMultipleClipSelectionwhen available.au3/libraries/au3-module-manager/PluginManager.cpp (1)
334-345:⚠️ Potential issue | 🔴 CriticalLoaded disabled flags are still overwritten during startup.
Load()now hydratesmRegisteredPluginsbefore provider discovery, butAutoRegisterPlugins()still routes throughRegisterPlugin(...), which unconditionally callsSetEnabled(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.cppau3/libraries/au3-exceptions/AudacityException.hau3/libraries/au3-files/FileException.hau3/libraries/au3-lv2/LoadLV2.cppau3/libraries/au3-module-manager/CMakeLists.txtau3/libraries/au3-module-manager/IPluginRegistry.hau3/libraries/au3-module-manager/PluginDescriptor.hau3/libraries/au3-module-manager/PluginInterface.cppau3/libraries/au3-module-manager/PluginInterface.hau3/libraries/au3-module-manager/PluginManager.cppau3/libraries/au3-module-manager/PluginManager.hau3/libraries/au3-xml/XMLWriter.hsrc/appshell/internal/startupscenario.cppsrc/appshell/internal/startupscenario.hsrc/appshell/qml/Audacity/AppShell/appmenumodel.hsrc/effects/audio_unit/CMakeLists.txtsrc/effects/audio_unit/audiouniteffectsmodule.cppsrc/effects/audio_unit/audiouniteffectsmodule.hsrc/effects/audio_unit/iaudiouniteffectsrepository.hsrc/effects/audio_unit/internal/audiouniteffectloader.hsrc/effects/audio_unit/internal/audiouniteffectsrepository.cppsrc/effects/audio_unit/internal/audiouniteffectsrepository.hsrc/effects/audio_unit/internal/audiounitpluginsscanner.cppsrc/effects/audio_unit/internal/audiounitpluginsscanner.hsrc/effects/audio_unit/view/audiounitview.hsrc/effects/audio_unit/view/audiounitviewmodel.hsrc/effects/builtin/CMakeLists.txtsrc/effects/builtin/builtineffectsmodule.cppsrc/effects/builtin/builtineffectsmodule.hsrc/effects/builtin/ibuiltineffectsrepository.hsrc/effects/builtin/internal/builtineffectsloader.hsrc/effects/builtin/internal/builtineffectsmetareader.cppsrc/effects/builtin/internal/builtineffectsmetareader.hsrc/effects/builtin/internal/builtineffectsrepository.cppsrc/effects/builtin/internal/builtineffectsrepository.hsrc/effects/builtin/internal/builtineffectsscanner.hsrc/effects/builtin/view/builtineffectmodel.cppsrc/effects/builtin/view/builtineffectmodel.hsrc/effects/builtin/view/builtineffectviewloader.hsrc/effects/builtin_collection/CMakeLists.txtsrc/effects/builtin_collection/builtineffectscollectionmodule.cppsrc/effects/builtin_collection/builtineffectscollectionmodule.hsrc/effects/builtin_collection/dynamics/timeline/abstractdynamicseffectinstancemodel.hsrc/effects/builtin_collection/internal/builtincollectionloader.cppsrc/effects/builtin_collection/internal/builtincollectionloader.hsrc/effects/builtin_collection/internal/builtineffectsloader.cppsrc/effects/effects_base/CMakeLists.txtsrc/effects/effects_base/effectsmodule.cppsrc/effects/effects_base/effectsmodule.hsrc/effects/effects_base/effectstypes.hsrc/effects/effects_base/ieffectexecutionscenario.hsrc/effects/effects_base/ieffectinstancesregister.hsrc/effects/effects_base/ieffectloader.hsrc/effects/effects_base/ieffectloadersregister.hsrc/effects/effects_base/ieffectsprovider.hsrc/effects/effects_base/ieffectsproviderinitializer.hsrc/effects/effects_base/ieffectviewcontroller.hsrc/effects/effects_base/internal/abstractaudiopluginmetareader.cppsrc/effects/effects_base/internal/abstractviewlauncher.hsrc/effects/effects_base/internal/au3/au3audiopluginmetareader.cppsrc/effects/effects_base/internal/au3/au3audiopluginmetareader.hsrc/effects/effects_base/internal/au3/au3audiopluginscanner.cppsrc/effects/effects_base/internal/au3/au3audiopluginscanner.hsrc/effects/effects_base/internal/au3/au3effectsutils.cppsrc/effects/effects_base/internal/au3/au3effectsutils.hsrc/effects/effects_base/internal/au3/au3pluginregistry.cppsrc/effects/effects_base/internal/au3/au3pluginregistry.hsrc/effects/effects_base/internal/au3effectloader.cppsrc/effects/effects_base/internal/au3effectloader.hsrc/effects/effects_base/internal/effectexecutionscenario.cppsrc/effects/effects_base/internal/effectexecutionscenario.hsrc/effects/effects_base/internal/effectinstancesregister.hsrc/effects/effects_base/internal/effectloadersregister.cppsrc/effects/effects_base/internal/effectloadersregister.hsrc/effects/effects_base/internal/effectparametersprovider.hsrc/effects/effects_base/internal/effectpresetsprovider.hsrc/effects/effects_base/internal/effectpresetsscenario.hsrc/effects/effects_base/internal/effectsactionscontroller.hsrc/effects/effects_base/internal/effectsmenuprovider.hsrc/effects/effects_base/internal/effectsprovider.cppsrc/effects/effects_base/internal/effectsprovider.hsrc/effects/effects_base/internal/effectsproviderinitializer.cppsrc/effects/effects_base/internal/effectsproviderinitializer.hsrc/effects/effects_base/internal/effectsrepositoryhelper.hsrc/effects/effects_base/internal/effectsuiactions.hsrc/effects/effects_base/internal/effectsutils.cppsrc/effects/effects_base/internal/effectsutils.hsrc/effects/effects_base/internal/effectviewcontroller.cppsrc/effects/effects_base/internal/effectviewcontroller.hsrc/effects/effects_base/internal/realtimeeffectservice.hsrc/effects/effects_base/iparameterextractorregistry.hsrc/effects/effects_base/view/abstracteffectviewmodel.hsrc/effects/effects_base/view/destructiveeffectviewerdialogmodel.hsrc/effects/effects_base/view/effectparameterslistmodel.hsrc/effects/effects_base/view/effectpresetsbarmodel.hsrc/effects/effects_base/view/effectsavecontextmenu.hsrc/effects/effects_base/view/generatedeffectviewermodel.cppsrc/effects/effects_base/view/generatedeffectviewermodel.hsrc/effects/effects_base/view/presetscontextmenumodel.hsrc/effects/effects_base/view/realtimeeffectviewerdialogmodel.hsrc/effects/lv2/CMakeLists.txtsrc/effects/lv2/ilv2effectsrepository.hsrc/effects/lv2/internal/lv2effectloader.hsrc/effects/lv2/internal/lv2effectsrepository.cppsrc/effects/lv2/internal/lv2effectsrepository.hsrc/effects/lv2/internal/lv2pluginmetareader.cppsrc/effects/lv2/internal/lv2pluginmetareader.hsrc/effects/lv2/internal/lv2pluginsscanner.cppsrc/effects/lv2/internal/lv2pluginsscanner.hsrc/effects/lv2/lv2effectsmodule.cppsrc/effects/lv2/lv2effectsmodule.hsrc/effects/lv2/view/lv2viewmodel.cppsrc/effects/lv2/view/lv2viewmodel.hsrc/effects/nyquist/CMakeLists.txtsrc/effects/nyquist/internal/nyquisteffectsloader.hsrc/effects/nyquist/internal/nyquisteffectsrepository.cppsrc/effects/nyquist/internal/nyquisteffectsrepository.hsrc/effects/nyquist/internal/nyquistpluginsmetareader.cppsrc/effects/nyquist/internal/nyquistpluginsmetareader.hsrc/effects/nyquist/internal/nyquistpluginsscanner.cppsrc/effects/nyquist/internal/nyquistpluginsscanner.hsrc/effects/nyquist/inyquisteffectsrepository.hsrc/effects/nyquist/nyquisteffectsmodule.cppsrc/effects/nyquist/nyquisteffectsmodule.hsrc/effects/nyquist/nyquistprompt/nyquistpromptloader.cppsrc/effects/nyquist/nyquistprompt/nyquistpromptloader.hsrc/effects/nyquist/nyquistprompt/nyquistpromptviewmodel.hsrc/effects/vst/CMakeLists.txtsrc/effects/vst/internal/vst3effectloader.hsrc/effects/vst/internal/vst3pluginsmetareader.cppsrc/effects/vst/internal/vst3pluginsmetareader.hsrc/effects/vst/internal/vst3pluginsscanner.cppsrc/effects/vst/internal/vst3pluginsscanner.hsrc/effects/vst/internal/vsteffectsrepository.cppsrc/effects/vst/internal/vsteffectsrepository.hsrc/effects/vst/ivsteffectsrepository.hsrc/effects/vst/view/vstviewmodel.cppsrc/effects/vst/view/vstviewmodel.hsrc/effects/vst/vsteffectsmodule.cppsrc/effects/vst/vsteffectsmodule.hsrc/projectscene/view/trackspanel/addeffectmenumodel.cppsrc/projectscene/view/trackspanel/realtimeeffectlistitemmenumodel.cppsrc/projectscene/view/trackspanel/realtimeeffectlistitemmodel.cppsrc/projectscene/view/trackspanel/realtimeeffectlistitemmodel.hsrc/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
|
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
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 | 🟠 MajorCustom 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 toLV2_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
PluginManagerInterfaceis guaranteed initialized (or gate it with a safe readiness check).src/effects/nyquist/nyquisteffectsmodule.cpp (1)
87-96: 🧹 Nitpick | 🔵 TrivialConsider 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 | 🟠 MajorInitialization-order risk remains in constructor base argument.
Line 11 still passes
m_moduleto the base constructor beforem_moduleis constructed. IfAu3AudioPluginMetaReaderuses 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/effectsExpected 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 | 🔴 CriticalBase constructor uses
m_modulebefore 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_modulebefore member declaration, confirming the construction-order hazard.src/effects/nyquist/internal/nyquisteffectsloader.h (1)
13-17:⚠️ Potential issue | 🔴 CriticalBase constructor receives a member before that member is constructed.
Au3EffectLoader(m_module, ...)is initialized beforem_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.hsrc/effects/audio_unit/internal/audiouniteffectloader.h (1)
13-17:⚠️ Potential issue | 🔴 CriticalSame base-from-member initialization-order bug here.
Au3EffectLoader(m_module, ...)runs beforem_moduleis 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.cppsrc/effects/effects_base/internal/effectloadersregister.cpp (1)
8-21:⚠️ Potential issue | 🟠 MajorReject 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 | 🔴 CriticalBase-from-member initialization order: undefined behavior.
Au3EffectLoaderbase is constructed beforem_modulemember, so passingm_moduleto 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 | 🔴 CriticalSame base-from-member initialization order problem as Vst3EffectLoader.
The constructor passes
m_moduletoAu3EffectLoaderbase beforem_moduleis 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 | 🟠 MajorStill unresolved:
m_moduleis forwarded before it is constructed.Line 14 passes
m_moduleintoAu3EffectLoader, but base subobjects are initialized before members in C++. That means the base is bound to storage whoseBuiltinEffectsModulelifetime 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.cppsrc/effects/vst/internal/vst3pluginsscanner.h (1)
14-18:⚠️ Potential issue | 🔴 CriticalStill unresolved:
m_vst3Moduleis passed to the base before its lifetime begins.Line 15 forwards
m_vst3ModuleintoAu3AudioPluginScanner, but the base is constructed before member initialization. That leaves the scanner base holding a reference to an unconstructedVST3EffectsModule, 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.cppsrc/effects/builtin/internal/builtineffectsmetareader.h (1)
11-21:⚠️ Potential issue | 🔴 CriticalFix C++ initialization order:
m_builtinEffectsModuleis uninitialized when passed to base class.The constructor passes
m_builtinEffectsModuletoAu3AudioPluginMetaReaderin 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 | 🟠 MajorUnimplemented methods:
GetImporterFilterDescriptionandSetImporterFilterDescriptionlack backing storage.These methods are declared but have no corresponding
TranslatableStringmember variable (line 159 area shows onlymImporterIdentifierandmImporterExtensions). Either remove these declarations if not needed, or add the member variable and implement the methods.The
::TranslatableStringglobal 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 | 🔴 CriticalFix C++ initialization order:
m_auModuleis uninitialized when passed to base class.Same issue as flagged in
BuiltinEffectsMetaReaderandNyquistPluginsScanner. The base classAu3AudioPluginScannerreceives a reference tom_auModulebefore 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 | 🔵 TrivialHardcoded
"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 | 🔴 CriticalFix the base-from-member lifetime bug.
Line 17 forwards
m_lv2Moduleintoau::effects::Au3AudioPluginScannerbefore Line 27 constructsm_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 | 🔴 CriticalDo not pass
m_moduleto the base beforem_moduleexists.Line 9 calls
au::effects::Au3AudioPluginMetaReader{m_module}during base construction, butm_moduleis 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 | 🟡 MinorMissing include for
muse::IInteractive.Line 17 uses
muse::IInteractivebut the header is not included. This may cause a compilation error ifIInteractiveis 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 | 🟠 MajorDisabled 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
EffectMetawith an empty description andsupportsMultipleClipSelection = false, and Line 76 then hard-codesAudioPluginInfo.enabled = trueeven thoughLoad()reads that field back as validity. After one save, multi-clip-capable or previously invalid effects no longer round-trip throughknown_audio_plugins.json.au3/libraries/au3-module-manager/PluginManager.cpp (2)
389-391:⚠️ Potential issue | 🟠 MajorGuard
sRegistryFactorybefore invoking to preventstd::bad_function_call.If
Initialize()is called with an emptyPluginRegistryFactory, invokingsRegistryFactory()directly will throwstd::bad_function_callbefore 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()andSave()methods.
525-537:⚠️ Potential issue | 🟠 MajorSame guard needed for
Load()andSave()methods.Both methods invoke
sRegistryFactory()without first checking if the factory is valid, creating the samestd::bad_function_callrisk.🐛 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 | 🔵 TrivialInclude 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.cppau3/libraries/au3-exceptions/AudacityException.hau3/libraries/au3-files/FileException.hau3/libraries/au3-lv2/LoadLV2.cppau3/libraries/au3-module-manager/CMakeLists.txtau3/libraries/au3-module-manager/IPluginRegistry.hau3/libraries/au3-module-manager/PluginDescriptor.hau3/libraries/au3-module-manager/PluginInterface.cppau3/libraries/au3-module-manager/PluginInterface.hau3/libraries/au3-module-manager/PluginManager.cppau3/libraries/au3-module-manager/PluginManager.hau3/libraries/au3-xml/XMLWriter.hmuse_frameworksrc/appshell/internal/startupscenario.cppsrc/appshell/internal/startupscenario.hsrc/appshell/qml/Audacity/AppShell/appmenumodel.hsrc/effects/audio_unit/CMakeLists.txtsrc/effects/audio_unit/audiouniteffectsmodule.cppsrc/effects/audio_unit/audiouniteffectsmodule.hsrc/effects/audio_unit/iaudiouniteffectsrepository.hsrc/effects/audio_unit/internal/audiouniteffectloader.hsrc/effects/audio_unit/internal/audiouniteffectsrepository.cppsrc/effects/audio_unit/internal/audiouniteffectsrepository.hsrc/effects/audio_unit/internal/audiounitpluginsscanner.cppsrc/effects/audio_unit/internal/audiounitpluginsscanner.hsrc/effects/audio_unit/view/audiounitview.hsrc/effects/audio_unit/view/audiounitviewmodel.hsrc/effects/builtin/CMakeLists.txtsrc/effects/builtin/builtineffectsmodule.cppsrc/effects/builtin/builtineffectsmodule.hsrc/effects/builtin/ibuiltineffectsrepository.hsrc/effects/builtin/internal/builtineffectsloader.hsrc/effects/builtin/internal/builtineffectsmetareader.cppsrc/effects/builtin/internal/builtineffectsmetareader.hsrc/effects/builtin/internal/builtineffectsrepository.cppsrc/effects/builtin/internal/builtineffectsrepository.hsrc/effects/builtin/internal/builtineffectsscanner.hsrc/effects/builtin/view/builtineffectmodel.cppsrc/effects/builtin/view/builtineffectmodel.hsrc/effects/builtin/view/builtineffectviewloader.hsrc/effects/builtin_collection/CMakeLists.txtsrc/effects/builtin_collection/builtineffectscollectionmodule.cppsrc/effects/builtin_collection/builtineffectscollectionmodule.hsrc/effects/builtin_collection/dynamics/timeline/abstractdynamicseffectinstancemodel.hsrc/effects/builtin_collection/internal/builtincollectionloader.cppsrc/effects/builtin_collection/internal/builtincollectionloader.hsrc/effects/builtin_collection/internal/builtineffectsloader.cppsrc/effects/effects_base/CMakeLists.txtsrc/effects/effects_base/effectsmodule.cppsrc/effects/effects_base/effectsmodule.hsrc/effects/effects_base/effectstypes.hsrc/effects/effects_base/ieffectexecutionscenario.hsrc/effects/effects_base/ieffectinstancesregister.hsrc/effects/effects_base/ieffectloader.hsrc/effects/effects_base/ieffectloadersregister.hsrc/effects/effects_base/ieffectsprovider.hsrc/effects/effects_base/ieffectsproviderinitializer.hsrc/effects/effects_base/ieffectviewcontroller.hsrc/effects/effects_base/internal/abstractaudiopluginmetareader.cppsrc/effects/effects_base/internal/abstractviewlauncher.hsrc/effects/effects_base/internal/au3/au3audiopluginmetareader.cppsrc/effects/effects_base/internal/au3/au3audiopluginmetareader.hsrc/effects/effects_base/internal/au3/au3audiopluginscanner.cppsrc/effects/effects_base/internal/au3/au3audiopluginscanner.hsrc/effects/effects_base/internal/au3/au3effectsutils.cppsrc/effects/effects_base/internal/au3/au3effectsutils.hsrc/effects/effects_base/internal/au3/au3pluginregistry.cppsrc/effects/effects_base/internal/au3/au3pluginregistry.hsrc/effects/effects_base/internal/au3effectloader.cppsrc/effects/effects_base/internal/au3effectloader.hsrc/effects/effects_base/internal/effectexecutionscenario.cppsrc/effects/effects_base/internal/effectexecutionscenario.hsrc/effects/effects_base/internal/effectinstancesregister.hsrc/effects/effects_base/internal/effectloadersregister.cppsrc/effects/effects_base/internal/effectloadersregister.hsrc/effects/effects_base/internal/effectparametersprovider.hsrc/effects/effects_base/internal/effectpresetsprovider.hsrc/effects/effects_base/internal/effectpresetsscenario.hsrc/effects/effects_base/internal/effectsactionscontroller.hsrc/effects/effects_base/internal/effectsmenuprovider.hsrc/effects/effects_base/internal/effectsprovider.cppsrc/effects/effects_base/internal/effectsprovider.hsrc/effects/effects_base/internal/effectsproviderinitializer.cppsrc/effects/effects_base/internal/effectsproviderinitializer.hsrc/effects/effects_base/internal/effectsrepositoryhelper.hsrc/effects/effects_base/internal/effectsuiactions.hsrc/effects/effects_base/internal/effectsutils.cppsrc/effects/effects_base/internal/effectsutils.hsrc/effects/effects_base/internal/effectviewcontroller.cppsrc/effects/effects_base/internal/effectviewcontroller.hsrc/effects/effects_base/internal/realtimeeffectservice.hsrc/effects/effects_base/iparameterextractorregistry.hsrc/effects/effects_base/view/abstracteffectviewmodel.hsrc/effects/effects_base/view/destructiveeffectviewerdialogmodel.hsrc/effects/effects_base/view/effectparameterslistmodel.hsrc/effects/effects_base/view/effectpresetsbarmodel.hsrc/effects/effects_base/view/effectsavecontextmenu.hsrc/effects/effects_base/view/generatedeffectviewermodel.cppsrc/effects/effects_base/view/generatedeffectviewermodel.hsrc/effects/effects_base/view/presetscontextmenumodel.hsrc/effects/effects_base/view/realtimeeffectviewerdialogmodel.hsrc/effects/lv2/CMakeLists.txtsrc/effects/lv2/ilv2effectsrepository.hsrc/effects/lv2/internal/lv2effectloader.hsrc/effects/lv2/internal/lv2effectsrepository.cppsrc/effects/lv2/internal/lv2effectsrepository.hsrc/effects/lv2/internal/lv2pluginmetareader.cppsrc/effects/lv2/internal/lv2pluginmetareader.hsrc/effects/lv2/internal/lv2pluginsscanner.cppsrc/effects/lv2/internal/lv2pluginsscanner.hsrc/effects/lv2/lv2effectsmodule.cppsrc/effects/lv2/lv2effectsmodule.hsrc/effects/lv2/view/lv2viewmodel.cppsrc/effects/lv2/view/lv2viewmodel.hsrc/effects/nyquist/CMakeLists.txtsrc/effects/nyquist/internal/nyquisteffectsloader.hsrc/effects/nyquist/internal/nyquisteffectsrepository.cppsrc/effects/nyquist/internal/nyquisteffectsrepository.hsrc/effects/nyquist/internal/nyquistpluginsmetareader.cppsrc/effects/nyquist/internal/nyquistpluginsmetareader.hsrc/effects/nyquist/internal/nyquistpluginsscanner.cppsrc/effects/nyquist/internal/nyquistpluginsscanner.hsrc/effects/nyquist/inyquisteffectsrepository.hsrc/effects/nyquist/nyquisteffectsmodule.cppsrc/effects/nyquist/nyquisteffectsmodule.hsrc/effects/nyquist/nyquistprompt/nyquistpromptloader.cppsrc/effects/nyquist/nyquistprompt/nyquistpromptloader.hsrc/effects/nyquist/nyquistprompt/nyquistpromptviewmodel.hsrc/effects/vst/CMakeLists.txtsrc/effects/vst/internal/vst3effectloader.hsrc/effects/vst/internal/vst3pluginsmetareader.cppsrc/effects/vst/internal/vst3pluginsmetareader.hsrc/effects/vst/internal/vst3pluginsscanner.cppsrc/effects/vst/internal/vst3pluginsscanner.hsrc/effects/vst/internal/vsteffectsrepository.cppsrc/effects/vst/internal/vsteffectsrepository.hsrc/effects/vst/ivsteffectsrepository.hsrc/effects/vst/view/vstviewmodel.cppsrc/effects/vst/view/vstviewmodel.hsrc/effects/vst/vsteffectsmodule.cppsrc/effects/vst/vsteffectsmodule.hsrc/projectscene/view/trackspanel/addeffectmenumodel.cppsrc/projectscene/view/trackspanel/realtimeeffectlistitemmenumodel.cppsrc/projectscene/view/trackspanel/realtimeeffectlistitemmodel.cppsrc/projectscene/view/trackspanel/realtimeeffectlistitemmodel.hsrc/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
| virtual void Load(PluginMap&) = 0; | ||
| virtual void Save(const PluginMap&) = 0; |
There was a problem hiding this comment.
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.
| bool BuiltinEffectsMetaReader::canReadMeta(const muse::io::path_t& pluginPath) const | ||
| { | ||
| return pluginPath.toStdString().find("Built-in Effect:") == 0; | ||
| } |
There was a problem hiding this comment.
🧹 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;
}There was a problem hiding this comment.
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 | 🟠 MajorDeinit the loader and scanner you initialize here.
onInit()now initializesm_effectLoaderandm_pluginsScanner, butonDeinit()only tears downm_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 privatem_modulemember toAu3AudioPluginScanner, and the loader classes do the same forAu3EffectLoader, so they each carry their own module lifetime.au3/libraries/au3-module-manager/PluginManager.h (1)
233-234:⚠️ Potential issue | 🟡 MinorRemove the
REGVERCURconstant as dead code.The constant is no longer used.
GetRegistryVersion()andmRegverhave been removed, and the only remaining reference toREGVERCURis 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 | 🟡 MinorGuard against expired weak state before
showEffect().
m_effectState.lock()can returnnullptrif the weak pointer has expired. Unlike the destructor which guards withIF_ASSERT_FAILED, this method passes the result directly toshowEffect().🛠️ 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 | 🟡 MinorMissing include for
muse::IInteractive.Line 17 uses
muse::IInteractivebut 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 | 🔵 TrivialRemove unused includes.
au3effectsutils.hdoes not appear to be used in this file—none of its symbols (toAu4EffectCategory,toAu3EffectGroup,toAu4EffectType,toAu3EffectType,toEffectMeta) are called. Theau3::wxToString()function is defined elsewhere (likely inwxtypes_convert.h).Similarly,
translation.happears unused—no translation macros likemuse::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 | 🟡 MinorReuse 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 intoknown_audio_plugins.jsonas a normal plugin.src/effects/effects_base/internal/au3effectloader.h (1)
21-30:⚠️ Potential issue | 🟠 MajorAdd 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/effectsExpected:
Au3EffectLoaderandAu3AudioPluginScannerexpose a teardown path or destructors that callPluginProvider::Terminate(). If only meta readers terminate, the lifecycle is still asymmetric.src/effects/nyquist/internal/nyquistpluginsmetareader.h (1)
11-16:⚠️ Potential issue | 🔴 CriticalKeep 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 ownreadMeta()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 au3Expected: either
NyquistPluginsMetaReader::readMeta()exists, orAu3AudioPluginMetaReader::readMeta()has an explicit non-file branch for the prompt entry.src/effects/nyquist/internal/nyquisteffectsrepository.cpp (1)
58-64:⚠️ Potential issue | 🟠 MajorFilter 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 feedsinit()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 | 🔴 CriticalRediscovery 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/Validtotrueon reused entries. Disabled effects come back enabled after restart, and descriptors that are no longer rediscovered never get pruned frommRegisteredPlugins. Reconcile the discovered set against the loaded set before saving again.src/effects/effects_base/internal/effectsprovider.cpp (1)
81-86:⚠️ Potential issue | 🔴 CriticalBuild failure:
m_au3PluginsChangedSubscriptionis not declared.The subscription object
m_au3PluginsChangedSubscriptionis used here but is not declared ineffectsprovider.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 | 🟠 MajorMulti-clip execution is not atomic - partial failures leave earlier clips modified.
As noted in a previous review,
performEffectOnEachSelectedClip()callsperformEffectInternal()once per clip, each creating its ownTransactionScope. If clip N+1 fails, clips 0 through N have already been committed. This can leave the project in an inconsistent state.Consider either:
- Moving the transaction boundary up to
performEffectOnEachSelectedClip()- Having this helper participate in an outer transaction
- Implementing a rollback mechanism for partial failures
627-634: 🧹 Nitpick | 🔵 TrivialClarify 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 | 🟡 MinorSilent 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 likeisActivatedorisRealtimeCapablecould silently use incorrect defaults (e.g.,falsefor 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.cppau3/libraries/au3-exceptions/AudacityException.hau3/libraries/au3-files/FileException.hau3/libraries/au3-lv2/LoadLV2.cppau3/libraries/au3-module-manager/CMakeLists.txtau3/libraries/au3-module-manager/IPluginRegistry.hau3/libraries/au3-module-manager/PluginDescriptor.hau3/libraries/au3-module-manager/PluginInterface.cppau3/libraries/au3-module-manager/PluginInterface.hau3/libraries/au3-module-manager/PluginManager.cppau3/libraries/au3-module-manager/PluginManager.hau3/libraries/au3-xml/XMLWriter.hmuse_frameworksrc/appshell/internal/startupscenario.cppsrc/appshell/internal/startupscenario.hsrc/appshell/qml/Audacity/AppShell/appmenumodel.hsrc/effects/audio_unit/CMakeLists.txtsrc/effects/audio_unit/audiouniteffectsmodule.cppsrc/effects/audio_unit/audiouniteffectsmodule.hsrc/effects/audio_unit/iaudiouniteffectsrepository.hsrc/effects/audio_unit/internal/audiouniteffectloader.hsrc/effects/audio_unit/internal/audiouniteffectsrepository.cppsrc/effects/audio_unit/internal/audiouniteffectsrepository.hsrc/effects/audio_unit/internal/audiounitpluginsscanner.cppsrc/effects/audio_unit/internal/audiounitpluginsscanner.hsrc/effects/audio_unit/view/audiounitview.hsrc/effects/audio_unit/view/audiounitviewmodel.hsrc/effects/builtin/CMakeLists.txtsrc/effects/builtin/builtineffectsmodule.cppsrc/effects/builtin/builtineffectsmodule.hsrc/effects/builtin/ibuiltineffectsrepository.hsrc/effects/builtin/internal/builtineffectsloader.hsrc/effects/builtin/internal/builtineffectsmetareader.cppsrc/effects/builtin/internal/builtineffectsmetareader.hsrc/effects/builtin/internal/builtineffectsrepository.cppsrc/effects/builtin/internal/builtineffectsrepository.hsrc/effects/builtin/internal/builtineffectsscanner.hsrc/effects/builtin/view/builtineffectmodel.cppsrc/effects/builtin/view/builtineffectmodel.hsrc/effects/builtin/view/builtineffectviewloader.hsrc/effects/builtin_collection/CMakeLists.txtsrc/effects/builtin_collection/builtineffectscollectionmodule.cppsrc/effects/builtin_collection/builtineffectscollectionmodule.hsrc/effects/builtin_collection/dynamics/timeline/abstractdynamicseffectinstancemodel.hsrc/effects/builtin_collection/internal/builtincollectionloader.cppsrc/effects/builtin_collection/internal/builtincollectionloader.hsrc/effects/builtin_collection/internal/builtineffectsloader.cppsrc/effects/effects_base/CMakeLists.txtsrc/effects/effects_base/effectsmodule.cppsrc/effects/effects_base/effectsmodule.hsrc/effects/effects_base/effectstypes.hsrc/effects/effects_base/ieffectexecutionscenario.hsrc/effects/effects_base/ieffectinstancesregister.hsrc/effects/effects_base/ieffectloader.hsrc/effects/effects_base/ieffectloadersregister.hsrc/effects/effects_base/ieffectsprovider.hsrc/effects/effects_base/ieffectsproviderinitializer.hsrc/effects/effects_base/ieffectviewcontroller.hsrc/effects/effects_base/internal/abstractaudiopluginmetareader.cppsrc/effects/effects_base/internal/abstractviewlauncher.hsrc/effects/effects_base/internal/au3/au3audiopluginmetareader.cppsrc/effects/effects_base/internal/au3/au3audiopluginmetareader.hsrc/effects/effects_base/internal/au3/au3audiopluginscanner.cppsrc/effects/effects_base/internal/au3/au3audiopluginscanner.hsrc/effects/effects_base/internal/au3/au3effectsutils.cppsrc/effects/effects_base/internal/au3/au3effectsutils.hsrc/effects/effects_base/internal/au3/au3pluginregistry.cppsrc/effects/effects_base/internal/au3/au3pluginregistry.hsrc/effects/effects_base/internal/au3effectloader.cppsrc/effects/effects_base/internal/au3effectloader.hsrc/effects/effects_base/internal/effectexecutionscenario.cppsrc/effects/effects_base/internal/effectexecutionscenario.hsrc/effects/effects_base/internal/effectinstancesregister.hsrc/effects/effects_base/internal/effectloadersregister.cppsrc/effects/effects_base/internal/effectloadersregister.hsrc/effects/effects_base/internal/effectparametersprovider.hsrc/effects/effects_base/internal/effectpresetsprovider.hsrc/effects/effects_base/internal/effectpresetsscenario.hsrc/effects/effects_base/internal/effectsactionscontroller.hsrc/effects/effects_base/internal/effectsmenuprovider.hsrc/effects/effects_base/internal/effectsprovider.cppsrc/effects/effects_base/internal/effectsprovider.hsrc/effects/effects_base/internal/effectsproviderinitializer.cppsrc/effects/effects_base/internal/effectsproviderinitializer.hsrc/effects/effects_base/internal/effectsrepositoryhelper.hsrc/effects/effects_base/internal/effectsuiactions.hsrc/effects/effects_base/internal/effectsutils.cppsrc/effects/effects_base/internal/effectsutils.hsrc/effects/effects_base/internal/effectviewcontroller.cppsrc/effects/effects_base/internal/effectviewcontroller.hsrc/effects/effects_base/internal/realtimeeffectservice.hsrc/effects/effects_base/iparameterextractorregistry.hsrc/effects/effects_base/view/abstracteffectviewmodel.hsrc/effects/effects_base/view/destructiveeffectviewerdialogmodel.hsrc/effects/effects_base/view/effectparameterslistmodel.hsrc/effects/effects_base/view/effectpresetsbarmodel.hsrc/effects/effects_base/view/effectsavecontextmenu.hsrc/effects/effects_base/view/generatedeffectviewermodel.cppsrc/effects/effects_base/view/generatedeffectviewermodel.hsrc/effects/effects_base/view/presetscontextmenumodel.hsrc/effects/effects_base/view/realtimeeffectviewerdialogmodel.hsrc/effects/lv2/CMakeLists.txtsrc/effects/lv2/ilv2effectsrepository.hsrc/effects/lv2/internal/lv2effectloader.hsrc/effects/lv2/internal/lv2effectsrepository.cppsrc/effects/lv2/internal/lv2effectsrepository.hsrc/effects/lv2/internal/lv2pluginmetareader.cppsrc/effects/lv2/internal/lv2pluginmetareader.hsrc/effects/lv2/internal/lv2pluginsscanner.cppsrc/effects/lv2/internal/lv2pluginsscanner.hsrc/effects/lv2/lv2effectsmodule.cppsrc/effects/lv2/lv2effectsmodule.hsrc/effects/lv2/view/lv2viewmodel.cppsrc/effects/lv2/view/lv2viewmodel.hsrc/effects/nyquist/CMakeLists.txtsrc/effects/nyquist/internal/nyquisteffectsloader.hsrc/effects/nyquist/internal/nyquisteffectsrepository.cppsrc/effects/nyquist/internal/nyquisteffectsrepository.hsrc/effects/nyquist/internal/nyquistpluginsmetareader.cppsrc/effects/nyquist/internal/nyquistpluginsmetareader.hsrc/effects/nyquist/internal/nyquistpluginsscanner.cppsrc/effects/nyquist/internal/nyquistpluginsscanner.hsrc/effects/nyquist/inyquisteffectsrepository.hsrc/effects/nyquist/nyquisteffectsmodule.cppsrc/effects/nyquist/nyquisteffectsmodule.hsrc/effects/nyquist/nyquistprompt/nyquistpromptloader.cppsrc/effects/nyquist/nyquistprompt/nyquistpromptloader.hsrc/effects/nyquist/nyquistprompt/nyquistpromptviewmodel.hsrc/effects/vst/CMakeLists.txtsrc/effects/vst/internal/vst3effectloader.hsrc/effects/vst/internal/vst3pluginsmetareader.cppsrc/effects/vst/internal/vst3pluginsmetareader.hsrc/effects/vst/internal/vst3pluginsscanner.cppsrc/effects/vst/internal/vst3pluginsscanner.hsrc/effects/vst/internal/vsteffectsrepository.cppsrc/effects/vst/internal/vsteffectsrepository.hsrc/effects/vst/ivsteffectsrepository.hsrc/effects/vst/view/vstviewmodel.cppsrc/effects/vst/view/vstviewmodel.hsrc/effects/vst/vsteffectsmodule.cppsrc/effects/vst/vsteffectsmodule.hsrc/projectscene/view/trackspanel/addeffectmenumodel.cppsrc/projectscene/view/trackspanel/realtimeeffectlistitemmenumodel.cppsrc/projectscene/view/trackspanel/realtimeeffectlistitemmodel.cppsrc/projectscene/view/trackspanel/realtimeeffectlistitemmodel.hsrc/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
| class IEffectsProviderInitializer : MODULE_EXPORT_INTERFACE | ||
| { | ||
| INTERFACE_ID(IEffectsProviderInitializer) | ||
|
|
||
| public: | ||
| virtual ~IEffectsProviderInitializer() = default; | ||
|
|
||
| virtual void callAfterSplashScreen() = 0; |
There was a problem hiding this comment.
🧹 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.
| const AudioPluginInfoList plugins = knownPlugins()->pluginInfoList(); | ||
|
|
||
| for (const AudioPluginInfo& info : plugins) { | ||
| if (!info.enabled) { | ||
| continue; | ||
| } | ||
|
|
||
| const EffectMeta meta = utils::museToAuEffectMeta(info.path, info.meta); |
There was a problem hiding this comment.
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)
| } | ||
| assert(isAudacityPlugin.has_value()); | ||
| if (isAudacityPlugin.has_value() && *isAudacityPlugin) { | ||
| audacityPluginPaths.push_back(*it); | ||
| it = thirdPartyPluginPaths.erase(it); | ||
| } else { | ||
| ++it; | ||
| } | ||
| } |
There was a problem hiding this comment.
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).
ef0e59d to
3c9e51d
Compare
There was a problem hiding this comment.
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
3c9e51d to
5474bd2
Compare
5474bd2 to
89458bc
Compare
There was a problem hiding this comment.
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 | 🔴 CriticalAdd missing serialization for
mDescriptionandmSupportsMultipleClipSelection.The new descriptor fields lack persistence: neither field is written by
WriteXML()or parsed byHandleXMLTag(). 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,AttrSupportsMultipleClipSelectionnot 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 | 🟠 MajorOne-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 whileSupportsCustomModulePaths()still reports support.Also applies to: 210-221
src/effects/effects_base/ieffectloader.h (1)
16-17: 🧹 Nitpick | 🔵 TrivialDocument
ensurePluginIsLoaded()boolean semantics.The current
boolcontract is ambiguous (loaded nowvsalready 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 | 🟡 MinorRemove unused
TrackListforward 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 | 🟠 MajorRemove 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 | 🟠 MajorReturn a result from registry persistence calls.
Once
pluginregistry.cfgis gone, this interface is the only path for persisting plugin enabled/disabled state.void Load()/void Save()givesPluginManagerno 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 | 🟡 MinorMissing include for
muse::IInteractive.Line 17 uses
muse::IInteractivebut the header is not included. Add the missing include to avoid compilation issues ifIInteractiveis 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 | 🔵 TrivialConsider using
inlineto avoid ODR issues.These
static conststrings create separate copies in each translation unit that includes this header. Usinginline constensures a single definition across the program and reduces binary size.src/effects/effects_base/internal/effectexecutionscenario.cpp (2)
441-473:⚠️ Potential issue | 🟠 MajorKeep multi-clip execution atomic.
Each iteration reaches
performEffectInternal(), which opens and commits its ownTransactionScope. If clip N+1 fails, clips1..Nare already committed even though this method returns an error.
777-837:⚠️ Potential issue | 🟠 MajorRestore 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 | 🟠 MajorFilter the shared register down to effect resource types.
pluginInfoList()is not effect-only. This loop currently converts every enabled audio resource into anEffectMeta, so non-effect entries fall through asEffectFamily::Unknownand 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 | 🟠 MajorDon't deserialize missing persisted attributes as false/empty defaults.
attributeValue()returns{}when a key is absent. For migratedknown_audio_plugins.jsonentries, that silently turnsEFFECT_ACTIVATED_ATTRIBUTE, realtime support, and multi-clip support intofalse, 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.cppau3/libraries/au3-audio-unit/AudioUnitEffectBase.hau3/libraries/au3-builtin-effects/ChangePitchBase.hau3/libraries/au3-builtin-effects/ChangeTempoBase.cppau3/libraries/au3-builtin-effects/ChangeTempoBase.hau3/libraries/au3-builtin-effects/EqualizationBase.hau3/libraries/au3-builtin-effects/Generator.hau3/libraries/au3-builtin-effects/SBSMSBase.hau3/libraries/au3-builtin-effects/ToneGenBase.hau3/libraries/au3-builtin-effects/TruncSilenceBase.hau3/libraries/au3-components/EffectInterface.hau3/libraries/au3-effects/LoadEffects.cppau3/libraries/au3-exceptions/AudacityException.hau3/libraries/au3-files/FileException.hau3/libraries/au3-lv2/LV2EffectBase.cppau3/libraries/au3-lv2/LV2EffectBase.hau3/libraries/au3-lv2/LoadLV2.cppau3/libraries/au3-module-manager/CMakeLists.txtau3/libraries/au3-module-manager/IPluginRegistry.hau3/libraries/au3-module-manager/PluginDescriptor.cppau3/libraries/au3-module-manager/PluginDescriptor.hau3/libraries/au3-module-manager/PluginInterface.cppau3/libraries/au3-module-manager/PluginInterface.hau3/libraries/au3-module-manager/PluginManager.cppau3/libraries/au3-module-manager/PluginManager.hau3/libraries/au3-nyquist-effects/NyquistBase.cppau3/libraries/au3-nyquist-effects/NyquistBase.hau3/libraries/au3-vst3/VST3EffectBase.cppau3/libraries/au3-vst3/VST3EffectBase.hau3/libraries/au3-xml/XMLWriter.hmuse_frameworksrc/appshell/internal/startupscenario.cppsrc/appshell/internal/startupscenario.hsrc/appshell/qml/Audacity/AppShell/appmenumodel.hsrc/effects/audio_unit/CMakeLists.txtsrc/effects/audio_unit/audiouniteffectsmodule.cppsrc/effects/audio_unit/audiouniteffectsmodule.hsrc/effects/audio_unit/iaudiouniteffectsrepository.hsrc/effects/audio_unit/internal/audiouniteffectloader.hsrc/effects/audio_unit/internal/audiouniteffectsrepository.cppsrc/effects/audio_unit/internal/audiouniteffectsrepository.hsrc/effects/audio_unit/internal/audiounitpluginsmetareader.cppsrc/effects/audio_unit/internal/audiounitpluginsmetareader.hsrc/effects/audio_unit/internal/audiounitpluginsscanner.cppsrc/effects/audio_unit/internal/audiounitpluginsscanner.hsrc/effects/audio_unit/view/audiounitview.hsrc/effects/audio_unit/view/audiounitviewmodel.cppsrc/effects/audio_unit/view/audiounitviewmodel.hsrc/effects/builtin/CMakeLists.txtsrc/effects/builtin/builtineffectsmodule.cppsrc/effects/builtin/builtineffectsmodule.hsrc/effects/builtin/ibuiltineffectsrepository.hsrc/effects/builtin/internal/builtineffectsloader.hsrc/effects/builtin/internal/builtineffectsmetareader.cppsrc/effects/builtin/internal/builtineffectsmetareader.hsrc/effects/builtin/internal/builtineffectsrepository.cppsrc/effects/builtin/internal/builtineffectsrepository.hsrc/effects/builtin/internal/builtineffectsscanner.hsrc/effects/builtin/view/builtineffectmodel.cppsrc/effects/builtin/view/builtineffectmodel.hsrc/effects/builtin/view/builtineffectviewloader.hsrc/effects/builtin_collection/CMakeLists.txtsrc/effects/builtin_collection/amplify/amplifyeffect.hsrc/effects/builtin_collection/builtineffectscollectionmodule.cppsrc/effects/builtin_collection/builtineffectscollectionmodule.hsrc/effects/builtin_collection/clickremoval/clickremovaleffect.hsrc/effects/builtin_collection/dtmfgen/dtmfgenerator.hsrc/effects/builtin_collection/dynamics/compressor/compressoreffect.hsrc/effects/builtin_collection/dynamics/limiter/limitereffect.hsrc/effects/builtin_collection/dynamics/timeline/abstractdynamicseffectinstancemodel.hsrc/effects/builtin_collection/fade/fadeeffect.hsrc/effects/builtin_collection/internal/builtincollectionloader.cppsrc/effects/builtin_collection/internal/builtincollectionloader.hsrc/effects/builtin_collection/internal/builtineffectsloader.cppsrc/effects/builtin_collection/internal/builtineffectsloader.hsrc/effects/builtin_collection/invert/inverteffect.hsrc/effects/builtin_collection/loudness/normalizeloudnesseffect.hsrc/effects/builtin_collection/noisegen/noisegenerator.hsrc/effects/builtin_collection/noisereduction/noisereductioneffect.hsrc/effects/builtin_collection/normalize/normalizeeffect.hsrc/effects/builtin_collection/removedcoffset/removedcoffseteffect.hsrc/effects/builtin_collection/repair/repaireffect.hsrc/effects/builtin_collection/reverb/reverbeffect.hsrc/effects/builtin_collection/reverse/reverseeffect.hsrc/effects/effects_base/CMakeLists.txtsrc/effects/effects_base/effectsmodule.cppsrc/effects/effects_base/effectsmodule.hsrc/effects/effects_base/effectstypes.hsrc/effects/effects_base/ieffectexecutionscenario.hsrc/effects/effects_base/ieffectinstancesregister.hsrc/effects/effects_base/ieffectloader.hsrc/effects/effects_base/ieffectloadersregister.hsrc/effects/effects_base/ieffectsprovider.hsrc/effects/effects_base/ieffectsproviderinitializer.hsrc/effects/effects_base/ieffectviewcontroller.hsrc/effects/effects_base/internal/abstractaudiopluginmetareader.cppsrc/effects/effects_base/internal/abstractviewlauncher.hsrc/effects/effects_base/internal/au3/au3audiopluginmetareader.cppsrc/effects/effects_base/internal/au3/au3audiopluginmetareader.hsrc/effects/effects_base/internal/au3/au3audiopluginscanner.cppsrc/effects/effects_base/internal/au3/au3audiopluginscanner.hsrc/effects/effects_base/internal/au3/au3effectsutils.cppsrc/effects/effects_base/internal/au3/au3effectsutils.hsrc/effects/effects_base/internal/au3/au3pluginregistry.cppsrc/effects/effects_base/internal/au3/au3pluginregistry.hsrc/effects/effects_base/internal/au3effectloader.cppsrc/effects/effects_base/internal/au3effectloader.hsrc/effects/effects_base/internal/effectexecutionscenario.cppsrc/effects/effects_base/internal/effectexecutionscenario.hsrc/effects/effects_base/internal/effectinstancesregister.hsrc/effects/effects_base/internal/effectloadersregister.cppsrc/effects/effects_base/internal/effectloadersregister.hsrc/effects/effects_base/internal/effectparametersprovider.hsrc/effects/effects_base/internal/effectpresetsprovider.hsrc/effects/effects_base/internal/effectpresetsscenario.hsrc/effects/effects_base/internal/effectsactionscontroller.hsrc/effects/effects_base/internal/effectsmenuprovider.hsrc/effects/effects_base/internal/effectsprovider.cppsrc/effects/effects_base/internal/effectsprovider.hsrc/effects/effects_base/internal/effectsproviderinitializer.cppsrc/effects/effects_base/internal/effectsproviderinitializer.hsrc/effects/effects_base/internal/effectsrepositoryhelper.cppsrc/effects/effects_base/internal/effectsrepositoryhelper.hsrc/effects/effects_base/internal/effectsuiactions.hsrc/effects/effects_base/internal/effectsutils.cppsrc/effects/effects_base/internal/effectsutils.hsrc/effects/effects_base/internal/effectviewcontroller.cppsrc/effects/effects_base/internal/effectviewcontroller.hsrc/effects/effects_base/internal/realtimeeffectservice.hsrc/effects/effects_base/iparameterextractorregistry.hsrc/effects/effects_base/view/abstracteffectviewmodel.hsrc/effects/effects_base/view/destructiveeffectviewerdialogmodel.hsrc/effects/effects_base/view/effectparameterslistmodel.hsrc/effects/effects_base/view/effectpresetsbarmodel.hsrc/effects/effects_base/view/effectsavecontextmenu.hsrc/effects/effects_base/view/generatedeffectviewermodel.cppsrc/effects/effects_base/view/generatedeffectviewermodel.hsrc/effects/effects_base/view/presetscontextmenumodel.hsrc/effects/effects_base/view/realtimeeffectviewerdialogmodel.hsrc/effects/lv2/CMakeLists.txtsrc/effects/lv2/ilv2effectsrepository.hsrc/effects/lv2/internal/lv2effectloader.hsrc/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
| const wxString& PluginDescriptor::GetDescription() const | ||
| { | ||
| return mDescription; | ||
| } |
There was a problem hiding this comment.
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)
| desc.SetEffectInteractive(effect->IsInteractive()); | ||
| desc.SetEffectDefault(effect->IsDefault()); | ||
| desc.SetRealtimeSupport(effect->RealtimeSupport()); | ||
| desc.SetEffectAutomatable(effect->SupportsAutomation()); | ||
|
|
||
| desc.SetEnabled(true); | ||
| desc.SetValid(true); |
There was a problem hiding this comment.
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);| 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); | ||
| } |
There was a problem hiding this comment.
🧹 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 functionalmeta.isActivated: User-level enable/disable toggle — persisted viaauToMuseEffectMeta(meta)intoinfo.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.
| 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"); |
There was a problem hiding this comment.
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.
| 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 }; |
There was a problem hiding this comment.
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.
| 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 }; |
| muse::Inject<muse::audioplugins::IRegisterAudioPluginsScenario> registerAudioPluginsScenario { this }; | ||
| muse::Inject<muse::IInteractive> interactive { this }; |
There was a problem hiding this comment.
🛠️ 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.
| 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 }; |
| muse::GlobalInject<IEffectsProvider> effectsProvider; | ||
| muse::Inject<IEffectViewLaunchRegister> viewLaunchRegister{ this }; |
There was a problem hiding this comment.
🧩 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
fiRepository: 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 -80Repository: 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.
| muse::GlobalInject<IEffectsProvider> effectsProvider; | |
| muse::Inject<IEffectViewLaunchRegister> viewLaunchRegister{ this }; | |
| muse::GlobalInject<IEffectsProvider> effectsProvider; | |
| muse::ContextInject<IEffectViewLaunchRegister> viewLaunchRegister{ this }; |
…ion underneath does
Actually that's the responsibility of the scanners now.
a18cc21 to
61e3224
Compare
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]>
Resolves: #10593
With these changes, the
pluginregistry.cfgdoesn't get created or updated anymore. All effect info lands inknown_audio_plugins.json. Au4EffectMetastructs can be entirely constructed from entries inknown_audio_plugins.json, and new fields were added that were present inpluginregistry.cfg. This will ease the enabling/disabling of effects and thereby the implementation of the plugin manager in AU4.Steps:
BuiltinEffectentry is added in the framework'sAudioResourceTypeattributesmember of framework'sAudioResourceMetais used to record properties of AU3PluginDescriptorthat are needed byPluginManager(e.g.EFFECT_TITLE_ATTRIBUTEineffectstypes.h)au3effectsutils.hto convert betweenPluginDescriptorandEffectMetawhen effects are first discovered by the various AU3 effect modules or when thePluginManagerwants to read or write itsmRegisteredPluginsfrom or to disc,effectsutils.hto convert between AU4EffectMetaand frameworkAudioResourceMetaEffectsRepositoryHelper,AbstractAudioPluginMetaReader,NyquistEffectsRepository,NyquistPluginsMetaReader,BuiltinEffectsLoaderandBuiltinEffectsLoaderare drastically simplified because they now use these helpersStartupScenarioregisters directly effects of typeAudioResourceType::NyquistPluginandAudioResourceType::BuiltinEffect(not with the out-of-process scanning)AbstractAudioPluginMetaReaderis renamedAu3AudioPluginMetaReaderAu3AudioPluginScanneris introduced and reused by all effect families except built-ins, cleaning up and reducing the amount of code duplication some moreBuiltinEffectsScannerand aBuiltinEffectsMetaReaderare introduced, and now built-in effects are also recorded inknown_audio_plugins.jsonknown_audio_plugins.json,EffectsProvider::reloadEffects()can be simplified and read everything from the framework'sIKnownAudioPluginsRegister🎉IEffectLoaderandIEffectLoadersRegister, for use byEffectsProvider, and break the circular dependencies we had betweeneffects_baseand the vst, lv2 and audio-units effect repositories (that are now renamed "loaders") 🎉IPluginRegistryin AU3 for thePluginManagerto read and write plugin states to and from disk - the implementation is in AU4 and interacts with theIKnownAudioPluginsRegister. RIPpluginregistry.cfg.Recommended:
QA: