feat: legible ReaSampler 9000 editor — bigger knobs, ms time constants, per-ring double-click reset, and an antialiased draw pass
This commit is contained in:
@@ -111,6 +111,13 @@ inline void drawTitleBand(LICE_IBitmap* bmp, const instrument::ui::Rect& title,
|
||||
kitText(bmp, titleText, readout.c_str(), Font::Title, ui::Role::TextPrimary);
|
||||
}
|
||||
|
||||
// Stroke widths for the radial faces. The value arc is drawn as adjacent 1px AA arcs rather
|
||||
// than one thick primitive — LICE has no thick-arc call, and stacking radii is what keeps every
|
||||
// ring antialiased.
|
||||
inline constexpr int kKnobValueArcPx = 3;
|
||||
inline constexpr int kInnerDialArcPx = 2;
|
||||
inline constexpr int kKnobNeedlePx = 2;
|
||||
|
||||
// Draws one radial knob face: param_slider owns the value<->angle map; this turns it into
|
||||
// LICE calls. LICE takes radians, and drawing the 7->5 o'clock sweep through the top needs
|
||||
// a continuous angle span, so degrees convert as (deg - 360) * pi/180, mapping 210..510
|
||||
@@ -144,16 +151,19 @@ inline void drawKnobFace(LICE_IBitmap* bmp, const instrument::ui::Rect& knobRect
|
||||
(arc.startDeg + v * instrument::ui::knobSweepDeg(arc) - 360.0) * kDegToRad);
|
||||
const ui::Role valueRole = disabled ? ui::Role::TextDim
|
||||
: (hot ? ui::Role::AccentHot : ui::Role::AccentPrimary);
|
||||
LICE_Arc(bmp, cx, cy, rOuter, a0, av, toLice(ui::roleColor(valueRole)), 1.0f, 0, true);
|
||||
const LICE_pixel valueCol = toLice(ui::roleColor(valueRole));
|
||||
for (int i = 0; i < kKnobValueArcPx; ++i) {
|
||||
LICE_Arc(bmp, cx, cy, rOuter - static_cast<float>(i), a0, av, valueCol, 1.0f, 0, true);
|
||||
}
|
||||
}
|
||||
// Needle: from ~35% radius out to the rim at the value's angle.
|
||||
// Needle: from ~35% radius out to the rim at the value's angle. ThickFLine keeps the float
|
||||
// endpoints AND is always antialiased, so the needle is smooth at every angle.
|
||||
const KnobPoint tip = instrument::ui::knobNeedlePoint(kg, arc, v);
|
||||
const float ix = cx + static_cast<float>((tip.x - kg.centerX) * 0.35);
|
||||
const float iy = cy + static_cast<float>((tip.y - kg.centerY) * 0.35);
|
||||
const double ix = kg.centerX + (tip.x - kg.centerX) * 0.35;
|
||||
const double iy = kg.centerY + (tip.y - kg.centerY) * 0.35;
|
||||
const ui::Role needleRole = disabled ? ui::Role::TextDim : ui::Role::TextPrimary;
|
||||
LICE_Line(bmp, static_cast<int>(ix + 0.5f), static_cast<int>(iy + 0.5f),
|
||||
static_cast<int>(tip.x + 0.5f), static_cast<int>(tip.y + 0.5f),
|
||||
toLice(ui::roleColor(needleRole)), 1.0f, 0, true);
|
||||
LICE_ThickFLine(bmp, ix, iy, tip.x, tip.y, toLice(ui::roleColor(needleRole)), 1.0f, 0,
|
||||
kKnobNeedlePx);
|
||||
}
|
||||
|
||||
// The concentric INNER dial: a second value on the same cell, drawn in the categorical
|
||||
@@ -184,12 +194,15 @@ inline void drawInnerDial(LICE_IBitmap* bmp, const instrument::ui::Rect& innerRe
|
||||
(arc.startDeg + v * instrument::ui::knobSweepDeg(arc) - 360.0) * kDegToRad);
|
||||
const ui::Role arcRole = disabled ? ui::Role::TextDim
|
||||
: (hot ? ui::Role::AccentHot : ui::Role::AccentTertiary);
|
||||
LICE_Arc(bmp, cx, cy, r, a0, av, toLice(ui::roleColor(arcRole)), 1.0f, 0, true);
|
||||
const LICE_pixel arcCol = toLice(ui::roleColor(arcRole));
|
||||
for (int i = 0; i < kInnerDialArcPx; ++i) {
|
||||
LICE_Arc(bmp, cx, cy, r - static_cast<float>(i), a0, av, arcCol, 1.0f, 0, true);
|
||||
}
|
||||
const KnobPoint tip = instrument::ui::knobNeedlePoint(kg, arc, v);
|
||||
LICE_Line(bmp, static_cast<int>(cx + 0.5f), static_cast<int>(cy + 0.5f),
|
||||
static_cast<int>(tip.x + 0.5f), static_cast<int>(tip.y + 0.5f),
|
||||
toLice(ui::roleColor(disabled ? ui::Role::TextDim : ui::Role::AccentTertiary)),
|
||||
1.0f, 0, true);
|
||||
LICE_FLine(bmp, static_cast<float>(kg.centerX), static_cast<float>(kg.centerY),
|
||||
static_cast<float>(tip.x), static_cast<float>(tip.y),
|
||||
toLice(ui::roleColor(disabled ? ui::Role::TextDim : ui::Role::AccentTertiary)),
|
||||
1.0f, 0, true);
|
||||
}
|
||||
|
||||
#endif // _WIN32
|
||||
|
||||
Reference in New Issue
Block a user