Merge ME-import → new RS9k instrument

Repurpose INGEST_IMPORT_MEDIA_EXPLORER to stand up a fresh instrument on
a new track pre-loaded with the imported sound, instead of force-selecting
on the active instance.
This commit is contained in:
2026-07-27 13:39:24 -04:00
3 changed files with 149 additions and 51 deletions
+20
View File
@@ -54,4 +54,24 @@ FxDropTarget resolveFxDropTarget(int screenX, int screenY);
// undoable.
bool performInstrumentDrop(MediaTrack* track, const std::string& chunkBase64);
// Add a fresh ReaSampler 9000 instance to `track` and inject `chunkBase64` as its component
// state. Same all-or-nothing add+inject contract as performInstrumentDrop (rolls the FX back
// via TrackFX_Delete on inject failure), but does NOT open its own undo block — the caller owns
// the undo grouping so the whole gesture (track-create + persist + FX-add + inject) collapses to
// one Ctrl-Z. This is the shared inner half performInstrumentDrop wraps in its own block.
// Returns true on success, false on any failure. NEVER inserts a timeline item.
bool loadInstrumentOntoTrack(MediaTrack* track, const std::string& chunkBase64);
// Create a NEW track at the end of the active project's track list, name it `trackName`, add a
// fresh ReaSampler 9000 instance pre-loaded with `chunkBase64` (RS5k-parity "load into a new
// sampler"), and return the created track. Does NOT open an undo block — the caller owns the
// undo grouping (track-create + the caller's bank persist collapse to one Ctrl-Z). All-or-
// nothing on the instrument side: if the FX add or chunk inject fails, the freshly-created
// track is deleted before returning nullptr, leaving the project exactly as it was (no orphaned
// empty track). NEVER inserts a timeline item; the ONLY mutations are one track + one FX
// instance + that instance's state, all REAPER-undoable. Returns the new track on success,
// nullptr on any failure.
MediaTrack* createTrackWithInstrument(const std::string& trackName,
const std::string& chunkBase64);
} // namespace reasampler