S17 drop-and-load onto track FX button; S13 editor drop-accept (relay degraded)

S17: drag_out InstrumentDrop gesture + instrument_drop blob reusing the
instrument's own serializer; bank_panel FX hover-track + add-VST/vst_chunk
inject. S13 relay deferred (read-only bridge) — editor shows drop affordance.
This commit is contained in:
2026-07-27 03:52:26 -04:00
parent 06494c654e
commit 26e2bf2fc6
13 changed files with 779 additions and 54 deletions
+54
View File
@@ -84,6 +84,54 @@ static void testOffsetPanelRect() {
CHECK(decideGesture(100, 19, p, s) == DragGesture::OsDrag); // just above origin
}
// --- S17 InstrumentDrop gesture (single-capture over REAPER UI) ---------------
//
// M11 REGRESSION GUARD (load-bearing): every M11 case above uses DragState{true, true},
// which leaves singleCapture=overReaperUi=false — so an M11-era payload outside the client
// rect still decides OsDrag exactly as before. The tests above ARE the M11 non-regression
// proof; these add the new middle case.
// A SINGLE-capture drag that has left the panel but is still over REAPER's own UI is an
// instrument drop (heading for a track's FX button), NOT an OS drag.
static void testSingleCaptureOverReaperUiIsInstrumentDrop() {
DragState s{/*dragging=*/true, /*hasArmedSamples=*/true,
/*singleCapture=*/true, /*overReaperUi=*/true};
CHECK(decideGesture(500, 150, kPanel, s) == DragGesture::InstrumentDrop); // right of panel
CHECK(decideGesture(-5, 150, kPanel, s) == DragGesture::InstrumentDrop); // left of panel
CHECK(decideGesture(200, 400, kPanel, s) == DragGesture::InstrumentDrop); // below
}
// InstrumentDrop is an OUTSIDE-only refinement: the same single-capture state INSIDE the
// client rect is still the unchanged Internal bank-to-bank drag (invariant #4).
static void testSingleCaptureInsidePanelStaysInternal() {
DragState s{true, true, /*singleCapture=*/true, /*overReaperUi=*/true};
CHECK(decideGesture(200, 150, kPanel, s) == DragGesture::Internal);
}
// A single-capture drag that has left REAPER ENTIRELY (overReaperUi=false) falls through to
// OsDrag — the M11 OS drag-out to Explorer/another DAW, unchanged. This is the boundary
// refinement's other half: leaving the client rect no longer immediately means OS-bound.
static void testSingleCaptureOffReaperIsOsDrag() {
DragState s{true, true, /*singleCapture=*/true, /*overReaperUi=*/false};
CHECK(decideGesture(500, 150, kPanel, s) == DragGesture::OsDrag);
}
// A MULTI-capture drag over REAPER's UI is REJECTED for InstrumentDrop (the S17 open-question
// lean): it is NOT a single instrument placement, so it falls through to OsDrag even while
// over REAPER's UI — the multi-file drag-out is the natural gesture for a multi payload.
static void testMultiCaptureOverReaperUiIsOsDrag() {
DragState s{true, true, /*singleCapture=*/false, /*overReaperUi=*/true};
CHECK(decideGesture(500, 150, kPanel, s) == DragGesture::OsDrag);
}
// Not-dragging / no-armed-samples still short-circuits to None regardless of the S17 fields.
static void testS17FieldsIgnoredWhenNotDragging() {
CHECK(decideGesture(500, 150, kPanel,
DragState{false, true, true, true}) == DragGesture::None);
CHECK(decideGesture(500, 150, kPanel,
DragState{true, false, true, true}) == DragGesture::None);
}
// --- Path-list assembly -------------------------------------------------------
static ResolvedSample ok(const std::string& p) { return ResolvedSample{p, true}; }
@@ -180,6 +228,12 @@ int main() {
testReentryReturnsInternal();
testOffsetPanelRect();
testSingleCaptureOverReaperUiIsInstrumentDrop();
testSingleCaptureInsidePanelStaysInternal();
testSingleCaptureOffReaperIsOsDrag();
testMultiCaptureOverReaperUiIsOsDrag();
testS17FieldsIgnoredWhenNotDragging();
testSinglePath();
testMultiPreservesOrder();
testDedupeSamePath();