Type-enforce the waveform overlay contract, narrow waveformLanes to LaneSplit, fix laneCount/cache/path-fallback bugs

This commit is contained in:
2026-07-30 09:35:11 -04:00
parent 2a0d10fab5
commit fb12c53522
19 changed files with 233 additions and 174 deletions
@@ -2,8 +2,7 @@
// start/loop marker, and resolving both drags live against the pure inverse maps
// (envelope_edit, waveform_view). Windows-only.
//
// Hit-test and drag both resolve against WaveformSurface::overlay — the same full-band rect
// the overlays draw into — so a grab in the lower stereo lane reaches them.
// Overlay contract: see waveform_view.h's WaveformSurface.
#include "shell/instrument/reasampler_editor.h"
@@ -27,7 +26,7 @@ bool ReaSamplerEditor::mouseDownWaveform(const FaceLayout& fl, int x, int y) {
const std::vector<AudioSample>& pcm = monoPcmFor(selectedId_);
const std::int64_t frames = static_cast<std::int64_t>(pcm.size());
if (frames <= 0) return false;
const Rect overlay = waveformOverlayArea(fl.bands.waveform);
const OverlayArea overlay = waveformOverlayArea(fl.bands.waveform);
// Envelope nodes first (they sit on top of the markers), then the wave markers.
const double rate = liveSampleRate();
@@ -64,7 +63,7 @@ bool ReaSamplerEditor::mouseDownWaveform(const FaceLayout& fl, int x, int y) {
}
void ReaSamplerEditor::dragWaveform(const FaceLayout& fl, int x, int y) {
const Rect overlay = waveformOverlayArea(fl.bands.waveform);
const OverlayArea overlay = waveformOverlayArea(fl.bands.waveform);
const int dx = x - dragStartX_;
if (drag_ == DragKind::kEnvNode) {