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.

cmDspPreset.h 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef cmDspPresetMgr_h
  2. #define cmDspPresetMgr_h
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. //( { file_desc:"'snap' unit state store/recall implementation." kw:[snap] }
  7. typedef struct _cmDspPreVar_str
  8. {
  9. unsigned symId;
  10. cmDspValue_t value;
  11. struct _cmDspPreVar_str* link;
  12. } _cmDspPresetVar_t;
  13. typedef struct _cmDspPresetInst_str
  14. {
  15. unsigned symId;
  16. struct _cmDspPresetInst_str* link;
  17. _cmDspPresetVar_t* list;
  18. } _cmDspPresetInst_t;
  19. typedef struct _cmDspPresetPre_str
  20. {
  21. unsigned symId;
  22. struct _cmDspPresetPre_str* link;
  23. _cmDspPresetInst_t* list;
  24. _cmDspPresetInst_t* ip;
  25. } _cmDspPresetPre_t;
  26. typedef struct _cmDspPresetGrp_str
  27. {
  28. unsigned symId;
  29. struct _cmDspPresetGrp_str* link;
  30. _cmDspPresetPre_t* list;
  31. _cmDspPresetPre_t* pp;
  32. } _cmDspPresetGrp_t;
  33. typedef struct
  34. {
  35. cmErr_t* err;
  36. cmLHeapH_t lhH;
  37. cmSymTblH_t stH;
  38. _cmDspPresetGrp_t* list;
  39. _cmDspPresetGrp_t* gp;
  40. const cmChar_t* dfltPathJsFn;
  41. const cmChar_t* dfltPathCsvFn;
  42. } cmDspPresetMgr_t;
  43. void _cmDspPresetAlloc( cmDspPresetMgr_t* p );
  44. cmDspRC_t _cmDspPresetLoad( cmDspPresetMgr_t* p, cmCtx_t* ctx, cmErr_t* err, cmLHeapH_t lhH, cmSymTblH_t stH, const cmChar_t* fnPrefixStr );
  45. cmDspRC_t _cmDspPresetUnload( cmDspPresetMgr_t* p, cmCtx_t* ctx );
  46. cmDspRC_t _cmDspPresetRead( cmDspPresetMgr_t* p, cmCtx_t* ctx, const cmChar_t* fn );
  47. cmDspRC_t _cmDspPresetWrite( cmDspPresetMgr_t* p, cmCtx_t* ctx, const cmChar_t* fn );
  48. cmDspRC_t _cmDspPresetWriteCsv( cmDspPresetMgr_t* p, cmCtx_t* ctx, const cmChar_t* fn );
  49. unsigned _cmDspPresetGroupCount( cmDspPresetMgr_t* p );
  50. unsigned _cmDspPresetGroupSymId( cmDspPresetMgr_t* p, unsigned groupIdx );
  51. const cmChar_t* _cmDspPresetGroupLabel( cmDspPresetMgr_t* p, unsigned groupIdx );
  52. cmDspRC_t _cmDspPresetGroupJsonList( cmDspPresetMgr_t* p, cmJsonH_t* jsHPtr );
  53. unsigned _cmDspPresetPresetCount( cmDspPresetMgr_t* p, unsigned groupIdx );
  54. unsigned _cmDspPresetPresetSymId( cmDspPresetMgr_t* p, unsigned groupIdx, unsigned presetIdx );
  55. const cmChar_t* _cmDspPresetPresetLabel( cmDspPresetMgr_t* p, unsigned groupIdx, unsigned presetIdx );
  56. cmDspRC_t _cmDspPresetPresetJsonList( cmDspPresetMgr_t* p, cmJsonH_t* jsHPtr, unsigned groupSymId );
  57. cmDspRC_t _cmDspPresetCreatePreset( cmDspPresetMgr_t* p, const cmChar_t* groupLabel, const cmChar_t* presetLabel );
  58. cmDspRC_t _cmDspPresetCreateInstance( cmDspPresetMgr_t* p, unsigned instSymId );
  59. cmDspRC_t _cmDspPresetCreateVar( cmDspPresetMgr_t* p, unsigned varSymId, const cmDspValue_t* valPtr );
  60. cmDspRC_t _cmDspPresetRecallPreset( cmDspPresetMgr_t* p, const cmChar_t* groupLabel, const cmChar_t* presetLabel );
  61. cmDspRC_t _cmDspPresetRecallInstance( cmDspPresetMgr_t* p, unsigned instSymId );
  62. cmDspRC_t _cmDspPresetRecallVar( cmDspPresetMgr_t* p, unsigned varSymId, cmDspValue_t* valPtr );
  63. //)
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif