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:
2026-08-01 21:46:53 -04:00
parent 09d64c9f46
commit 3278b4eced
23 changed files with 626 additions and 25 deletions
+44
View File
@@ -109,7 +109,51 @@ static void testSecondsMsNearWholeSecondCarry() {
CHECK(r == "0.999" || r == "1.000");
}
// --- the card's name strip ----------------------------------------------------
// The shipping cell size (panel_state.h's kGrid).
static const Rect kCell{40, 100, 140, 84};
static void testNameStripSitsAcrossTheTopOfTheCell() {
const Rect s = cardNameStrip(kCell);
CHECK(s.x == kCell.x + kCardStripPad);
CHECK(s.y == kCell.y + 1); // clear of the selection border
CHECK(s.width == kCell.width - 2 * kCardStripPad);
CHECK(s.height == kCardStripHeight);
}
static void testNameStripNeverOverlapsTheLengthReadOut() {
// The read-out occupies the bottom kCardStripHeight of the same cell.
const Rect s = cardNameStrip(kCell);
CHECK(s.bottom() <= kCell.bottom() - kCardStripHeight);
}
static void testNameStripStaysInsideTheCell() {
const Rect s = cardNameStrip(kCell);
CHECK(s.x >= kCell.x);
CHECK(s.right() <= kCell.right());
CHECK(s.y >= kCell.y);
CHECK(s.bottom() <= kCell.bottom());
}
static void testNameStripSuppressedOnATooShortCell() {
// Below three strip-heights the card would be text with a sliver of waveform — draw
// no name rather than bury the thumbnail.
CHECK(cardNameStrip(Rect{0, 0, 140, 3 * kCardStripHeight - 1}).empty());
CHECK(!cardNameStrip(Rect{0, 0, 140, 3 * kCardStripHeight}).empty());
}
static void testNameStripSuppressedOnATooNarrowCell() {
CHECK(cardNameStrip(Rect{0, 0, 2 * kCardStripPad, 84}).empty());
CHECK(cardNameStrip(Rect{0, 0, 0, 84}).empty());
}
int main() {
testNameStripSitsAcrossTheTopOfTheCell();
testNameStripNeverOverlapsTheLengthReadOut();
testNameStripStaysInsideTheCell();
testNameStripSuppressedOnATooShortCell();
testNameStripSuppressedOnATooNarrowCell();
testZeroLengthIsBarOneOrigin();
testSubBeat();
testWholeBeatWithinBar();