Skip to content

Update framework 260415 - #10715

Merged
kryksyh merged 6 commits into
audacity:masterfrom
kryksyh:update-framework-260415
Apr 15, 2026
Merged

kryksyh merged 6 commits into
audacity:masterfrom
kryksyh:update-framework-260415

Conversation

@kryksyh

@kryksyh kryksyh commented Apr 15, 2026 •

Copy link
Copy Markdown
Member
  • I signed CLA
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

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

QA:

  • Clean shutdown without a project opened
  • Clean shutdown with a project opened
  • All effect types are scanned and found
  • Project can be opened from the file manager

@coderabbitai

coderabbitai Bot commented Apr 15, 2026 •

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Command-line/options handling was centralized into a new au::app::AudacityCmdOptions (shared_ptr) and threaded through CommandLineParser, AppFactory, GuiApp, and PluginRegistrationApp. App-level lifecycle and per-context orchestration (au::app::App and large parts of GuiApp/PluginRegistrationApp) were removed or simplified to rely on muse::ui::GuiApplication and BaseApplication startup hooks. CMake stopped injecting compile definitions directly and now generates a configuration header (app_config.h) from app_config.h.in. The muse_framework submodule reference was updated and several small controller and effects-mapping tweaks were made.

Sequence Diagram(s)

sequenceDiagram
    participant Main as main()
    participant CLP as CommandLineParser
    participant Options as AudacityCmdOptions
    participant Factory as AppFactory
    participant App as IApplication (Gui / PluginRegistration)
    participant GuiUI as muse::ui::GuiApplication
    participant Context as Context (IoC)
    participant Scenario as IStartupScenario

    Main->>CLP: parse(argc, argv)
    CLP-->>Options: populate shared AudacityCmdOptions
    Main->>Factory: newApp(Options)
    Factory-->>App: construct using Options
    alt GUI mode
        App->>GuiUI: delegate lifecycle
        GuiUI->>Context: makeContextOptions / create context
        Context->>Scenario: resolve IStartupScenario
        GuiUI->>Scenario: apply Options.startup and run startup scenario
        Scenario-->>GuiUI: complete startup / trigger runAfterSplash
    else PluginRegistration mode
        App->>Context: create context
        Context->>Scenario: resolve IRegisterAudioPluginsScenario
        App->>Scenario: process plugin registration using Options.audioPluginRegistration
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Suggested reviewers

  • grliszas14
  • saintmatthieu
🚥 Pre-merge checks | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description lacks crucial implementation details, motivation for changes, and a narrative explanation beyond a basic checklist. Add a detailed description explaining the framework update purpose, key architectural changes (GuiApp/PluginRegistrationApp refactoring, cmdoptions centralization), and the rationale for removing App.cpp and refactoring command-line parsing. Include high-level context about why these changes were necessary.
Title check ❓ Inconclusive The title 'Update framework 260415' is vague and non-descriptive, providing no meaningful information about what framework component was updated or why. Replace with a descriptive title that explains the main change, such as 'Refactor command-line option handling and integrate with muse framework' or similar.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kryksyh
kryksyh force-pushed the update-framework-260415 branch from 13b3ffd to 08f9dba Compare April 15, 2026 09:22

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 5


ℹ️ Review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro

Run ID: 23fd8250-dce9-4244-8b52-7e80bdfa4e53

📥 Commits

Reviewing files that changed from the base of the PR and between 0fdad64 and 13b3ffde8619a8127ba1718b547e2787acb7169d.

📒 Files selected for processing (18)
  • CMakeLists.txt
  • SetupConfigure.cmake
  • muse_framework
  • src/app/app_config.h.in
  • src/app/appfactory.cpp
  • src/app/appfactory.h
  • src/app/cmdoptions.h
  • src/app/commandlineparser.cpp
  • src/app/commandlineparser.h
  • src/app/guiapp.cpp
  • src/app/guiapp.h
  • src/app/main.cpp
  • src/app/pluginregistrationapp.cpp
  • src/app/pluginregistrationapp.h
  • src/appshell/internal/applicationactioncontroller.cpp
  • src/effects/effects_base/internal/effectsrepositoryhelper.cpp
  • src/preferences/qml/Audacity/Preferences/updatepreferencesmodel.cpp
  • src/project/internal/projectactionscontroller.cpp
💤 Files with no reviewable changes (2)
  • src/appshell/internal/applicationactioncontroller.cpp
  • CMakeLists.txt

Comment thread src/app/app_config.h.in Resolved
Comment thread src/app/appfactory.cpp Resolved
Comment thread src/app/guiapp.cpp Resolved
Comment thread src/app/guiapp.cpp Resolved
Comment thread src/app/pluginregistrationapp.cpp Resolved
@kryksyh
kryksyh force-pushed the update-framework-260415 branch from 08f9dba to 6460342 Compare April 15, 2026 09:36

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 5

♻️ Duplicate comments (2)
src/app/pluginregistrationapp.cpp (1)

62-70: ⚠️ Potential issue | 🔴 Critical

Guard scenario before calling into it.

resolve<muse::audioplugins::IRegisterAudioPluginsScenario>("app") can still return null here. runSelfTest() handles that case, but this path dereferences scenario unconditionally on Line 68 / Line 70 and turns a missing registration service into a startup crash.

Suggested fix
     auto scenario = modularity::ioc(ctxId)->resolve<muse::audioplugins::IRegisterAudioPluginsScenario>("app");
+    if (!scenario) {
+        LOGE() << "Audio plugin registration scenario not available";
+        return 1;
+    }
 
     Ret ret = make_ret(Ret::Code::Ok);
src/app/guiapp.cpp (1)

104-106: ⚠️ Potential issue | 🟠 Major

Don't bypass GuiApplication::applyCommandLineOptions().

GuiApp now derives from muse::ui::GuiApplication, so the qualified call on Line 106 skips any immediate-base handling that the framework adds there. Call the immediate base override instead.

Run this to confirm whether the synced framework defines GuiApplication::applyCommandLineOptions() separately from BaseApplication:

#!/bin/bash
set -euo pipefail

echo "== GuiApp declaration =="
fd -i '^guiapp\.h$' | while read -r f; do
  echo "-- $f --"
  rg -n -C3 'class\s+GuiApp|applyCommandLineOptions\s*\(' "$f" || true
done

echo
echo "== GuiApplication declarations/definitions =="
fd -i 'guiapplication\.(h|cpp)$' | while read -r f; do
  echo "-- $f --"
  rg -n -C3 '\bapplyCommandLineOptions\s*\(' "$f" || true
done

If GuiApplication has its own override, the current qualified call bypasses it.


ℹ️ Review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1b46f23b-6114-44a8-8e41-fc2fa6d5fb69

📥 Commits

Reviewing files that changed from the base of the PR and between 13b3ffde8619a8127ba1718b547e2787acb7169d and 08f9dbab828aec616d5504ff0880921332cf7020.

📒 Files selected for processing (17)
  • CMakeLists.txt
  • SetupConfigure.cmake
  • muse_framework
  • src/app/app_config.h.in
  • src/app/appfactory.cpp
  • src/app/appfactory.h
  • src/app/cmdoptions.h
  • src/app/commandlineparser.cpp
  • src/app/commandlineparser.h
  • src/app/guiapp.cpp
  • src/app/guiapp.h
  • src/app/main.cpp
  • src/app/pluginregistrationapp.cpp
  • src/app/pluginregistrationapp.h
  • src/appshell/internal/applicationactioncontroller.cpp
  • src/preferences/qml/Audacity/Preferences/updatepreferencesmodel.cpp
  • src/project/internal/projectactionscontroller.cpp
💤 Files with no reviewable changes (2)
  • CMakeLists.txt
  • src/appshell/internal/applicationactioncontroller.cpp

Comment thread SetupConfigure.cmake Resolved
Comment thread src/app/commandlineparser.cpp Resolved
Comment thread src/app/commandlineparser.h Resolved
Comment thread src/app/guiapp.cpp Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

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

⚠️ Outside diff range comments (1)
src/app/appfactory.cpp (1)

111-185: ⚠️ Potential issue | 🔴 Critical

Guard NyquistEffectsModule instantiation to match its conditional include.

NyquistEffectsModule is only included under #if AU_MODULE_EFFECTS_NYQUIST (lines 56-58) with no stub fallback, but both newGuiApp() and newPluginRegistrationApp() instantiate it unconditionally at lines 148 and 182. When AU_MODULE_EFFECTS_NYQUIST is false/undefined, this causes a compile-time error. Unlike AudioUnitEffectsModule, Lv2EffectsModule, and VstEffectsModule which have stub modules, Nyquist lacks a fallback implementation.

Minimal fix
-    app->addModule(new au::effects::NyquistEffectsModule());
+#if AU_MODULE_EFFECTS_NYQUIST
+    app->addModule(new au::effects::NyquistEffectsModule());
+#endif

Apply the same guard to both newGuiApp() (line 148) and newPluginRegistrationApp() (line 182).

♻️ Duplicate comments (4)
src/preferences/qml/Audacity/Preferences/updatepreferencesmodel.cpp (1)

57-57: ⚠️ Potential issue | 🟠 Major

Provide an Audacity privacy-policy source before switching to the generic accessor.

This now delegates to the framework-level privacyPolicyUrl() lookup, but the PR still does not add an Audacity-side source for that value. In builds without a custom UpdateConfiguration, the preferences dialog can end up with an empty/broken privacy-policy link.

SetupConfigure.cmake (1)

164-164: ⚠️ Potential issue | 🔴 Critical

Populate the AU_* CMake variables before generating app_config.h.

#cmakedefine only emits these macros when the matching CMake variables are set. This configure_file() still runs without any visible mapping of the real feature toggles into the five AU_* names, so the generated header can silently disable cloud/effects branches and compile the wrong module set in src/app/appfactory.cpp.

src/app/commandlineparser.cpp (1)

61-62: ⚠️ Potential issue | 🟠 Major

Decode Windows argv before persisting the new string options.

These values still come through prepareArguments(), which uses QString::fromLocal8Bit(argv[i]). In src/app/main.cpp, the UTF-16→UTF-8 normalization happens only after parse(), so non-ASCII --project-display-name-override / --cloud-project-id input is already mangled on MSVC builds by the time Lines 125 and 129 store it.

Also applies to: 79-129

src/app/pluginregistrationapp.cpp (1)

62-71: ⚠️ Potential issue | 🔴 Critical

Guard the resolved registration scenario before dereferencing.

resolve<IRegisterAudioPluginsScenario> on Line 62 can return null if the service isn't registered, but scenario->registerFailedPlugin() and scenario->registerPlugin() are called unconditionally on Lines 68 and 70, resulting in a null-pointer dereference.

Proposed fix
     auto scenario = modularity::ioc(ctxId)->resolve<muse::audioplugins::IRegisterAudioPluginsScenario>("app");
+    IF_ASSERT_FAILED(scenario) {
+        LOGE() << "Audio plugin registration scenario not available";
+        return 1;
+    }
 
     Ret ret = make_ret(Ret::Code::Ok);

ℹ️ Review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro

Run ID: d29722a7-c38e-41e1-ac61-5921408290c0

📥 Commits

Reviewing files that changed from the base of the PR and between 08f9dbab828aec616d5504ff0880921332cf7020 and 64603428e7fa3152a10bdd38d1a8cb21f11d88e4.

📒 Files selected for processing (18)
  • CMakeLists.txt
  • SetupConfigure.cmake
  • muse_framework
  • src/app/app_config.h.in
  • src/app/appfactory.cpp
  • src/app/appfactory.h
  • src/app/cmdoptions.h
  • src/app/commandlineparser.cpp
  • src/app/commandlineparser.h
  • src/app/guiapp.cpp
  • src/app/guiapp.h
  • src/app/main.cpp
  • src/app/pluginregistrationapp.cpp
  • src/app/pluginregistrationapp.h
  • src/appshell/internal/applicationactioncontroller.cpp
  • src/effects/effects_base/internal/effectsrepositoryhelper.cpp
  • src/preferences/qml/Audacity/Preferences/updatepreferencesmodel.cpp
  • src/project/internal/projectactionscontroller.cpp
💤 Files with no reviewable changes (2)
  • CMakeLists.txt
  • src/appshell/internal/applicationactioncontroller.cpp

Comment thread muse_framework Resolved
Comment thread src/app/cmdoptions.h Resolved
@kryksyh
kryksyh force-pushed the update-framework-260415 branch from 6460342 to 927a4cd Compare April 15, 2026 10:00

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6b33c39d-66db-4df2-9248-7f8b22535700

📥 Commits

Reviewing files that changed from the base of the PR and between 64603428e7fa3152a10bdd38d1a8cb21f11d88e4 and 927a4cdbd08264cf6183fe487ccf22141024fa84.

📒 Files selected for processing (14)
  • muse_framework
  • src/app/app.cpp
  • src/app/app.h
  • src/app/appfactory.cpp
  • src/app/appfactory.h
  • src/app/cmdoptions.h
  • src/app/commandlineparser.cpp
  • src/app/commandlineparser.h
  • src/app/guiapp.cpp
  • src/app/guiapp.h
  • src/app/main.cpp
  • src/app/pluginregistrationapp.cpp
  • src/app/pluginregistrationapp.h
  • src/appshell/internal/applicationactioncontroller.cpp
💤 Files with no reviewable changes (3)
  • src/appshell/internal/applicationactioncontroller.cpp
  • src/app/app.h
  • src/app/app.cpp

Comment thread src/app/pluginregistrationapp.cpp Resolved
@kryksyh
kryksyh force-pushed the update-framework-260415 branch from 927a4cd to 86344c8 Compare April 15, 2026 10:07

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (3)
src/app/guiapp.cpp (3)

62-72: ⚠️ Potential issue | 🟠 Major

Close the splash on startup-abort paths.

If either assertion fails here, doStartupScenario() returns while the splash created by showContextSplash() is still live. That leaves the app stuck in the startup-failure path instead of unwinding cleanly.

Suggested fix
 void GuiApp::doStartupScenario(const muse::modularity::ContextPtr& ctxId)
 {
+    auto closeSplash = [this]() {
+        if (m_splashScreen) {
+            m_splashScreen->close();
+            delete m_splashScreen;
+            m_splashScreen = nullptr;
+        }
+    };
+
     auto startupScenario = muse::modularity::ioc(ctxId)->resolve<IStartupScenario>("app");
     IF_ASSERT_FAILED(startupScenario) {
+        closeSplash();
         return;
     }
@@
     const std::shared_ptr<AudacityCmdOptions> options
         = std::dynamic_pointer_cast<AudacityCmdOptions>(contextData(ctxId).options);
     IF_ASSERT_FAILED(options) {
+        closeSplash();
         return;
     }

Based on learnings, IF_ASSERT_FAILED(condition) executes its body only on failure, so these branches currently skip the splash cleanup path.


92-101: ⚠️ Potential issue | 🟠 Major

Wait for runOnSplashScreen() to finish before continuing startup.

runOnSplashScreen() is asynchronous, but its returned promise is discarded and runAfterSplashScreen() is queued immediately. That can close the splash and advance startup while splash-phase work is still running or has already failed.


104-106: ⚠️ Potential issue | 🟠 Major

Call the immediate base implementation here, not BaseApplication.

Line 106 explicitly bypasses any muse::ui::GuiApplication::applyCommandLineOptions() override, so GUI-level option handling in the framework can be skipped. Forward to GuiApplication instead.

Suggested fix
 void GuiApp::applyCommandLineOptions(const std::shared_ptr<muse::CmdOptions>& opt)
 {
-    BaseApplication::applyCommandLineOptions(opt);
+    muse::ui::GuiApplication::applyCommandLineOptions(opt);
#!/bin/bash
set -euo pipefail

echo "== Current call site =="
sed -n '104,110p' src/app/guiapp.cpp

echo
echo "== GuiApplication declarations/definitions =="
fd -HI 'guiapplication.h' . | while read -r f; do
  echo "-- $f --"
  rg -n -C3 'applyCommandLineOptions\s*\(' "$f" || true
done
fd -HI 'guiapplication.cpp' . | while read -r f; do
  echo "-- $f --"
  rg -n -C3 'applyCommandLineOptions\s*\(' "$f" || true
done

echo
echo "== BaseApplication declarations/definitions =="
fd -HI 'baseapplication.h' . | while read -r f; do
  echo "-- $f --"
  rg -n -C3 'applyCommandLineOptions\s*\(' "$f" || true
done
fd -HI 'baseapplication.cpp' . | while read -r f; do
  echo "-- $f --"
  rg -n -C3 'applyCommandLineOptions\s*\(' "$f" || true
done

ℹ️ Review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro

Run ID: b4f89a46-a539-4008-b59c-18e477760d8e

📥 Commits

Reviewing files that changed from the base of the PR and between 927a4cdbd08264cf6183fe487ccf22141024fa84 and 86344c838ead493292553ef59415761c309ac2b5.

📒 Files selected for processing (14)
  • muse_framework
  • src/app/app.cpp
  • src/app/app.h
  • src/app/appfactory.cpp
  • src/app/appfactory.h
  • src/app/cmdoptions.h
  • src/app/commandlineparser.cpp
  • src/app/commandlineparser.h
  • src/app/guiapp.cpp
  • src/app/guiapp.h
  • src/app/main.cpp
  • src/app/pluginregistrationapp.cpp
  • src/app/pluginregistrationapp.h
  • src/appshell/internal/applicationactioncontroller.cpp
💤 Files with no reviewable changes (3)
  • src/appshell/internal/applicationactioncontroller.cpp
  • src/app/app.h
  • src/app/app.cpp

Comment thread src/app/app_config.h.in
Comment on lines +4 to +9
#cmakedefine AU_BUILD_CLOUD_AUDIOCOM 1

#cmakedefine AU_MODULE_EFFECTS_VST 1
#cmakedefine AU_MODULE_EFFECTS_NYQUIST 1
#cmakedefine AU_MODULE_EFFECTS_LV2 1
#cmakedefine AU_MODULE_EFFECTS_AUDIO_UNIT 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not familiar with #cmakedefine and .in files, but I suppose it'll behave the same, e.g. configuring with -DAU_BUILD_CLOUD_AUDIOCOM=OFF will set the cmake variable and c++ macros off ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes, exactly! We already use the same approach with the framework in muse_framework_config.h.in and au3 's audacity_config.h.in

Comment thread src/app/commandlineparser.h Outdated

Autobot m_autobot;
AudioPluginRegistration m_audioPluginRegistration;
std::shared_ptr<AudacityCmdOptions> m_options = std::make_shared<AudacityCmdOptions>();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could be const ? Or may the code change it somewhere?

auto scenario = modularity::ioc(ctx)->resolve<muse::audioplugins::IRegisterAudioPluginsScenario>("app");
std::shared_ptr<AudacityCmdOptions> options = std::dynamic_pointer_cast<AudacityCmdOptions>(m_appOptions);
IF_ASSERT_FAILED(options) {
return 1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

An error constant could make the reading a tiny bit faster, e.g. return ERROR or smth

@kryksyh
kryksyh force-pushed the update-framework-260415 branch from 86344c8 to 9a5788c Compare April 15, 2026 12:13
@kryksyh kryksyh moved this from Design - Todo to Ready for QA in [AU4] Main Board(archive) Apr 15, 2026
@dozzzzer dozzzzer moved this from Ready for QA to In QA in [AU4] Main Board(archive) Apr 15, 2026
@dozzzzer dozzzzer self-assigned this Apr 15, 2026
@dozzzzer

Copy link
Copy Markdown
Contributor

Tested

@dozzzzer dozzzzer moved this from In QA to Ready for Merge in [AU4] Main Board(archive) Apr 15, 2026
@kryksyh
kryksyh force-pushed the update-framework-260415 branch from 9a5788c to 5b793b4 Compare April 15, 2026 15:19
@kryksyh
kryksyh merged commit 57b95bf into audacity:master Apr 15, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for Merge to Done in [AU4] Main Board(archive) Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants