v0.6.0 UI6-C6 partial: spectrum hover readout (Hz + dB) - #16
Open
SeamusMullan wants to merge 1 commit into
Open
Conversation
UI6-C6 partial — the spectrum already had draggable crossover handles and per-band threshold-line drag (mouseDown / mouseDrag). What was missing for "direct manipulation" feel: an in-context readout of where the cursor actually sits in frequency / dB. This commit adds: - hoverValid / hoverHz / hoverDb / hoverPos state in SpectrumVisualizer - mouseMove fills them when the cursor is inside the plot area and repaints; mouseExit clears them and repaints - paint() draws a small rounded-rect readout near the cursor with the Hz value (auto kHz above 1 kHz) and the dB value with sign, placed so it does not run off the right edge or sit under the cursor itself Per-band gain-reduction overlay still pending — needs a per-band reduction aggregate that the existing fetchSpectralVisualData() does not expose; deferred to v0.6.1. Refs v0.6.0-threshold.md UI6-C6. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an in-context hover readout to the spectrum plot so users can see the cursor’s frequency (Hz/kHz) and dB value directly on the visualization, supporting the UI6-C6 “direct manipulation surface” goal.
Changes:
- Added hover state (
hoverValid,hoverHz,hoverDb,hoverPos) toSpectrumVisualizer. - Updated
mouseMove/mouseExitto populate/clear hover state. - Updated
paint()to render a small rounded readout box near the cursor with edge-aware positioning.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| source/SpectrumVisualizer.h | Adds stored hover state for the cursor readout. |
| source/SpectrumVisualizer.cpp | Computes hover readout values on mouse movement and draws the Hz/dB overlay in paint(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
755
to
+765
| setMouseCursor (juce::MouseCursor::NormalCursor); | ||
|
|
||
| // UI6-C6: record cursor freq + dB so paint() can render a readout near it. | ||
| if (plot.contains (juce::Point<float> (mx, my))) | ||
| { | ||
| hoverValid = true; | ||
| hoverPos = e.position.toInt(); | ||
| hoverHz = xToHz (mx, kFreqPlotMinHz, fMax, plot); | ||
| hoverDb = yToDb (my, plot, dbFloor, dbCeil); | ||
| repaint(); | ||
| } |
Comment on lines
773
to
+780
| void SpectrumVisualizer::mouseExit (const juce::MouseEvent&) | ||
| { | ||
| setMouseCursor (juce::MouseCursor::NormalCursor); | ||
| if (hoverValid) | ||
| { | ||
| hoverValid = false; | ||
| repaint(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Partial UI6-C6 — the spectrum already had draggable crossover handles and per-band threshold-line drag from v0.5.0 work. What was missing for the "direct manipulation surface" feel: an in-context readout of where the cursor sits in frequency / dB.
This PR adds:
hoverValid/hoverHz/hoverDb/hoverPosstate inSpectrumVisualizer.mouseMovefills them when the cursor is inside the plot area and triggers a repaint;mouseExitclears them.paint()draws a small rounded-rect readout near the cursor with the Hz value (auto kHz above 1 kHz) and the dB value with sign, positioned so it does not run off the right edge or sit under the cursor.Still deferred for UI6-C6 / scoped for v0.6.1
fetchSpectralVisualData()does not expose; either a small DSP plumbing change or a post-fetch averaging pass in the visualiser.Refs
v0.6.0-threshold.mdUI6-C6.Dependencies
Test plan
cmake --build build --target BandGate_VST3succeeds.🤖 Generated with Claude Code