Skip to content

[controllers] Route FlexControl volume to master volume#2925

Merged
ten9876 merged 2 commits into
aethersdr:mainfrom
jensenpat:aether/issue-2921-flexcontrol-volume
May 23, 2026
Merged

[controllers] Route FlexControl volume to master volume#2925
ten9876 merged 2 commits into
aethersdr:mainfrom
jensenpat:aether/issue-2921-flexcontrol-volume

Conversation

@jensenpat

Copy link
Copy Markdown
Collaborator

Summary

  • Route FlexControl wheel Volume mode through master volume instead of active slice audio gain.
  • Route FlexControl VolumeUp/VolumeDown actions through the same master-volume path.

Validation

  • cmake -S . -B build-ninja -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/qt
  • cmake --build build-ninja --parallel 22
  • ctest --test-dir build-ninja --output-on-failure -j22 (15/15 passed)

Closes #2921

👨🏼‍💻 Generated with OpenAI Codex (GPT-5.5 Pro 4/23) and tested by @jensenpat

Co-authored-by: Codex <noreply@openai.com>
@jensenpat jensenpat changed the title Route FlexControl volume to master volume [controls] Route FlexControl volume to master volume May 21, 2026
@jensenpat jensenpat marked this pull request as ready for review May 21, 2026 16:06
@jensenpat jensenpat requested a review from ten9876 as a code owner May 21, 2026 16:06
@jensenpat jensenpat changed the title [controls] Route FlexControl volume to master volume [controllers] Route FlexControl volume to master volume May 21, 2026

@aethersdr-agent aethersdr-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @jensenpat — change is tight and fixes a real ergonomic issue (wheel-volume only affecting one slice).

The new adjustMasterVolume lambda mirrors the existing TCI masterVolumeRequested path at MainWindow.cpp:4293-4297 (m_titleBar->setMasterVolume(pct) + applyMasterVolume(pct)), so the title bar, audio path, persistence, and TCI broadcast all stay in sync — nice.

A couple of small observations, none blocking:

  1. Read source for current value. Reading cur from AppSettings each step relies on applyMasterVolume having just written "MasterVolume" to settings (it does, at line 9074). That works, but the title bar slider's current value is arguably the closer canonical source and avoids a settings round-trip per wheel tick. Either is fine — just noting that this couples wheel adjustment to the settings-write behavior in applyMasterVolume.

  2. Wheel step size (steps * 2). This preserves the prior wheel sensitivity (was steps * 2.0f on slice gain), so muscle memory carries over. Worth confirming 2 % per detent still feels right when you're now adjusting a 0–100 master rather than a per-slice float gain — they're the same domain in practice, so likely fine.

  3. One tiny redundancy. applyMasterVolume already clamps to [0,100] internally (lines 9066-9067), so the std::clamp(cur + deltaPct, 0, 100) in the lambda is belt-and-suspenders. Not worth changing — clamping at the caller before setMasterVolume on the title bar is good practice.

Code looks good to me. AppSettings used correctly, no new resource concerns, scope matches the PR description (single file, both Volume wheel mode and VolumeUp/Down button actions). Closes #2921 as advertised.

…xcontrol-volume

# Conflicts:
#	src/gui/MainWindow.cpp
@ten9876 ten9876 merged commit 7fd24dc into aethersdr:main May 23, 2026
4 checks passed
@ten9876

ten9876 commented May 23, 2026

Copy link
Copy Markdown
Collaborator

Claude here — merged. Thanks @jensenpat, this is the SmartSDR-parity
fix @k0otc / #2921 reporter has been asking for.

Pushed merge commit `69598eb9` resolving against #2888's slot-based
FlexControl dispatch refactor. Re-applied your intent to the new
structure:

  • `applyFlexControlWheelAction` WheelVolume case now routes to master
    volume (same body as WheelMasterAf)
  • `handleFlexControlButton` VolumeUp/VolumeDown cases route to master
    volume

The detail worth flagging: #2888 added `WheelMasterAf` as a separate
master-volume wheel mode just a few PRs ago. After this PR lands,
`WheelVolume` and `WheelMasterAf` are behaviorally identical. Filed
#2986 to track the consolidation — recommended approach is removing
`WheelMasterAf` since `WheelVolume` now serves that purpose, with
optional AppSettings migration for users who already bound to MasterAf
during the brief window it was the only master-volume option.

Code comment at the WheelVolume case references #2986 so future
maintainers know about the redundancy.

Closes #2921. Ships in v26.5.3.

73,
Jeremy KK7GWY & Claude (AI dev partner)

ten9876 added a commit that referenced this pull request May 23, 2026
…3014)

Closes #2986. PR #2925 made `FlexWheelMode::Volume` route to master
volume (matching SmartSDR per #2921). PR #2888 had previously added a
separate `FlexWheelMode::MasterAf` for master volume. After #2925 the
two modes were byte-identical — same dispatcher case, same display
entry, same code path. This PR collapses them.

## Changes

- **Drop `FlexWheelMode::MasterAf` enum value** and the corresponding
switch case in `handleFlexControlTuneSteps` + `flexWheelModeName`
mapping.
- **Fold `WheelMasterAf` into `WheelVolume`** branch in
`applyFlexControlWheelAction` via short-circuit OR — body lives once.
- **Keep accepting `"WheelMasterAf"` as a string alias** in:
  - `flexWheelModeForAction` — maps to `FlexWheelMode::Volume`
  - `FlexControlDialog::isWheelAction` predicate — same back-compat
  
This preserves saved FlexControl bindings that picked "WheelMasterAf"
before the consolidation.
  
- **Remove `WheelMasterAf` from the Radio Setup dropdown** so new
bindings only see the canonical `WheelVolume`.
- **Relabel `WheelVolume` from "Slice AF" to "Master Volume"** in
FlexControlDialog's display map — "Slice AF" was the pre-#2925
description and is now misleading (the action no longer touches slice
gain).

## Behavior

- Users with existing "WheelMasterAf" bindings: continue working
unchanged (back-compat alias path).
- New users: see one option instead of two identical-behavior choices.
- No-binding behavior unchanged.

## Test plan

- [x] Builds clean
- [ ] Run with a FlexController hardware setup, confirm wheel-volume
mode still adjusts master volume
- [ ] Verify a previously-saved "WheelMasterAf" binding still works
(back-compat alias)
- [ ] Verify the Radio Setup dropdown no longer lists WheelMasterAf

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
G6PWY-Chris pushed a commit to G6PWY-Chris/AetherSDR that referenced this pull request Jun 22, 2026
## Summary
- Route FlexControl wheel Volume mode through master volume instead of
active slice audio gain.
- Route FlexControl VolumeUp/VolumeDown actions through the same
master-volume path.

## Validation
- `cmake -S . -B build-ninja -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_PREFIX_PATH=/opt/homebrew/opt/qt`
- `cmake --build build-ninja --parallel 22`
- `ctest --test-dir build-ninja --output-on-failure -j22` (15/15 passed)

Closes aethersdr#2921

👨🏼‍💻 Generated with OpenAI Codex (GPT-5.5 Pro 4/23) and tested by
@jensenpat

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Jeremy Fielder <kk7gwy@aethersdr.com>
G6PWY-Chris pushed a commit to G6PWY-Chris/AetherSDR that referenced this pull request Jun 22, 2026
…dr#2986) (aethersdr#3014)

Closes aethersdr#2986. PR aethersdr#2925 made `FlexWheelMode::Volume` route to master
volume (matching SmartSDR per aethersdr#2921). PR aethersdr#2888 had previously added a
separate `FlexWheelMode::MasterAf` for master volume. After aethersdr#2925 the
two modes were byte-identical — same dispatcher case, same display
entry, same code path. This PR collapses them.

## Changes

- **Drop `FlexWheelMode::MasterAf` enum value** and the corresponding
switch case in `handleFlexControlTuneSteps` + `flexWheelModeName`
mapping.
- **Fold `WheelMasterAf` into `WheelVolume`** branch in
`applyFlexControlWheelAction` via short-circuit OR — body lives once.
- **Keep accepting `"WheelMasterAf"` as a string alias** in:
  - `flexWheelModeForAction` — maps to `FlexWheelMode::Volume`
  - `FlexControlDialog::isWheelAction` predicate — same back-compat
  
This preserves saved FlexControl bindings that picked "WheelMasterAf"
before the consolidation.
  
- **Remove `WheelMasterAf` from the Radio Setup dropdown** so new
bindings only see the canonical `WheelVolume`.
- **Relabel `WheelVolume` from "Slice AF" to "Master Volume"** in
FlexControlDialog's display map — "Slice AF" was the pre-aethersdr#2925
description and is now misleading (the action no longer touches slice
gain).

## Behavior

- Users with existing "WheelMasterAf" bindings: continue working
unchanged (back-compat alias path).
- New users: see one option instead of two identical-behavior choices.
- No-binding behavior unchanged.

## Test plan

- [x] Builds clean
- [ ] Run with a FlexController hardware setup, confirm wheel-volume
mode still adjusts master volume
- [ ] Verify a previously-saved "WheelMasterAf" binding still works
(back-compat alias)
- [ ] Verify the Radio Setup dropdown no longer lists WheelMasterAf

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

flex control volume wheel control master volume instead of slice volume

2 participants