refactor(ingest): ME-import adds RS9k to selected track, not a new track

No track is created; no routing changes. No selected track -> bank
import proceeds, instrument placement is refused with a console message
explaining why. createTrackWithInstrument removed (was sole caller).
This commit is contained in:
2026-07-27 14:18:10 -04:00
parent 8576832c84
commit 3a95ce61fe
3 changed files with 58 additions and 89 deletions
+1 -13
View File
@@ -57,21 +57,9 @@ 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
// the undo grouping so the whole gesture (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