Merge dev into phase-b-multibank (m11 console cleanup + Phase S/V docs) before dev promotion
# Conflicts: # src/actions.cpp # src/main.cpp
This commit is contained in:
+7
-37
@@ -135,7 +135,7 @@ static ReaProject* g_rtCaptureProject = nullptr;
|
||||
|
||||
// Commit a finished realtime capture (a Done tick/abort with an Ok result): add the
|
||||
// Sample to the ACTIVE bank (g_session.bank() resolves to book.activeIndex() — B2),
|
||||
// persist + MarkProjectDirty, log. Shared by the tick-completion path and the abort
|
||||
// persist + MarkProjectDirty. Shared by the tick-completion path and the abort
|
||||
// paths. On a non-Ok result, logs the failure only.
|
||||
static void CommitRealtimeResult(const reasampler::CaptureResult& res)
|
||||
{
|
||||
@@ -144,20 +144,13 @@ static void CommitRealtimeResult(const reasampler::CaptureResult& res)
|
||||
ShowConsoleMsg(("ReaSampler realtime capture failed: " + res.message + "\n").c_str());
|
||||
return;
|
||||
}
|
||||
reasampler::AddResult added = g_session.bank().add(res.sample);
|
||||
g_session.bank().add(res.sample);
|
||||
// B-cap: record the file the capture created in the owned-file manifest, at the same
|
||||
// point the Sample is added and before the same persist. Recorded regardless of the
|
||||
// index AddResult — even a hash-collapse still WROTE a file the tool owns, and the
|
||||
// manifest dedups a repeat path itself (Phase R prune reconciles manifest vs index).
|
||||
g_session.owned().add(res.sample.relativePath);
|
||||
g_session.saveToActiveProject(); // persist book + manifest + MarkProjectDirty (travels with .rpp)
|
||||
|
||||
std::string log = "ReaSampler: " + res.message + "\n";
|
||||
log += " bank size now " + std::to_string(g_session.bank().size()) +
|
||||
(added == reasampler::AddResult::Added ? " (added)\n"
|
||||
: added == reasampler::AddResult::Collapsed ? " (collapsed on hash)\n"
|
||||
: " (rejected)\n");
|
||||
ShowConsoleMsg(log.c_str());
|
||||
}
|
||||
|
||||
// Advance any in-flight realtime capture one tick. Cheap when none is running (a
|
||||
@@ -619,7 +612,7 @@ static void RunCapture(const reasampler::CaptureActionDef& def)
|
||||
}
|
||||
|
||||
// Add to the ACTIVE bank: g_session.bank() resolves to book.activeIndex() (B2).
|
||||
reasampler::AddResult added = g_session.bank().add(res.sample);
|
||||
g_session.bank().add(res.sample);
|
||||
// B-cap: record the created file in the owned-file manifest, at the same point the
|
||||
// Sample is added and before the same persist. Recorded regardless of the index
|
||||
// AddResult — even a hash-collapse still WROTE a file the tool owns, and the manifest
|
||||
@@ -630,13 +623,6 @@ static void RunCapture(const reasampler::CaptureActionDef& def)
|
||||
// travels with the .rpp. saveToActiveProject also clears the retired legacy key and
|
||||
// calls MarkProjectDirty. Non-destructive: writes only our own ext-state keys.
|
||||
g_session.saveToActiveProject();
|
||||
|
||||
std::string log = "ReaSampler: " + res.message + "\n";
|
||||
log += " bank size now " + std::to_string(g_session.bank().size()) +
|
||||
(added == reasampler::AddResult::Added ? " (added)\n"
|
||||
: added == reasampler::AddResult::Collapsed ? " (collapsed on hash)\n"
|
||||
: " (rejected)\n");
|
||||
ShowConsoleMsg(log.c_str());
|
||||
}
|
||||
|
||||
// STARTS the REALTIME track capture and returns immediately — the record runs across
|
||||
@@ -708,15 +694,6 @@ static void RunCaptureRealtimeTrack()
|
||||
// completion across ticks (UI stays responsive).
|
||||
g_rtCaptureProject = EnumProjects(-1, nullptr, 0);
|
||||
g_rtCapture = std::move(st);
|
||||
// With a tail mode the recorded window runs PAST the range end (Auto: +8 s then
|
||||
// decay-trim; Manual: +the set length), so the completion note names the window,
|
||||
// not just the range end.
|
||||
const char* doneWhen =
|
||||
(tail.mode == reasampler::TailMode::None)
|
||||
? "the bank updates when it reaches the range end."
|
||||
: "the bank updates after the extra tail window (past the range end).";
|
||||
ShowConsoleMsg((std::string("ReaSampler: realtime capture started — recording in "
|
||||
"the background; ") + doneWhen + "\n").c_str());
|
||||
}
|
||||
|
||||
// Cancels the in-flight realtime capture on demand (bindable action). Force-terminates
|
||||
@@ -758,27 +735,22 @@ static void RunInsertSelected(bool conform)
|
||||
|
||||
reasampler::InsertResult res = reasampler::runInsert(&g_session, req);
|
||||
|
||||
std::string msg;
|
||||
switch (res.status)
|
||||
{
|
||||
case reasampler::InsertStatus::Ok:
|
||||
msg = "ReaSampler: inserted onto " + std::to_string(res.inserted) +
|
||||
(res.inserted == 1 ? " track" : " tracks") +
|
||||
(conform ? " (conformed to tempo)" : " (native length)") + "\n";
|
||||
break;
|
||||
break; // success — no console chatter
|
||||
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";
|
||||
ShowConsoleMsg("ReaSampler insert: nothing selected in the bank panel.\n");
|
||||
break;
|
||||
case reasampler::InsertStatus::NoProject:
|
||||
msg = "ReaSampler insert: no saved project, so the bank has no location.\n";
|
||||
ShowConsoleMsg("ReaSampler insert: no saved project, so the bank has no location.\n");
|
||||
break;
|
||||
case reasampler::InsertStatus::NothingResolved:
|
||||
msg = "ReaSampler insert: selected sample(s) could not be resolved to a file.\n";
|
||||
ShowConsoleMsg("ReaSampler insert: selected sample(s) could not be resolved to a file.\n");
|
||||
break;
|
||||
}
|
||||
ShowConsoleMsg(msg.c_str());
|
||||
}
|
||||
|
||||
// REAPER calls this for EVERY action fired anywhere; claim only our own id,
|
||||
@@ -1024,7 +996,5 @@ extern "C" REAPER_PLUGIN_DLL_EXPORT int REAPER_PLUGIN_ENTRYPOINT(
|
||||
// requests a deferred reload that the next timer tick drains (see the hook comment).
|
||||
rec->Register("projectconfig", (void*)&g_projectConfig);
|
||||
|
||||
ShowConsoleMsg("ReaSampler loaded.\n");
|
||||
|
||||
return 1; // success — REAPER keeps us loaded
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user