xtc/include/xtc/xtc_editing.h

30 lines
1.7 KiB
C

#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);
/* Independent clipboard snapshot; captures notes/trim/media references, no media
* bytes or instrument assignments. Paste maps source track spacing to existing
* destination tracks beginning at destination_track; rejects missing/bus tracks.
* start is the new earliest clip position. No OS clipboard integration.
* out_ids, if non-NULL, has clipboard_count elements; unchanged on failure. */
typedef struct xtc_clipboard xtc_clipboard;
xtc_result xtc_clipboard_create(const xtc_project *project,const uint64_t *ids,size_t count,xtc_clipboard **out);
void xtc_clipboard_destroy(xtc_clipboard *clipboard);
size_t xtc_clipboard_count(const xtc_clipboard *clipboard);
xtc_result xtc_clipboard_paste(const xtc_clipboard *clipboard,xtc_project *project,
uint64_t destination_track,uint64_t start,uint64_t *out_ids);
#ifdef __cplusplus
}
#endif
#endif