#pragma once
// bake_land — the EXTENSION's half of the resample chain: take the file a ReaSampler 9000
// instance staged outside the bank, land it as a bank capture, and answer over the same
// per-instance key the request arrived on.
//
// Renders nothing (the instrument already did, through its own engine, in its own process
// — which is what makes the bake the sound the user approved). Writes a file into the bank
// folder and an index entry, and NOTHING else: no timeline item, and no deletion — the
// superseded audio survives until a prune reclaims it.

#include <string>

namespace reasampler {
class ReaSamplerSession;
}

namespace reasampler::capture {

// The bake action's body: scans EVERY open project tab for pending "rsbake_*" requests and
// lands the ones belonging to the project this session has loaded, one undo point for the
// batch. Normally there is exactly one — the instance that just invoked us. Runs
// synchronously inside that instance's Main_OnCommandEx call, so the answer is available to
// it the moment this returns. A request from another tab is refused, and one too old to
// have a reader left is cleared rather than answered.
void RunResampleBake(ReaSamplerSession& session);

}  // namespace reasampler::capture
