loop: crossfade the Gate sustain seam, and unshadow the loop handles that made loop points look gone

This commit is contained in:
2026-07-31 17:36:36 -04:00
parent a90ccd9a00
commit 0fe4166d7d
25 changed files with 991 additions and 64 deletions
+14 -4
View File
@@ -93,8 +93,11 @@ private:
using ParamControl = instrument::ui::DeckParam;
// The waveform markers on the waveform band: start-point + the sustain loop's two ends,
// in draw + hit order.
enum class WaveMarker { kStart = 0, kLoopStart = 1, kLoopEnd = 2, kCount = 3 };
// 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
// markerHandleRect), because at a zero fade it sits exactly on the loop start.
enum class WaveMarker { kStart = 0, kLoopStart = 1, kLoopEnd = 2, kLoopXfade = 3,
kCount = 4 };
// The interactive element under the pointer, resolved live in WM_MOUSEMOVE. `index`
// disambiguates within a kind (tab ordinal, visible-card index, control-row id); -1 when
@@ -291,12 +294,15 @@ private:
std::string samplePathFor(const std::string& sampleId) const;
// The effective loop + start markers for the loaded capture: the parameter set's
// override when one is set, else the bank's loop intrinsic / frame 0. Absent loop ->
// loopStart==loopEnd==0. `frames` defaults loopEnd when the bank left the loop empty.
// override when one is set, else the bank's loop intrinsic / frame 0. With no loop set,
// the loop handles park on loop_span's defaultLoopBounds so both stay grabbable — the
// frame-0 default they replace put loopStart under the start marker, where nothing could
// reach it.
struct SetupMarkers {
std::int64_t start = 0;
std::int64_t loopStart = 0;
std::int64_t loopEnd = 0;
std::int64_t crossfade = 0; // pre-seam fade, SOURCE frames; handle at loopStart - this
bool hasLoop = false; // whether a sustain loop is set (drives the "no loop" affordance)
};
SetupMarkers pickedMarkers(std::int64_t frames) const;
@@ -305,6 +311,10 @@ private:
// callers decide live-drag vs final commit.
void applyMarkers(const SetupMarkers& m);
// Arms a waveform-marker drag: the grabbed marker plus the snapshot the pixel-delta
// resolver and the inter-marker clamps measure from.
void beginMarkerDrag(WaveMarker which, const SetupMarkers& m, std::int64_t frames, int x);
// Deck knobs edit the parameter set's PlaySeconds (play mode + AHDSR; pitch engine + AD
// pitch envelope) — wall-clock seconds, rate-free; the build resolves to frames.