fix: insert onto selected track(s) at edit cursor, not a new track
Wire both insert actions to CurrentTrack (InsertMedia base 0). Per selected track: SetOnlyTrackSelected, reset cursor to snapshot, InsertMedia; then restore original selection + cursor. No-op when no track selected. Corrected stale extraflags / new-track / preservePitch comments.
This commit is contained in:
+7
-7
@@ -142,7 +142,8 @@ static void RunCaptureMasterSpike()
|
||||
static void RunInsertSelected(bool conform)
|
||||
{
|
||||
reasampler::InsertRequest req;
|
||||
req.options.target = reasampler::InsertTarget::NewTrack; // sensible default: own track
|
||||
// target defaults to CurrentTrack (InsertOptions::target) — inserts onto the
|
||||
// user's currently-selected track(s) at the edit cursor.
|
||||
req.options.conform =
|
||||
conform ? reasampler::TempoConform::Ratio1x : reasampler::TempoConform::None;
|
||||
// preservePitch stays true: a tempo conform matches tempo without varispeeding
|
||||
@@ -154,14 +155,13 @@ static void RunInsertSelected(bool conform)
|
||||
switch (res.status)
|
||||
{
|
||||
case reasampler::InsertStatus::Ok:
|
||||
msg = "ReaSampler: inserted " + std::to_string(res.inserted) +
|
||||
(res.inserted == 1 ? " sample" : " samples") +
|
||||
(conform ? " (conformed to tempo)" : " (native length)");
|
||||
if (res.skipped > 0)
|
||||
msg += ", skipped " + std::to_string(res.skipped) + " unresolvable";
|
||||
msg += "\n";
|
||||
msg = "ReaSampler: inserted onto " + std::to_string(res.inserted) +
|
||||
(res.inserted == 1 ? " track" : " tracks") +
|
||||
(conform ? " (conformed to tempo)" : " (native length)") + "\n";
|
||||
break;
|
||||
case reasampler::InsertStatus::NoSelection:
|
||||
// "select a track first" is printed by runInsert when no track is
|
||||
// selected; this branch covers the no-panel-selection case.
|
||||
msg = "ReaSampler insert: nothing selected in the bank panel.\n";
|
||||
break;
|
||||
case reasampler::InsertStatus::NoProject:
|
||||
|
||||
Reference in New Issue
Block a user