Skip to content

Add ChannelFader: an audio-taper gain fader over a level meter - #567

Merged
matt-edmondson merged 1 commit into
mainfrom
claude/project-thread-wmrk2b
Sep 30, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
claude/project-thread-wmrk2b

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Requested by Matt · project thread

Before: ktsu.ImGui.Widgets had no mixer-strip gain control. A caller who wanted one used a linear slider, so unity sat near the top and the handle and any meter beside it read on different scales.

After: ImGuiWidgets.ChannelFader draws a vertical gain fader over a level meter. The handle and the meter share one audio taper (FaderTaper), so a level and a gain at the same height mean the same number of decibels. You drag it, click the track to jump, use the wheel to nudge by 1 dB, and right-click to return to unity. It marks itself with ImGuiProbes.MarkItem.

How:

  • FaderTaper maps decibels to travel. ChannelFaderState holds the interaction with no ImGui dependency and is unit tested without a context.
  • MeterScale.DrawVerticalMeter gains an overload that takes a level-to-height mapping, so the meter is drawn on the fader's taper. The existing linear overload delegates to it, and its behaviour is unchanged.
  • It ships with a ChannelFaderDemo registered with one line in DemoSections.cs, an isolation suite in ImGui.Widgets.UITests, and a gallery tile.

One deviation from #528: ChannelFaderImpl keeps a per-id DragPositions handle position across the frames of a drag. Rebuilding the position from gainDb every frame sends it through the taper and back, which differs in the last bit from where the drag left it. The fader would then report a change on every frame while the mouse is held still.

Closes #528

🤖 Generated with Claude Code

https://claude.ai/code/session_01MBhLQ3ZkoYk8s5tKQ8RTAP


Generated by Claude Code

@matt-edmondson matt-edmondson self-assigned this Sep 30, 2026
Comment thread ImGui.Widgets/ChannelFader.cs Fixed
Comment thread ImGui.Widgets/FaderTaper.cs Fixed
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HgjMCJ9MQRmUk6c8KABDYH
@sonarqubecloud

Copy link
Copy Markdown

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.

Domain widgets Tier 3: add ChannelFader (vertical fader with dB taper and a meter beside it)

2 participants