Bake window derives itself: %-knob fold, declick pad, Gate held to exhaustion, preview velocity; Hold is the one knob a loop needs

This commit is contained in:
2026-08-01 20:26:04 -04:00
parent d3894dae6d
commit 19aeb92775
36 changed files with 1040 additions and 274 deletions
@@ -48,6 +48,19 @@ bool ReaSamplerEditor::mouseDownChrome(const FaceLayout& fl, int x, int y) {
invalidate();
return true;
}
// Bake Hold: the same grab-anchored knob drag, and inert on exactly the ticks it is not
// drawn — the cell's width is reserved either way (sample_chrome.h says why).
if (bakeHoldNeeded_ && contains(cr.holdCell, x, y)) {
drag_ = DragKind::kDeckKnob;
dragParamId_ = kBakeHoldKnobId;
dragInnerCellId_ = -1;
dragKnobStartValue_ = bakeHoldNorm();
dragStartParams_ = params_;
dragStartX_ = x;
dragStartY_ = y;
invalidate();
return true;
}
// Radial preview-velocity knob: grab-anchored vertical drag — the grab itself never
// jumps the value; the delta from the grab point maps via knobDragValue.
if (contains(cr.velCell, x, y)) {
@@ -94,6 +107,14 @@ bool ReaSamplerEditor::doubleClickChrome(const FaceLayout& fl, int x, int y) {
// radial knob drawn by the same primitive, so it resolves through the same target rule
// (inKnobFace), against the drawn circle rather than the cell's label band.
if (selectedId_.empty() || !processor_) return false;
if (bakeHoldNeeded_ && inKnobFace(fl.chrome.holdKnob, x, y)) {
// The default is READ off a default-constructed parameter set, so there is no second
// table of defaults to drift from the codec's own lift.
params_.bakeHold = InstrumentParams{}.bakeHold;
commitAndReload();
invalidate();
return true;
}
if (!inKnobFace(fl.chrome.velKnob, x, y)) return false;
processor_->setPreviewVelocity(kPreviewVelocityDefault);
invalidate();
@@ -117,6 +138,7 @@ ReaSamplerEditor::HoverTarget ReaSamplerEditor::hoverChrome(const FaceLayout& fl
const ChromeRects& cr = fl.chrome;
if (contains(cr.navBrowse, x, y)) return {HoverKind::kNavBrowse, -1};
if (selectedId_.empty()) return {}; // empty state — no interactive surfaces beyond nav
if (bakeHoldNeeded_ && contains(cr.holdCell, x, y)) return {HoverKind::kHoldKnob, -1};
if (contains(cr.bake, x, y)) return {HoverKind::kBake, -1};
if (contains(cr.preview, x, y)) return {HoverKind::kPreview, -1};
if (contains(cr.velCell, x, y)) return {HoverKind::kVelKnob, -1};