feat(inserts): duplicate effect slots with independent state (phase 91)
This commit is contained in:
parent
e6cf7023fb
commit
062b33f55f
8 changed files with 69 additions and 5 deletions
11
src/project/chain_tools.c
Normal file
11
src/project/chain_tools.c
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#include "xtc/xtc_plugin.h"
|
||||
/* Metadata transforms never load modules; aliases are safe and errors atomic. */
|
||||
xtc_result xtc_track_chain_duplicate(const xtc_track_chain *chain,size_t index,xtc_track_chain *out)
|
||||
{
|
||||
xtc_track_chain copy;size_t i;
|
||||
if(!out || xtc_track_chain_validate(chain)!=XTC_OK || index>=chain->count)return XTC_ERR_INVALID_ARGUMENT;
|
||||
if(chain->count==XTC_TRACK_INSERTS)return XTC_ERR_CAPACITY;
|
||||
copy=*chain;
|
||||
for(i=copy.count;i>index+1;--i)copy.slots[i]=copy.slots[i-1];
|
||||
copy.slots[index+1]=copy.slots[index];++copy.count;*out=copy;return XTC_OK;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue