libcm is a C development framework with an emphasis on audio signal processing applications.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cmTakeSeqBldr.h 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef cmTakeSeqBldr_h
  2. #define cmTakeSeqBldr_h
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. enum
  7. {
  8. kOkTsbRC = cmOkRC,
  9. kJsonFailTsbRC,
  10. kParseFailTsbRC
  11. };
  12. typedef cmRC_t cmTsbRC_t;
  13. typedef cmHandle_t cmTakeSeqBldrH_t;
  14. extern cmTakeSeqBldrH_t cmTakeSeqBldrNullHandle;
  15. cmTsbRC_t cmTakeSeqBldrAlloc( cmCtx_t* ctx, cmTakeSeqBldrH_t* hp );
  16. cmTsbRC_t cmTakeSeqBldrAllocFn( cmCtx_t* ctx, cmTakeSeqBldrH_t* hp, const cmChar_t* tsbFn );
  17. cmTsbRC_t cmTakeSeqBldrFree( cmTakeSeqBldrH_t* hp );
  18. bool cmTakeSeqBldrIsValid( cmTakeSeqBldrH_t h );
  19. cmTsbRC_t cmTakeSeqBldrInitialize( cmTakeSeqBldrH_t h, const cmChar_t* tsbFn );
  20. // Load a group of notes delinated by a time-line marker into the sequence.
  21. // If notes overlap with existing notes according to their 'scEvtIdx' attribute:
  22. // a. If 'overWriteFl' is set then the incoming overlapped notes are enabled
  23. // and the existing overlapped notes are disabled, otherwise the incoming
  24. // overlapped notes are disabled and the existing notes remain enabled.
  25. // b. The incoming section is time aligned with the first or last existing
  26. // note depending on whether the new section aligns best with the beginning
  27. // or ending of the existing notes.
  28. //
  29. // If no overlapping notes exist then the incoming section is aligned by estimating
  30. // the alignment with existing notes using the score alone.
  31. cmTsbRC_t cmTakeSeqBldrLoadSection( cmTakeSeqBldrH_t h, unsigned tlMarkUid, bool overwriteFL );
  32. cmTsbRC_t cmTakeSeqBldrUnloadSection( cmTakeSeqBldrH_t h, unsigned tlMarkUid );
  33. // Fill in missing notes from the score.
  34. cmTsbRC_t cmTakeSeqBldrInsertScoreNotes( cmTakeSeqBldrH_t h, unsigned begScEvtIdx, unsigned endScEvtId );
  35. cmTsbRC_t cmTakeSeqBldrRemoveScoreNotes( cmTakeSeqBldrH_t h, unsigned begScEvtIdx, unsigned endScEvtId );
  36. enum { kMarkTsbFl = 0x01, kTlNoteTsbFl=0x02, kScoreNoteTsbFl = 0x04, kPedalTsbFl = 0x08 };
  37. cmTsbRC_t cmTakeSeqBldrSelectEnable( cmTakeSeqBldrH_t h, unsigned flags, unsigned id, bool selectFl );
  38. cmTsbRC_t cmTakeSeqBldrEnableNote( cmTakeSeqBldrH_t h, unsigned ssqId, bool enableFl );
  39. cmTsbRC_t cmTakeSeqBldrMoveNote( cmTakeSeqBldrH_t h, unsigned ssqId, int deltaSmpIdx );
  40. cmTsbRC_t cmTakeSeqBldrWriteMidiFile( cmTakeSeqBldrH_t h, const char* fn );
  41. cmTsbRC_t cmTakeSeqBldrTest( cmCtx_t* ctx );
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif