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
+17
View File
@@ -99,6 +99,11 @@ private:
// the pure deck_groups module's — this alias keeps the shell's spelling.
using ParamControl = instrument::ui::DeckParam;
// The chrome knobs are drags of kind kDeckKnob with no place in the deck's id space, so
// they take negative sentinels (-2 is the preview velocity). Being outside
// [0, DeckParam::kCount) is what keeps liveCommitFor answering "not a live control".
static constexpr int kBakeHoldKnobId = -3;
// The waveform markers on the waveform band: start-point + the sustain loop's two ends,
// in draw + hit order, then the crossfade handle. The crossfade is NOT part of the
// full-height column hit-test — it answers only in its top-strip handle (waveform_view's
@@ -127,6 +132,7 @@ private:
kEnvRadio, // an envelope deck's overlay-select radio (index = radio control id)
kCurveNode, // a velocity-curve control point (index = point index)
kVelKnob, // the chrome preview-velocity radial knob
kHoldKnob, // the chrome bake-Hold radial knob
kStripKey, // a piano-strip key (index = MIDI note); carries the name tooltip
kPopupClose, // the curve popup's Close (x) button
};
@@ -334,6 +340,11 @@ private:
};
SetupMarkers pickedMarkers(std::int64_t frames) const;
// Whether the loaded sound's bake window needs the user's Hold — the pure predicate
// (bake_plan.h) answered against the markers this face is showing. Decodes and reads the
// bank, so it is called on the sync tick, not per paint.
bool resolveBakeHoldNeeded();
// Writes `m` into params_ as the loop/start override. Does NOT call commitAndReload —
// callers decide live-drag vs final commit.
void applyMarkers(const SetupMarkers& m);
@@ -378,6 +389,8 @@ private:
double liveSampleRate() const;
// Persisted preview velocity as a 0..1 slider value (MIDI 1..127 -> [0,1]).
double previewVelocity01() const;
// The bake Hold division as a 0..1 knob position, via the pure bake_hold map.
double bakeHoldNorm() const;
// The normalized [0,1] value a deck knob shows — parameter-set ids route through
// controlValue/keyTrack; processor-side ids (voice count, master gain, preview velocity
@@ -430,6 +443,10 @@ private:
// Whether the extension's bake action is registered, resolved on the same tick that
// governs the button's paint, so the control is never enabled and then refusing.
bool bakeAvailable_ = false;
// Whether the bake's window still needs the Hold control (bake_plan.h's
// bakeWindowNeedsHold). Resolved on the same tick as bakeAvailable_ rather than per paint:
// answering it costs a bridge read + bank parse whenever no loop override is set.
bool bakeHoldNeeded_ = false;
std::string bakeMessage_; // last outcome, shown in the title band
int bakeMessageTicks_ = 0; // sync ticks the message survives