feat: render bounded effect tails and reset internal history on transport changes

This commit is contained in:
Johannes Findeisen 2026-11-05 23:55:56 +01:00
commit 836cdedc6b
22 changed files with 284 additions and 18 deletions

View file

@ -8,6 +8,16 @@ extern "C" {
#endif
typedef struct xtc_audio_plan xtc_audio_plan;
typedef struct xtc_export xtc_export;
/* Control thread only: bounded 256-frame incremental stereo float32 WAV export.
* tail_ms 0..60000, rate 8000..192000. Destination must be absolute and absent.
* No destination is published on error/cancel; destroy cancels/removes temporary.
* Snapshot preparation may execute trusted plugins. Missing media rejects export. */
xtc_result xtc_project_render_length(const xtc_project *project,unsigned int rate,unsigned int tail_ms,uint64_t *out_frames);
xtc_result xtc_export_create(const xtc_project *project,const char *path,unsigned int rate,unsigned int tail_ms,xtc_export **out);
xtc_result xtc_export_step(xtc_export *job,int *done);
xtc_result xtc_export_progress(const xtc_export *job,uint64_t *position,uint64_t *total);
void xtc_export_destroy(xtc_export *job);
typedef struct xtc_recorder xtc_recorder;
/* Control-thread metadata edits; audio/silent clips only. No source-file writes.

View file

@ -30,6 +30,7 @@ typedef struct {
typedef struct xtc_plan xtc_plan;
/* Single owner: set absolute automation/native-event position, no allocation. */
void xtc_plan_reset_history(xtc_plan *plan); /* Single owner; internal effects only. */
xtc_result xtc_plan_position(xtc_plan *plan, uint64_t position);
typedef enum {

View file

@ -69,6 +69,9 @@ xtc_result xtc_plugin_parameters(const xtc_plugin_spec *spec, double rate, xtc_p
/* Metadata-only validation: never opens libraries. */
xtc_result xtc_plugin_spec_validate(const xtc_plugin_spec *spec);
xtc_result xtc_plugin_create(const xtc_plugin_spec *spec, double rate, size_t frames, xtc_plugin **out);
/* Single audio owner or quiescent control owner. Internal state resets in bounded
* constant work; external-plugin history remains retained. No allocation/I/O. */
void xtc_plugin_reset_history(xtc_plugin *plugin);
size_t xtc_plugin_sample_frames(const xtc_plugin *plugin);
size_t xtc_plugin_asset_issues(const xtc_plugin *plugin);
void xtc_plugin_destroy(xtc_plugin *plugin); /* control, after quiescence */

View file

@ -9,6 +9,7 @@ extern "C" {
typedef struct xtc_realtime xtc_realtime;
/* Single audio owner, or stopped/joined control owner: position current/future plans. */
void xtc_realtime_reset_history(xtc_realtime *engine); /* Quiescent control only. */
xtc_result xtc_realtime_position(xtc_realtime *engine, uint64_t position);
typedef struct {

View file

@ -14,7 +14,7 @@ typedef struct {
int64_t sequencer_snap, piano_snap, sequencer_zoom;
int64_t clip_ticks, note_ticks, note_velocity, note_channel, filter_channel, filter_low, filter_high;
int64_t tempo, volume_cc, pan_cc, sustain_cc;
int64_t loop_start, loop_end, loop_enabled, follow_playhead;
int64_t loop_start, loop_end, loop_enabled, follow_playhead, tail_ms, stop_after_tail;
} xtc_settings;
typedef struct {
const char *section, *key, *label;