feat: navigate arrangement markers and loop named sections

This commit is contained in:
Johannes Findeisen 2026-11-06 00:31:08 +01:00
commit bd39eb1345
8 changed files with 71 additions and 5 deletions

View file

@ -31,4 +31,19 @@ static void markers(void)
assert(xtc_project_load(q,path)==XTC_ERR_FORMAT);assert(xtc_project_marker_count(q,&count)==XTC_OK && count==1);}
xtc_project_destroy(p);xtc_project_destroy(q);assert(unlink(path)==0);
}
int main(void){markers();puts("Next DAW workflow tests passed.");return 0;}
static void sections(void)
{
xtc_project *p=NULL;uint64_t t,c,begin=999,end=999;xtc_marker m={0};
assert(xtc_project_create(&p)==XTC_OK && xtc_project_add_track(p,"Track",&t)==XTC_OK);
assert(xtc_project_add_clip(p,t,"Song",0,7680,&c)==XTC_OK);
assert(xtc_project_set_marker(p,960,"A")==XTC_OK && xtc_project_set_marker(p,3840,"B")==XTC_OK);
assert(xtc_project_section(p,0,&begin,&end)==XTC_ERR_NOT_FOUND && begin==999);
assert(xtc_project_section(p,960,&begin,&end)==XTC_OK && begin==960 && end==3840);
assert(xtc_project_section(p,5000,&begin,&end)==XTC_OK && begin==3840 && end==7680);
assert(xtc_project_adjacent_marker(p,960,1,&m)==XTC_OK && m.tick==3840);
assert(xtc_project_adjacent_marker(p,3840,-1,&m)==XTC_OK && m.tick==960);
assert(xtc_project_adjacent_marker(p,960,-1,&m)==XTC_ERR_NOT_FOUND && m.tick==960);
assert(xtc_project_set_marker(p,9000,"Empty")==XTC_OK && xtc_project_section(p,9000,&begin,&end)==XTC_ERR_INVALID_STATE);
xtc_project_destroy(p);
}
int main(void){markers();sections();puts("Next DAW workflow tests passed.");return 0;}