Skip to content

Add OOP EQ knob controls (Low/Mid/High) using existing knob asset#22

Draft
Copilot wants to merge 3 commits into
masterfrom
copilot/add-eq-knob-images
Draft

Add OOP EQ knob controls (Low/Mid/High) using existing knob asset#22
Copilot wants to merge 3 commits into
masterfrom
copilot/add-eq-knob-images

Conversation

Copilot AI commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

This PR adds three new EQ controls (Low, Mid, High) alongside the existing volume knob, reusing the same knob image and integrating drag-based interaction in the main player UI. The implementation introduces explicit OOP control primitives so knob behavior is clear, reusable, and isolated from rendering/event plumbing.

  • OOP control model

    • Added eq_controls.py with:
      • KnobControl: pointer hit-testing, angle/value mapping, render angle, label/percent helpers.
      • EqualizerControls: knob collection management + drag lifecycle (begin_drag, drag_to, end_drag).
    • Centralized knob math and state transitions out of the event loop.
  • UI + interaction integration

    • Replaced single-volume ad hoc state in main.py with four knob instances:
      • volume, low, mid, high.
    • Unified mouse drag handling through EqualizerControls.
    • Rendered all four knobs with the existing volume.png and per-knob labels/percent values.
  • Audio behavior updates

    • Volume continues to use the existing taper mapping.
    • Low/Mid/High now influence live output via a bounded presence gain derived from EQ knob positions, so all added knobs are functional at runtime.
  • Docs and focused coverage

    • README updated to describe volume + EQ knob behavior.
    • Added focused unit tests for knob mapping, drag flow, and invalid active-knob safety handling.
eq_controls = EqualizerControls([
    KnobControl(name="volume", label="Vol", center=(410, 582), value=0.5),
    KnobControl(name="low",    label="Low", center=(470, 582), value=0.5),
    KnobControl(name="mid",    label="Mid", center=(530, 582), value=0.5),
    KnobControl(name="high",   label="High", center=(590, 582), value=0.5),
])

changed_knob = eq_controls.drag_to(mouse_pos)
if changed_knob in {"volume", "low", "mid", "high"}:
    _apply_volume_and_eq()

Copilot AI linked an issue Apr 15, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add three EQ knob images for mids, highs, and lows Add OOP EQ knob controls (Low/Mid/High) using existing knob asset Apr 15, 2026
Copilot AI requested a review from JP1Q April 15, 2026 16:35
Copilot finished work on behalf of JP1Q April 15, 2026 16:35
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.

feat: EQ

2 participants