Publish the Media Explorer import into REAPER's Media Explorer action section as well as Main — custom_action + hookcommand2, second forever-stable id, one handler.

This commit is contained in:
2026-08-01 19:43:27 -04:00
parent 8bf6841f7b
commit 72b870459c
6 changed files with 118 additions and 15 deletions
+42
View File
@@ -7,6 +7,10 @@
#include "../src/core/version/app_version.h"
// REAPER-free header; pulled in for the ingest action's FOREVER-STABLE id suffixes, so
// the composition assertions below check the strings that actually ship.
#include "../src/shell/actions/ingest.h"
#include <cstdio>
#include <string>
@@ -151,6 +155,43 @@ static void testChannelQualifiedIdAndNameComposition() {
}
}
static void testMediaExplorerImportIdsAreDistinctAndChannelIsolated() {
// The Media-Explorer import publishes into TWO action sections, and a custom_action
// idStr must be unique across all sections — so the two entries carry two suffixes.
// Both are FOREVER-STABLE per channel. Composed from the SHIPPED constants and checked
// against spelled-out literals, so a suffix edit in ingest.cpp fails here.
const std::string mainId = channelCommandId(kIngestImportMediaExplorerId);
const std::string mxId = channelCommandId(kIngestImportMediaExplorerMxId);
if (isBeta()) {
CHECK(mainId == "CEREBELLUM_REASAMPLER_BETA_INGEST_IMPORT_MEDIA_EXPLORER");
CHECK(mxId == "CEREBELLUM_REASAMPLER_BETA_INGEST_IMPORT_MEDIA_EXPLORER_MX");
CHECK(channelActionName("import Media Explorer file into selected track") ==
"ReaSampler beta: import Media Explorer file into selected track");
} else {
CHECK(mainId == "CEREBELLUM_REASAMPLER_INGEST_IMPORT_MEDIA_EXPLORER");
CHECK(mxId == "CEREBELLUM_REASAMPLER_INGEST_IMPORT_MEDIA_EXPLORER_MX");
CHECK(channelActionName("import Media Explorer file into selected track") ==
"ReaSampler: import Media Explorer file into selected track");
}
// Distinctness is what keeps the two dispatch hooks from both claiming one command:
// hookcommand owns the Main id, hookcommand2 owns the Media Explorer id. A suffix
// collapse would silently double-fire the import.
CHECK(mainId != mxId);
// Cross-channel isolation: this build's ids must NOT collide with the other channel's,
// or a beta install would rebind the stable keymap's entries. Asserted against the
// opposite channel's literals, which is the collision that would actually occur.
if (isBeta()) {
CHECK(mainId != "CEREBELLUM_REASAMPLER_INGEST_IMPORT_MEDIA_EXPLORER");
CHECK(mxId != "CEREBELLUM_REASAMPLER_INGEST_IMPORT_MEDIA_EXPLORER_MX");
} else {
CHECK(mainId != "CEREBELLUM_REASAMPLER_BETA_INGEST_IMPORT_MEDIA_EXPLORER");
CHECK(mxId != "CEREBELLUM_REASAMPLER_BETA_INGEST_IMPORT_MEDIA_EXPLORER_MX");
}
}
static void testStampClassifiesAsStampedOnOwnChannel() {
// The V4 stamp-classifiability requirement: the value a channel WRITES (stampVersion())
// must classify as Stamped when that same channel reads it back — on BOTH channels. A
@@ -277,6 +318,7 @@ int main() {
testVstIdentityStringsForkByChannel();
testVstIdentityAndDataNamespaceShareOneChannel();
testChannelQualifiedIdAndNameComposition();
testMediaExplorerImportIdsAreDistinctAndChannelIsolated();
testStampClassifiesAsStampedOnOwnChannel();
testParseWellFormed();
testParseRejectsMalformed();