Skip to content

Fix setting waveform scale using a scriptable - #10884

Merged
kryksyh merged 1 commit into
audacity:audacity3from
DavidBailes:scaletype
May 25, 2026
Merged

kryksyh merged 1 commit into
audacity:audacity3from
DavidBailes:scaletype

Conversation

@DavidBailes

Copy link
Copy Markdown
Collaborator

Resolves: #4601

Problem:
Setting the waveform scale type using a scriptable always results in the scale type being set to Linear (db).

Fix:
In SetTrackVisualsCommand::ApplyInner(), insert missing break statements within a switch statement.

  • [ 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

@coderabbitai

coderabbitai Bot commented May 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 621da577-0547-49e1-ac3e-54045dccd4a2

📥 Commits

Reviewing files that changed from the base of the PR and between 6e7b74dd1bf6f565d02235660f247ba58f990c06 and 45518c3.

📒 Files selected for processing (1)
  • src/commands/SetTrackInfoCommand.cpp

📝 Walkthrough

Walkthrough

This change modifies the switch statement in SetTrackVisualsCommand::ApplyInner that maps mScaleType to WaveformSettings scale enums. Previously cases fell through; the updated code adds an explicit default label and break-terminated cases so each in-range mScaleType selects its corresponding WaveformSettings::st* value, and out-of-range values fall into the default path (stLinearAmp).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix setting waveform scale using a scriptable' directly summarizes the main change - fixing a bug where waveform scale setting via scriptables was broken.
Description check ✅ Passed The PR description includes the required template sections: linked issue reference, problem statement, fix explanation, and completed checklist items. All critical sections are present and adequately filled.
Linked Issues check ✅ Passed The PR directly addresses issue #4601 by adding missing break statements in the switch statement to prevent fall-through behavior that caused all scale types to default to Linear (dB).
Out of Scope Changes check ✅ Passed The changes are minimal and focused: only 3 lines added/removed to fix the switch statement in SetTrackVisualsCommand::ApplyInner(), directly addressing the linked issue without introducing unrelated modifications.

✏️ 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.

@DavidBailes
DavidBailes requested a review from kryksyh May 7, 2026 08:46
@kryksyh

kryksyh commented May 7, 2026

Copy link
Copy Markdown
Member

Oh.. What a bug... It should be caught by the compiler if we ever manage to reduce the number of warnings and enable Werror.

@DavidBailes thank you!

Problem:
Setting the waveform scale type using a scriptable always results in the scale type being set to Linear (db).

Fix:
In SetTrackVisualsCommand::ApplyInner(), insert missing break statements within a switch statement.
@kryksyh
kryksyh merged commit 8d0841d into audacity:audacity3 May 25, 2026
8 checks passed
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.

Setting Track Waveform Scale through Scriptables results in incorrect scale

2 participants