feat: edit arrangement selections atomically with grouped undo

This commit is contained in:
Johannes Findeisen 2026-11-06 00:13:48 +01:00
commit 7379545ced
10 changed files with 139 additions and 25 deletions

19
include/xtc/xtc_editing.h Normal file
View file

@ -0,0 +1,19 @@
#ifndef XTC_EDITING_H
#define XTC_EDITING_H
#include "xtc_midi.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Control thread only. Nonempty unique stable IDs, at most MAX_CLIPS.
* All operations clone/validate before publication: errors preserve the project,
* ID counters and optional count-element output. No media loading or DSP work.
* MOVE/DUPLICATE amount is a signed tick displacement, bounded by MAX_TICK.
* DUPLICATE retains tracks, source ranges, notes and media with fresh IDs.
* out_ids receives resulting IDs (removed IDs for DELETE). May be NULL. */
typedef enum { XTC_CLIPS_MOVE, XTC_CLIPS_DUPLICATE, XTC_CLIPS_DELETE } xtc_clip_operation;
xtc_result xtc_project_transform_clips(xtc_project *project,const uint64_t *ids,size_t count,
xtc_clip_operation operation,int64_t amount,uint64_t *out_ids);
#ifdef __cplusplus
}
#endif
#endif