Ω-W1-T5: one overlay↔waveform mapping, and loop marks that tell the truth about their mode
This commit is contained in:
@@ -336,8 +336,8 @@ anything for a trigger shape.
|
||||
- `bake_hold` — the Hold knob's value domain and nothing else: the knob's normalized [0,1] mapped onto the note-length ladder and back, ordered by LENGTH rather than by the ladder's presentation order. Split from `sample_chrome` on the same axis `deck_values` was split from `knob_deck` — that says where the cell is, this says what its position means.
|
||||
- `keyboard_strip` — piano-keyboard strip: true white/black key geometry (whites tiled at one width, blacks overlaid at one width and height, straddling their boundary), hit-test resolving black-over-white by zone, root-marker rect, the absolute-position drag resolver, and MIDI note naming under the C4 convention. **Same-class keys are one integer width by construction; the residue of an indivisible band width (`w % 75`, up to 74 px) lands in symmetric end margins, never in a key** — uniform widths and gap-free edge-to-edge tiling cannot both hold, and uniformity wins.
|
||||
- `waveform_view` — the WAVEFORM band's interior: `resolveLaneSplit` is THE lane-split decision (two lanes only when the mode is stereo AND the source has a second channel — a mono source under stereo mode is dual-mono and draws one lane), free of any pixel geometry so the meter's bar count can ask the same question without a band rect; `waveformSurface` folds it and then measures it against the band, which is why its `laneCount` can still report 1 for a Stereo split on a band too thin to divide. It also yields **the** overlay area, and `laneEnvelope` splits one multi-channel envelope pass per lane. Also maps frame span linearly across a rect; generic named draggable markers with drag-delta resolver, clamp, and zero-crossing snap, plus `markerHandleRect` — a top-strip grab tab distinct from a marker's full-height column, so two markers that share a frame stay independently grabbable (the column goes to the first in draw order; the tab, asked first, resolves the other).
|
||||
- **Overlay contract (consumed by later waveform work).** `WaveformSurface::overlay` — equivalently the standalone `waveformOverlayArea(band)` — is the FULL band in both modes. Everything riding the waveform (the amp-envelope trace and its node handles, the start/loop markers, the loop region) draws ONCE into it, spanning both stacked lanes; hit-testing resolves against the same area so a grab in the lower lane reaches them. Anything drawn or hit-tested per lane is a duplicate and a defect — structurally enforced: `overlay` is the distinct `OverlayArea` type (`editor_geometry`), not `Rect`, so every overlay-consuming API (`frameToX`/`markerAtPoint`/`resolveDragFrame`, `envelope_edit`'s `nodeAtPoint`/`resolveNodeDrag`, `envelope_overlay`'s `buildEnvelopePolyline`) rejects a lane rect at compile time rather than silently accepting one.
|
||||
- **The four marks.** One grammar — line + shaped cap + label — over START / LOOP / END / XFADE. `markerHandleRect` IS the cap: every mark's is the same rect shape, only the glyph inside differs, which is what keeps the claim arbitration seeing one nominal cap area. `capAtPoint` resolves caps in the REVERSE of the column order, so any coincident PAIR stays separable (one answers its cap, the other its column) and the crossfade — the one mark with no column — can never be shadowed. `layoutMarkLabels` places the promoted (grabbed/hovered) mark first and suppresses any box that would overlap one already placed. `crossfadeWedgeHeight` is the ONE ramp both the audible region and the ingredient ghost draw, because they are the same fade weight over the two spans it mixes.
|
||||
- **Overlay contract (consumed by later waveform work).** `WaveformSurface::overlay` — equivalently the standalone `waveformOverlayArea(band)` — is the band's DRAWN COLUMN SPAN at the band's full height, in both modes: same inset and same width as `component_geometry`'s `waveformColumnCount`, so overlay pixel and waveform column are one pixel and every overlay lands on the column that draws the frame it names. Deriving that width instead of restating the inset is what keeps the two chains from drifting apart again. Everything riding the waveform (the amp-envelope trace and its node handles, the start/loop markers, the loop region) draws ONCE into it, spanning both stacked lanes; hit-testing resolves against the same area so a grab in the lower lane reaches them. Anything drawn or hit-tested per lane is a duplicate and a defect — structurally enforced: `overlay` is the distinct `OverlayArea` type (`editor_geometry`), not `Rect`, so every overlay-consuming API (`frameToX`/`markerAtPoint`/`resolveDragFrame`, `envelope_edit`'s `nodeAtPoint`/`resolveNodeDrag`, `envelope_overlay`'s `buildEnvelopePolyline`) rejects a lane rect at compile time rather than silently accepting one.
|
||||
- **The four marks.** One grammar — line + shaped cap + label — over START / LOOP / END / XFADE. Which of them are PRESENT is the mode's answer, and drawn iff grabbable: Trigger carries START alone (the loop pair and the fade are absent, not dim), Gate always carries the pair so the drag-to-set-loop gesture survives the enable being off, and the fade needs an active loop to have a seam. `markerHandleRect` IS the cap: every mark's is the same rect shape, only the glyph inside differs, which is what keeps the claim arbitration seeing one nominal cap area. `capAtPoint` resolves caps in the REVERSE of the column order, so any coincident PAIR stays separable (one answers its cap, the other its column) and the crossfade — the one mark with no column — can never be shadowed. `layoutMarkLabels` places the promoted (grabbed/hovered) mark first and suppresses any box that would overlap one already placed. `crossfadeWedgeHeight` is the ONE ramp both the audible region and the ingredient ghost draw, because they are the same fade weight over the two spans it mixes.
|
||||
- `loop_marks` — the loop enable's state machine, split from the geometry above on the axis the surface already has: that says where a mark is, this says what the loop IS. `SampleLoop::hasLoop` is the single authority and `resolveLoopMarks`/`applyLoopMarks` are its only two folds — the resolve re-parks on `defaultLoopBounds` only when the span is one `resolveLoop` would refuse (so a user's off keeps its positions and `parked` separates the two OFF states), and the write folds collapse-to-off in and ties the crossfade to the SPAN rather than to the enable. Links `loop_span` so the span the user is offered and the span the engine accepts stay one definition.
|
||||
- `capture_browser` — capture browser: card-grid layout + bank-filter tab strip geometry and hit-test; knows only counts and rects, draws nothing.
|
||||
- `browser_scroll` — scroll + type-to-filter layered over `capture_browser`: vertical scroll offset, scrollbar thumb, thumb-drag mapping, and name-substring search.
|
||||
|
||||
@@ -22,10 +22,14 @@ reasampler_test(keyboard_strip LINK keyboard_strip sample_bands sample_chrome)
|
||||
|
||||
# sample_bands is PUBLIC since resolveLaneSplit answers in its LaneSplit — the meter's bar
|
||||
# count consumes that answer, so the type is part of this module's surface, not an internal.
|
||||
# component_geometry is PRIVATE: the overlay area is DERIVED from the draw chain's own column
|
||||
# count so the two cannot drift, but no type of it appears in this module's header.
|
||||
reasampler_pure_library(waveform_view
|
||||
SOURCES waveform_view.cpp
|
||||
LINK PUBLIC editor_geometry peaks sample_bands)
|
||||
reasampler_test(waveform_view LINK waveform_view sample_bands)
|
||||
LINK PUBLIC editor_geometry peaks sample_bands PRIVATE component_geometry)
|
||||
# component_geometry is linked for the test too: proving the overlay rides the drawn column
|
||||
# band takes the real column count, not a copy of it.
|
||||
reasampler_test(waveform_view LINK waveform_view sample_bands component_geometry)
|
||||
|
||||
# The loop enable's state machine. Links loop_span for the park bounds — the span the user is
|
||||
# offered and the span the engine accepts stay one definition.
|
||||
|
||||
@@ -37,9 +37,10 @@ SplineEdit resolveSplineEdit(const VelocityCurve& curve, const VelocityCurve::Bo
|
||||
SplineGesture gesture, int x, int y);
|
||||
|
||||
// The contour's mapping box inside the waveform overlay: the FULL area, so the drawn contour
|
||||
// spans the whole sample width 1:1 with its time axis. No inset — unlike the popup's box, which
|
||||
// insets to keep endpoint handles clear of the sheet border, this one must stay 1:1 with the
|
||||
// waveform beneath it. Takes the overlay (not a lane) — see waveform_view.h's overlay contract.
|
||||
// spans the whole sample width 1:1 with its time axis. It adds no inset of its own — unlike the
|
||||
// popup's box, which insets to keep endpoint handles clear of the sheet border — because the
|
||||
// overlay area IS the drawn column span already, which is what makes the 1:1 claim true rather
|
||||
// than off by the waveform's inset. Takes the overlay (not a lane) — see waveform_view.h.
|
||||
VelocityCurve::Box splineOverlayBox(const OverlayArea& area);
|
||||
|
||||
// Two more rules complete the grammar. Both are enforced in the shell — mouse-tracking / drag
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <cstdlib> // std::abs (int overload)
|
||||
|
||||
#include "core/instrument/ui/sample_bands.h" // waveformLanes (the band's lane inventory)
|
||||
#include "core/ui/component_geometry.h" // waveformColumnCount (THE draw chain's columns)
|
||||
|
||||
namespace reasampler::instrument::ui {
|
||||
|
||||
@@ -21,7 +22,14 @@ std::int64_t clampFrame(std::int64_t f, std::int64_t frameCount) {
|
||||
} // namespace
|
||||
|
||||
OverlayArea waveformOverlayArea(const Rect& band) {
|
||||
return OverlayArea{band.empty() ? Rect{} : band};
|
||||
if (band.empty()) return OverlayArea{};
|
||||
// The overlay IS the drawn column band, so an overlay pixel and a waveform column are the
|
||||
// same pixel. Both the width and the inset are DERIVED from the draw chain's own column
|
||||
// count rather than restated here — a second copy of the inset is how the two drifted
|
||||
// apart, and test_component_geometry pins the symmetry this halving rests on.
|
||||
const int columns = ::reasampler::ui::waveformColumnCount(band);
|
||||
if (columns <= 0) return OverlayArea{};
|
||||
return OverlayArea{Rect{band.x + (band.width - columns) / 2, band.y, columns, band.height}};
|
||||
}
|
||||
|
||||
LaneSplit resolveLaneSplit(bool stereoMode, int sourceChannels) {
|
||||
@@ -52,9 +60,12 @@ int frameToX(const OverlayArea& area, std::int64_t frameCount, std::int64_t fram
|
||||
const int w = std::max(0, area.rect.width);
|
||||
if (frameCount <= 0 || w <= 0) return area.rect.x;
|
||||
const std::int64_t f = clampFrame(frame, frameCount);
|
||||
// x = left + round(f * w / frameCount); multiply before divide to keep this exact.
|
||||
const std::int64_t num = f * static_cast<std::int64_t>(w) + frameCount / 2;
|
||||
return area.rect.x + static_cast<int>(num / frameCount);
|
||||
// The exact inverse of the partition below: the column holding frame f is
|
||||
// ceil((f+1)*w/N) - 1, written as one truncating divide. min(w) covers only the closed
|
||||
// domain's top end — f == frameCount is a span's EXCLUSIVE edge, not a frame, and lands on
|
||||
// the band's right edge. (f+1)*w stays inside int64 for any drawable band.
|
||||
const std::int64_t col = ((f + 1) * static_cast<std::int64_t>(w) - 1) / frameCount;
|
||||
return area.rect.x + static_cast<int>(std::min<std::int64_t>(col, w));
|
||||
}
|
||||
|
||||
std::int64_t xToFrame(const OverlayArea& area, std::int64_t frameCount, int x) {
|
||||
@@ -63,10 +74,11 @@ std::int64_t xToFrame(const OverlayArea& area, std::int64_t frameCount, int x) {
|
||||
if (frameCount <= 0 || w <= 0) return 0;
|
||||
if (x <= r.x) return 0;
|
||||
if (x >= r.right()) return frameCount;
|
||||
const std::int64_t dx = static_cast<std::int64_t>(x - r.x);
|
||||
// Inverse of frameToX: frame = round(dx * frameCount / w).
|
||||
const std::int64_t num = dx * frameCount + static_cast<std::int64_t>(w) / 2;
|
||||
return clampFrame(num / static_cast<std::int64_t>(w), frameCount);
|
||||
// THE partition, in the same integer form peaks' computeEnvelope/columnMinMax bin with:
|
||||
// column c owns frames [c*N/w, (c+1)*N/w). This answers a column's FIRST frame, so it is
|
||||
// the frame that column actually draws.
|
||||
const std::int64_t col = static_cast<std::int64_t>(x - r.x);
|
||||
return clampFrame(col * frameCount / static_cast<std::int64_t>(w), frameCount);
|
||||
}
|
||||
|
||||
Rect markerHandleRect(const OverlayArea& area, std::int64_t frameCount, std::int64_t frame) {
|
||||
|
||||
@@ -21,15 +21,15 @@ using audio::AudioSample;
|
||||
// What the waveform band actually draws: the channel lane(s), and THE rect every overlay
|
||||
// riding the waveform occupies.
|
||||
//
|
||||
// OVERLAY CONTRACT — `overlay` is the whole band in BOTH modes, never a lane. The amp
|
||||
// envelope trace and its node handles, the start/loop markers, and the loop region draw
|
||||
// OVERLAY CONTRACT — `overlay` spans the whole band's HEIGHT in BOTH modes, never a lane. The
|
||||
// amp envelope trace and its node handles, the start/loop markers, and the loop region draw
|
||||
// ONCE into `overlay`, spanning both stacked lanes in stereo. Hit-testing reads the same
|
||||
// rect, so a grab in the lower lane resolves to the same overlay item as one in the upper.
|
||||
// Anything that draws per lane is a duplicate and a defect.
|
||||
struct WaveformSurface {
|
||||
Rect upper; // lane 0 -> channel 0 (LEFT); the whole band when single-lane
|
||||
Rect lower; // lane 1 -> channel 1 (RIGHT); empty() when single-lane
|
||||
OverlayArea overlay; // the full band, both modes
|
||||
OverlayArea overlay; // the band's drawn column span, full height, both modes
|
||||
int laneCount = 0; // 0 on a degenerate band, else 1 or 2 — matches `lower`'s emptiness
|
||||
// (2 iff lower non-empty). For a non-empty band <= 2px tall, `upper`
|
||||
// can be empty too while this still reports 1 — unreachable through
|
||||
@@ -51,6 +51,11 @@ WaveformSurface waveformSurface(const Rect& band, bool stereoMode, int sourceCha
|
||||
// THE overlay area, standalone — same value as WaveformSurface::overlay, for the hit-test
|
||||
// paths that have no channel count to hand. An overlay's rect never depends on the lane
|
||||
// split, which is exactly the contract.
|
||||
//
|
||||
// It is the band's DRAWN COLUMN SPAN, not the band: same inset, same width as
|
||||
// component_geometry's waveformColumnCount, so overlay pixel i and waveform column i are one
|
||||
// pixel. Full band HEIGHT still — the inset is horizontal only. Empty when the band is too
|
||||
// narrow to hold a column.
|
||||
OverlayArea waveformOverlayArea(const Rect& band);
|
||||
|
||||
// The single-channel envelope lane `lane` draws, taken from a multi-channel envelope
|
||||
@@ -64,13 +69,29 @@ audio::Envelope laneEnvelope(const audio::Envelope& env, int lane);
|
||||
// edge-grab idiom.
|
||||
inline constexpr int kMarkerGrabWidth = 5;
|
||||
|
||||
// x pixel of `frame` under the linear map: frame 0 -> area.x, frame frameCount -> area.right().
|
||||
// Frame is clamped to [0, frameCount] before mapping. frameCount <= 0 or a zero-width area pins
|
||||
// every frame to area.x. Takes the overlay (not a lane) — see the OVERLAY CONTRACT above.
|
||||
// --- THE frame<->pixel mapping ---------------------------------------------------------------
|
||||
//
|
||||
// ONE map, shared with the waveform draw: column c owns frames [c*N/w, (c+1)*N/w), which is
|
||||
// peaks' own bin partition, over an area that is exactly the drawn column span. So a mark, the
|
||||
// loop fill, a wedge and the contour all land on the column that draws the frame they name.
|
||||
// A SECOND frame->pixel map anywhere is the defect this pair exists to prevent.
|
||||
//
|
||||
// SAMPLE-ACCURATE WHEN frames < columns: one frame then spans several columns, and frameToX
|
||||
// answers the LAST of them — that end is what the exact inverse of the partition above yields
|
||||
// in BOTH regimes, so it needs one formula rather than a regime branch. The mark is inside its
|
||||
// own frame's span either way, and xToFrame round-trips it exactly (xToFrame(frameToX(f)) == f
|
||||
// for every f whenever frames <= columns, i.e. exactly where the choice of end is observable).
|
||||
// Above that, several frames share a column and the round trip snaps to the column's first
|
||||
// frame, which is the quantization the shared column already is.
|
||||
|
||||
// x pixel of `frame`: the column that draws it. `frameCount` itself is a span's EXCLUSIVE end,
|
||||
// not a frame, and maps to area.right(). Frame is clamped to [0, frameCount] first;
|
||||
// frameCount <= 0 or a zero-width area pins every frame to area.x. Takes the overlay (not a
|
||||
// lane) — see the OVERLAY CONTRACT above.
|
||||
int frameToX(const OverlayArea& area, std::int64_t frameCount, std::int64_t frame);
|
||||
|
||||
// Inverse of frameToX: the frame a point x maps to, clamped to [0, frameCount]. A point left of
|
||||
// area.x yields 0; right of area.right() yields frameCount.
|
||||
// The FIRST frame the column at `x` draws — the partition's own begin, so this is the frame
|
||||
// that column shows. A point left of area.x yields 0; right of area.right() yields frameCount.
|
||||
std::int64_t xToFrame(const OverlayArea& area, std::int64_t frameCount, int x);
|
||||
|
||||
// A marker's grab HANDLE — THE CAP, in the mark grammar's vocabulary: a tab riding the top of
|
||||
|
||||
@@ -150,24 +150,24 @@ instrument::ui::WaveMarks ReaSamplerEditor::waveMarksFor(const SetupMarkers& m)
|
||||
w.frame[static_cast<int>(WaveMark::kLoopEnd)] = m.loopEnd;
|
||||
// The crossfade grows LEFT from the seam it closes, which is where it is audible.
|
||||
w.frame[static_cast<int>(WaveMark::kCrossfade)] = m.loopEnd - m.crossfade;
|
||||
// Trigger has no loop at all, so the pair and the fade are ABSENT rather than shown in an
|
||||
// off state — a mark whose gesture the mode does not offer was read as broken, not as off.
|
||||
// Gate keeps the pair whatever the enable says: that is the drag-to-set-loop affordance.
|
||||
// The crossfade mark belongs to an ACTIVE loop: with the enable off there is no seam for it
|
||||
// to sit on, and no length to drag.
|
||||
const bool gate = loopControlsLive();
|
||||
w.present[static_cast<int>(WaveMark::kStart)] = true;
|
||||
w.present[static_cast<int>(WaveMark::kLoopStart)] = true;
|
||||
w.present[static_cast<int>(WaveMark::kLoopEnd)] = true;
|
||||
w.present[static_cast<int>(WaveMark::kCrossfade)] = m.hasLoop;
|
||||
w.present[static_cast<int>(WaveMark::kLoopStart)] = gate;
|
||||
w.present[static_cast<int>(WaveMark::kLoopEnd)] = gate;
|
||||
w.present[static_cast<int>(WaveMark::kCrossfade)] = gate && m.hasLoop;
|
||||
return w;
|
||||
}
|
||||
|
||||
instrument::ui::WaveMarks ReaSamplerEditor::grabbableMarks(const SetupMarkers& m) const {
|
||||
using instrument::ui::WaveMark;
|
||||
instrument::ui::WaveMarks w = waveMarksFor(m);
|
||||
if (!loopControlsLive()) {
|
||||
w.present[static_cast<int>(WaveMark::kLoopStart)] = false;
|
||||
w.present[static_cast<int>(WaveMark::kLoopEnd)] = false;
|
||||
w.present[static_cast<int>(WaveMark::kCrossfade)] = false;
|
||||
}
|
||||
return w;
|
||||
// Drawn IFF grabbable. Kept as its own fold because paint and hit-test stay separate
|
||||
// questions, but do NOT re-add a suppression here: the Gate-with-loop-off marks are drawn
|
||||
// grey precisely so they can still be dragged, and dragging one is what turns the enable on.
|
||||
return waveMarksFor(m);
|
||||
}
|
||||
|
||||
void ReaSamplerEditor::setLoopEnabled(bool on) {
|
||||
|
||||
@@ -44,13 +44,16 @@ namespace {
|
||||
// cap, never a curve.
|
||||
constexpr Role kRoleStartMarker = Role::OverlayTrace;
|
||||
constexpr Role kRoleLoopMarker = Role::AccentSecondary;
|
||||
// A loop mark whose enable is off keeps its position and its cap — and its full weight, since
|
||||
// it is still draggable. It changes HUE, not opacity: the dim teal it replaces read as broken
|
||||
// rather than as off. Grey against the lime is deliberately under the 3:1 state-indicator floor
|
||||
// the two-neighbour rule (core/ui/CLAUDE.md) sets for a LIVE mark — an inactive control is
|
||||
// exempt, and that lower contrast is the off cue.
|
||||
constexpr Role kRoleLoopMarkerOff = Role::TextDim;
|
||||
|
||||
// Mark weights. A Disabled mark (loop off, or Trigger) keeps its position and its cap so the
|
||||
// information survives the state; the crossfade is a SOFT boundary and rides below the loop
|
||||
// pair's weight at rest.
|
||||
// Mark weights. The crossfade is a SOFT boundary and rides below the loop pair's weight at rest.
|
||||
constexpr float kMarkAlpha = 1.0f;
|
||||
constexpr float kMarkAlphaXfade = 0.7f;
|
||||
constexpr float kMarkAlphaDisabled = 0.4f;
|
||||
|
||||
// The dashed crossfade line: a 3 px stroke every 6 px down the band.
|
||||
constexpr int kDashOn = 3;
|
||||
@@ -217,9 +220,11 @@ void ReaSamplerEditor::paintWaveform(LICE_IBitmap* bmp, const Rect& band,
|
||||
// stereo view reads one loop region rather than two.
|
||||
const OverlayArea& overlay = surface.overlay;
|
||||
const Rect& overlayRect = overlay.rect;
|
||||
const bool loopLive = loopControlsLive();
|
||||
const bool loopOn = m.hasLoop && loopLive;
|
||||
const WaveMarks marks = waveMarksFor(m);
|
||||
// The mark set is the single source for whether this face has a loop to say anything about
|
||||
// — in Trigger the pair is absent, so the span, the wedges and the caption go with it.
|
||||
const bool loopShown = marks.present[static_cast<int>(WaveMark::kLoopStart)];
|
||||
const bool loopOn = m.hasLoop && loopShown;
|
||||
const LICE_pixel loopInk = toLice(roleColor(kRoleLoopMarker));
|
||||
|
||||
const int lx = frameToX(overlay, frames, m.loopStart);
|
||||
@@ -249,10 +254,10 @@ void ReaSamplerEditor::paintWaveform(LICE_IBitmap* bmp, const Rect& band,
|
||||
}
|
||||
|
||||
// The state caption, centred in the span: the two OFF states say different things because
|
||||
// they mean different things, and Trigger's refusal names its own reason.
|
||||
const char* caption = nullptr;
|
||||
if (!loopLive) caption = "LOOP \xe2\x80\x94 GATE ONLY"; // "LOOP — GATE ONLY" (em dash, UTF-8)
|
||||
else if (!m.hasLoop) caption = m.parked ? "DRAG TO SET LOOP" : "LOOP OFF";
|
||||
// they mean different things, and the grey marks alone cannot say WHICH off state this is
|
||||
// or that dragging will fix it. Trigger has no span to centre anything in.
|
||||
const char* caption =
|
||||
(loopShown && !m.hasLoop) ? (m.parked ? "DRAG TO SET LOOP" : "LOOP OFF") : nullptr;
|
||||
if (caption != nullptr && rx > lx) {
|
||||
// Tight box (kMarkLabelHeight, not the whole overlay) centered on the same midline the
|
||||
// full-height rect already centered DT_VCENTER text on, so the scrim darkens only the
|
||||
@@ -280,16 +285,16 @@ void ReaSamplerEditor::paintWaveform(LICE_IBitmap* bmp, const Rect& band,
|
||||
Role::TextDim);
|
||||
}
|
||||
|
||||
// Line + shaped cap per mark, one grammar. A mark whose gesture is refused draws Disabled
|
||||
// rather than hidden — the position is information the user put there.
|
||||
// Line + shaped cap per mark, one grammar. A loop mark with the enable off draws grey but
|
||||
// full weight — the position is information the user put there, and it is still draggable.
|
||||
for (int i = 0; i < kWaveMarkCount; ++i) {
|
||||
if (!marks.present[i]) continue;
|
||||
const WaveMark which = static_cast<WaveMark>(i);
|
||||
const bool isStart = (which == WaveMark::kStart);
|
||||
const bool dim = !isStart && !loopOn;
|
||||
const LICE_pixel ink = isStart ? toLice(roleColor(kRoleStartMarker)) : loopInk;
|
||||
const float alpha = dim ? kMarkAlphaDisabled
|
||||
: (which == WaveMark::kCrossfade ? kMarkAlphaXfade : kMarkAlpha);
|
||||
const bool off = !isStart && !loopOn;
|
||||
const LICE_pixel ink = isStart ? toLice(roleColor(kRoleStartMarker))
|
||||
: (off ? toLice(roleColor(kRoleLoopMarkerOff)) : loopInk);
|
||||
const float alpha = (which == WaveMark::kCrossfade) ? kMarkAlphaXfade : kMarkAlpha;
|
||||
const int mx = frameToX(overlay, frames, marks.frame[i]);
|
||||
if (which == WaveMark::kCrossfade) {
|
||||
// Dashed: a soft boundary, not a hard one.
|
||||
|
||||
Reference in New Issue
Block a user