Skip to content

Fix the loading of presets for the Distortion effect - #11106

Merged
kryksyh merged 1 commit into
audacity:release-3.7.8from
DavidBailes:distortion
Jun 9, 2026
Merged

kryksyh merged 1 commit into
audacity:release-3.7.8from
DavidBailes:distortion

Conversation

@DavidBailes

Copy link
Copy Markdown
Collaborator

Resolves: #4326

Problem:
Loading the Distortion's presets has no effect.

Fix:
I only have limited understanding of the code, but by comparing the Reverb effect (which doesn't have this issue) with the Distortion effect, there's a corresponding line missing from EffectDistortion::Editor::UpdateUI(). Inserting this line appears to fix the problem.

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

Recommended:

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

QA:

  • Testflow test cases have been run

Probem:
Loading the Distortion's presets has no effect.

Fix:
I only have limited understanding of the code, but by comparing the Reverb effect (which doesn't have this issue) with the Distortion effect, there's a corresponding line missing from EffectDistortion::Editor::UpdateUI(). Inserting this line appears to fix the problem.
@DavidBailes DavidBailes linked an issue Jun 6, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Wondering what really moved? Review this PR in Change Stack to inspect semantic changes, definitions, and references.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: e0ff90ff-ba54-48ae-b477-2468e6561cd6

📥 Commits

Reviewing files that changed from the base of the PR and between 522b48f and b66fb7f.

📒 Files selected for processing (1)
  • src/effects/Distortion.cpp

📝 Walkthrough

Walkthrough

This pull request fixes a synchronization issue in the Distortion effect editor. The change adds explicit settings synchronization at the start of the UpdateUI() method in EffectDistortion::Editor. The editor's local mSettings member is now refreshed from the current effect settings buffer via GetSettings(mAccess.Get()) before the method uses those settings to populate UI controls. This ensures that the editor state is always aligned with the latest settings when rendering the interface.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and accurately describes the main fix: adding a missing line to enable preset loading for the Distortion effect.
Description check ✅ Passed The PR description includes the linked issue reference, problem statement, solution explanation, and mostly completed checklist items with clear methodology.
Linked Issues check ✅ Passed The code change (adding a single line to sync mSettings in UpdateUI()) directly addresses issue #4326 by enabling preset parameters to update when selected.
Out of Scope Changes check ✅ Passed The change is minimal and focused—only three lines added to Distortion.cpp to fix preset loading, with no unrelated modifications.

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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Infer (1.2.0)
src/effects/Distortion.cpp

In file included from src/effects/Distortion.cpp:12:
src/effects/Distortion.h:14:10: fatal error: 'DistortionBase.h' file not found
14 | #include "DistortionBase.h"
| ^~~~~~~~~~~~~~~~~~
1 error generated.
src/effects/Distortion.cpp:178:4-11: ERROR translating statement 'ReturnStmt'
Aborting translation of method 'EffectDistortion::MakeEditor' in file 'src/effects/Distortion.cpp': "Assert_failure src/clang/cAst_utils.ml:249:53"
Uncaught Internal Error: "Assert_failure src/clang/cAst_utils.ml:249:53"
Error backtrace:
Raised at ClangFrontend__CAst_utils.get_decl_from_typ_ptr in file "src/clang/cAst_utils.ml", line 249, characters 53-65
Called from ClangFrontend__CTrans.CTrans_funct.get_destructor_decl_ref in file "src/clang/cTrans.ml", line 658, characters 12-59
Called from ClangFrontend__CTrans.CTrans_funct.destructor_calls.(fun) in file "src/clang/cTrans.ml", line 2048, characters 12-69
Called from Base__List.rev_filter_map.loop in file "src/list.ml", line 944, charact

... [truncated 2200 characters] ...

t.instruction_log.(fun) in file "src/clang/cTrans.ml", line 4784, characters 10-1023
Called from ClangFrontend__CTrans.CTrans_funct.instruction in file "src/clang/cTrans.ml" (inlined), line 4765, characters 38-71
Called from ClangFrontend__CTrans.CTrans_funct.exec_with_node_creation in file "src/clang/cTrans.ml" (inlined), line 104, characters 20-38
Called from ClangFrontend__CTrans.CTrans_funct.get_clang_stmt_trans in file "src/clang/cTrans.ml" (inlined), line 5395, characters 4-69
Called from ClangFrontend__CTrans.CTrans_funct.get_custom_stmt_trans in file "src/clang/cTrans.ml", line 5401, characters 8-55
Called from ClangFrontend__CTrans.CTrans_funct.exec_trans_instrs.exec_trans_instrs_rev in file "src/clang/cTrans.ml" (inlined), line 5365, characters 28-54
Called from ClangFrontend__CT

Warning

Review ran into problems

🔥 Problems

Linked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped musescore/musescore.


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.

@DavidBailes
DavidBailes requested a review from kryksyh June 6, 2026 10:56

@kryksyh kryksyh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@DavidBailes thank you!

@kryksyh
kryksyh merged commit 0a96634 into audacity:release-3.7.8 Jun 9, 2026
9 checks passed
@kryksyh

kryksyh commented Jun 9, 2026

Copy link
Copy Markdown
Member

@DavidBailes I'll update the changelog once again just before the release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Distortion effect presets can't be loaded

2 participants