Make spline EG drags audible live: held and new notes follow a dragged knot
Contours ride their own seqlock block into a double-buffered engine copy, and the swap step is smoothed. Each drag move publishes contours without a model write; release still commits and reloads.
This commit is contained in:
@@ -178,6 +178,7 @@ bool ReaSamplerEditor::splineOverlayClick(const OverlayArea& waveArea, int x, in
|
||||
// At the ceiling: refused, contour untouched, nothing to roll back. Swallow the click
|
||||
// rather than letting it fall through to a marker grab under the cursor.
|
||||
if (index < 0) return true;
|
||||
publishContoursLive(); // the new point is heard before the first move, not after it
|
||||
}
|
||||
drag_ = DragKind::kSplineNode;
|
||||
curvePointIndex_ = index;
|
||||
@@ -188,7 +189,7 @@ bool ReaSamplerEditor::splineOverlayClick(const OverlayArea& waveArea, int x, in
|
||||
dragCurveRect_ = waveArea.rect;
|
||||
dragStartX_ = x;
|
||||
dragStartY_ = y;
|
||||
invalidate(); // live feedback; the commit lands on WM_LBUTTONUP
|
||||
invalidate(); // the model commit lands on WM_LBUTTONUP
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -235,7 +236,8 @@ void ReaSamplerEditor::dragWaveform(const FaceLayout& fl, int x, int y) {
|
||||
splineFor(overlayEnv_) = VelocityCurve::resolvePointDrag(
|
||||
dragStartCurve_, static_cast<std::size_t>(curvePointIndex_),
|
||||
splineOverlayBox(overlay), dx, y - dragStartY_);
|
||||
invalidate(); // live feedback; commit on release
|
||||
publishContoursLive(); // heard now; the model write stays the release's commit
|
||||
invalidate();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user