feat: plan composition phases and persist named arrangement markers
This commit is contained in:
parent
1b668068de
commit
64e5ab170f
19 changed files with 323 additions and 9 deletions
|
|
@ -495,6 +495,13 @@ static xtc_result read_project(reader *input, xtc_project *project, const char *
|
|||
}
|
||||
READ("LIVE_INSTRUMENT",2U); NUM(1U,project->live_instrument);
|
||||
}
|
||||
if(format_version>=16U) {
|
||||
READ("MARKERS",2U);NUM(1U,value);if(value>XTC_PROJECT_MAX_MARKERS)return XTC_ERR_FORMAT;
|
||||
project->marker_count=(size_t)value;
|
||||
for(i=0;i<project->marker_count;++i){READ("MARKER",3U);NUM(1U,project->markers[i].tick);
|
||||
if(!decode_name(input->tokens[2],project->markers[i].name))return XTC_ERR_FORMAT;
|
||||
}
|
||||
}
|
||||
READ("END", 1U);
|
||||
if (fgetc(input->file) != EOF)
|
||||
return XTC_ERR_FORMAT;
|
||||
|
|
@ -672,6 +679,8 @@ static xtc_result write_project(FILE *file, const xtc_project *project, const ch
|
|||
}
|
||||
if (fprintf(file,"LIVE_INSTRUMENT %" PRIu64 "\n",project->live_instrument) < 0) return XTC_ERR_IO;
|
||||
}
|
||||
if(fprintf(file,"MARKERS %zu\n",project->marker_count)<0)return XTC_ERR_IO;
|
||||
for(i=0;i<project->marker_count;++i)if(fprintf(file,"MARKER %" PRIu64 " ",project->markers[i].tick)<0 || !write_name(file,project->markers[i].name))return XTC_ERR_IO;
|
||||
return fputs("END\n", file) == EOF ? XTC_ERR_IO : XTC_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue