feat: invert selected audio sample polarity without changing surrounding frames

This commit is contained in:
Johannes Findeisen 2026-11-06 01:04:45 +01:00
commit f528a169f8
7 changed files with 18 additions and 7 deletions

View file

@ -35,5 +35,10 @@ int main(void)
assert(xtc_sample_process(q,1,7,XTC_SAMPLE_REVERSE,0,&twice)==XTC_OK);
for(size_t j=0;j<8;++j){assert(xtc_sample_read(twice,j,&v)==XTC_OK && v==values[j]);}
xtc_sample_destroy(q);xtc_sample_destroy(twice);}
{xtc_sample *q=NULL,*twice=NULL;assert(xtc_sample_process(s,1,7,XTC_SAMPLE_INVERT,0,&q)==XTC_OK);
for(size_t j=0;j<8;++j){assert(xtc_sample_read(q,j,&v)==XTC_OK && v==(j>=1&&j<7 ? -values[j] : values[j]));}
assert(xtc_sample_process(q,1,7,XTC_SAMPLE_INVERT,0,&twice)==XTC_OK);
for(size_t j=0;j<8;++j){assert(xtc_sample_read(twice,j,&v)==XTC_OK && v==values[j]);}
xtc_sample_destroy(q);xtc_sample_destroy(twice);}
xtc_sample_destroy(s);assert(unlink(path)==0 && rmdir(root)==0);puts("Sample editor core tests passed.");return 0;
}