feat: apply reversible linear and equal-power fades to sample selections

This commit is contained in:
Johannes Findeisen 2026-11-06 01:06:24 +01:00
commit 15714fa764
7 changed files with 23 additions and 7 deletions

View file

@ -15,7 +15,7 @@ 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_INVERT, XTC_SAMPLE_REMOVE_DC } xtc_sample_operation;
typedef enum { XTC_SAMPLE_REVERSE, XTC_SAMPLE_INVERT, XTC_SAMPLE_REMOVE_DC, XTC_SAMPLE_FADE_IN, XTC_SAMPLE_FADE_OUT, XTC_SAMPLE_FADE_IN_POWER, XTC_SAMPLE_FADE_OUT_POWER } 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,