libcm is a C development framework with an emphasis on audio signal processing applications.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

cmDspPreset.h 3.2KB

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