Name captures after their source track: label and filename both, on every interactive mint site, and show the name on the panel card
This commit is contained in:
@@ -106,7 +106,7 @@ L7 sub-pass, 2026-07-27):
|
||||
- `mode_enable` — pure opposite-mode enablement predicate: given the active mode, computes per-button live/disabled state for the four Item/Track × Arrange/Design tag buttons.
|
||||
- `tooltip` — pure tooltip placement + prefix-strip: strips the `ReaSampler:` display prefix from the registered action phrase; width clamped to the client rect.
|
||||
- `card_drag` — pure drag-gesture precedence + slot hit-test: leave-client → OS drag-out; other-bank → move/copy; same-bank → reorder / Alt-over-occupied → replace.
|
||||
- `card_meta` — pure card-metadata formatters: bars.beats.subdivisions and seconds.milliseconds; blank when the sample is unstamped.
|
||||
- `card_meta` — pure card-metadata formatters: bars.beats.subdivisions and seconds.milliseconds; blank when the sample is unstamped. Also `cardNameStrip` + the two strip constants — the card's name line sits across the TOP of the cell, drawn over the waveform exactly as the length read-out is over it at the bottom, and is suppressed entirely on a cell with no room for both strips plus a waveform band.
|
||||
- `stroke_aa` — analytic antialiased thick-stroke COVERAGE (the shell blends it): `StrokeCanvas`, a reusable mask holding distance-to-polyline coverage MAX-accumulated across segments, plus `strokePolyline` / `strokeBounds` / `appendArc` / `rasterRowOffset` (the row-major offset
|
||||
math for a possibly bottom-up raster, pulled out of the shell's LICE blend so its flipped
|
||||
branch is pinned by a host-free test). An arc is just a flattened polyline, so ONE path serves the knob arcs, the inner dial, the envelope polyline and both spline traces. Coverage is `clamp(halfWidth + 0.5 - distance, 0, 1)`, which makes perpendicular weight exactly `2·halfWidth` at every angle. **The guaranteed-opaque-core threshold is width ≥ 2 px, not any width above 1 px**: opacity needs `distance <= halfWidth - 0.5`, and the worst-case distance from a pixel centre to the centreline is 0.5, so a 1 px stroke (`halfWidth = 0.5`) has zero slack — its peak alpha modulates with the stroke's exact alignment to the pixel grid instead of pinning to 255 (Daniel's ruling, 2026-08-01: every stroker-drawn width on the editor is now >= 2 px for this reason — `testSubOpaqueCoreAtOnePixelWidth` in `tests/test_stroke_aa.cpp` still pins the 1 px case as a property of the stroker, independent of whether any surface ships at that width). Long segments are subdivided before rasterizing — EXACT, not an approximation (min-distance to a partition of a segment is min-distance to the whole), purely to keep each piece's bounding box tight, since one long diagonal's box has area O(len²).
|
||||
|
||||
@@ -7,6 +7,16 @@
|
||||
|
||||
namespace reasampler::ui {
|
||||
|
||||
Rect cardNameStrip(const Rect& cell) {
|
||||
// Both strips plus a waveform band at least as tall as one strip; below that the card
|
||||
// is a text block, not a thumbnail.
|
||||
const int minHeight = 3 * kCardStripHeight;
|
||||
if (cell.width <= 2 * kCardStripPad || cell.height < minHeight) return Rect{};
|
||||
// Inset by 1px from the top edge so the name never sits on the selection border.
|
||||
return Rect{cell.x + kCardStripPad, cell.y + 1,
|
||||
cell.width - 2 * kCardStripPad, kCardStripHeight};
|
||||
}
|
||||
|
||||
std::string formatBarsBeats(const MusicalLength& m) {
|
||||
if (m.tempoBpm <= 0.0 || m.timeSigNum <= 0 || m.timeSigDenom <= 0) return {};
|
||||
|
||||
|
||||
@@ -5,8 +5,21 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "core/ui/rect.h"
|
||||
|
||||
namespace reasampler::ui {
|
||||
|
||||
// Both card overlay strips — the name line across the top, the length read-out along the
|
||||
// bottom — are this tall, with this much horizontal inset.
|
||||
inline constexpr int kCardStripHeight = 12;
|
||||
inline constexpr int kCardStripPad = 3;
|
||||
|
||||
// The strip the card's name line occupies: across the top of the cell, drawn OVER the
|
||||
// waveform exactly as the length read-out is drawn over it at the bottom. Empty when the
|
||||
// cell has no room for both strips plus a waveform worth looking at — the caller draws
|
||||
// nothing rather than burying the card under text.
|
||||
Rect cardNameStrip(const Rect& cell);
|
||||
|
||||
// Musical length inputs, taken straight off a Sample's capture-time stamp. tempoBpm 0 = unknown;
|
||||
// timeSigNum/Denom 0 = unstamped.
|
||||
struct MusicalLength {
|
||||
|
||||
Reference in New Issue
Block a user