feat: reverse selected sample frames with immutable snapshots and local undo

This commit is contained in:
Johannes Findeisen 2026-11-06 01:04:06 +01:00
commit 9ae2e2a11c
8 changed files with 49 additions and 5 deletions

View file

@ -15,6 +15,11 @@ void xtc_sample_destroy(xtc_sample *sample);
xtc_result xtc_sample_info(const xtc_sample *sample,unsigned int *rate,size_t *frames);
xtc_result xtc_sample_read(const xtc_sample *sample,size_t frame,float *out);
xtc_result xtc_sample_analyze(const xtc_sample *sample,size_t begin,size_t end,xtc_sample_stats *out);
typedef enum { XTC_SAMPLE_REVERSE } xtc_sample_operation;
/* Independent full-source result; only [begin,end) changes. Never mutates input.
* amount is reserved/ignored for reversal. Failure preserves *out. */
xtc_result xtc_sample_process(const xtc_sample *sample,size_t begin,size_t end,
xtc_sample_operation operation,double amount,xtc_sample **out);
/* Control-thread bounded mono float32 WAV save. Absolute path <512 bytes,
* NEW destination only. Failure/cancel publishes nothing and removes temporary. */
xtc_result xtc_sample_write(const xtc_sample *sample,size_t begin,size_t end,const char *path);