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.

cmDspSys.h 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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 cmDspSys_h
  4. #define cmDspSys_h
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. //( { file_desc:"Host application interface to the 'snap' data flow system." kw:[snap] }
  9. extern cmDspSysH_t cmDspNullHandle;
  10. // Print labels of the form 'label'-xxx. Where xxx is an integer.
  11. // The total length of the label must be <=127 or it will be truncated.
  12. // The returned string is kept in static memory and therefore will be
  13. // rewritten by the next call to this function. This makes the function
  14. // inherently useless if called by multiple threads.
  15. const cmChar_t* cmDspSysPrintLabel( const cmChar_t* label, unsigned i );
  16. const cmChar_t* cmDspSysPrintLabel2( const cmChar_t* label, unsigned i );
  17. //----------------------------------------------------------------------------------------------------
  18. // Control Functions
  19. //
  20. cmDspRC_t cmDspSysInitialize( cmCtx_t* ctx, cmDspSysH_t* hp, cmUdpNetH_t netH, cmSeH_t serialPortH );
  21. cmDspRC_t cmDspSysFinalize( cmDspSysH_t* hp );
  22. bool cmDspSysIsValid( cmDspSysH_t h );
  23. cmDspRC_t cmDspSysLastRC( cmDspSysH_t h );
  24. unsigned cmDspSysPgmCount( cmDspSysH_t h );
  25. const cmChar_t* cmDspPgmLabel( cmDspSysH_t h, unsigned pgmIdx );
  26. // Load a DSP program.
  27. cmDspRC_t cmDspSysLoad( cmDspSysH_t h, cmAudioSysCtx_t* asCtx, unsigned pgmIdx );
  28. // Unload the previously loaded DSP program
  29. cmDspRC_t cmDspSysUnload( cmDspSysH_t h );
  30. // Call 'reset' on each of the DSP processer instances in the current program.
  31. cmDspRC_t cmDspSysReset( cmDspSysH_t h );
  32. // Called by the audioSystem to send messages to the DSP system during runtime.
  33. cmDspRC_t cmDspSysRcvMsg( cmDspSysH_t h, cmAudioSysCtx_t* asCtx, const void* msgPtr, unsigned msgByteCnt, unsigned srcNetNodeId );
  34. enum { kSyncPreDspId, kSyncPendingDspId, kSyncSuccessDspId, kSyncFailDspId };
  35. unsigned cmDspSysSyncState( cmDspSysH_t h );
  36. // Print the loaded program (instances and connections) to a JSON file.
  37. cmDspRC_t cmDspSysPrintPgm( cmDspSysH_t h, const cmChar_t* outFn );
  38. //----------------------------------------------------------------------------------------------------
  39. // Preset function:
  40. //
  41. // A 'preset group' identifies a collection of 'preset's. The group id allows
  42. // a particular preset instance to be restored to the same place from which it was formed.
  43. unsigned cmDspSysPresetGroupCount( cmDspSysH_t h );
  44. unsigned cmDspSysPresetGroupSymId( cmDspSysH_t h, unsigned groupIdx );
  45. const cmChar_t* cmDspSysPresetGroupLabel( cmDspSysH_t h, unsigned groupIdx );
  46. cmDspRC_t cmDspSysPresetGroupJsonList( cmDspSysH_t h, cmJsonH_t* jsHPtr );
  47. // A 'preset' is a collection of stored DSP instances and their variables. A preset belongs
  48. // to a group. A given group may have multiple presets. Each preset represents a saved
  49. // instance/var state.
  50. unsigned cmDspSysPresetPresetCount( cmDspSysH_t h, unsigned groupIdx );
  51. unsigned cmDspSysPresetPresetSymId( cmDspSysH_t h, unsigned groupIdx, unsigned presetIdx );
  52. const cmChar_t* cmDspSysPresetPresetLabel( cmDspSysH_t h, unsigned groupIdx, unsigned presetIdx );
  53. cmDspRC_t cmDspSysPresetPresetJsonList(cmDspSysH_t h, unsigned groupSymId, cmJsonH_t* jsHPtr );
  54. // This function returns a preset group id from a string label.
  55. unsigned cmDspSysPresetRegisterGroup( cmDspSysH_t h, const cmChar_t* groupLabel );
  56. // Create a preset named 'presetLabel' in the group named 'groupLabel'. If the group does not
  57. // exist it will be created. The creation will fail if the 'presetLabel' already exists.
  58. // This function calls the 'storeFunc' on every DSP instance belonging to the group
  59. // identified by 'groupLabel'.
  60. cmDspRC_t cmDspSysPresetCreate( cmDspSysH_t h, const cmChar_t* groupLabel, const cmChar_t* presetLabel );
  61. // Apply the stored preset named by 'groupLabel' and 'presetLabel'.
  62. cmDspRC_t cmDspSysPresetRecall( cmDspSysH_t h, const cmChar_t* groupLabel, const cmChar_t* presetLabel );
  63. // Helper functions used by DSP instances to read and write preset variable values. These functions
  64. // are called from inside the user defined DSP instance 'storeFunc'.
  65. cmDspRC_t cmDspSysPresetWriteValue( cmDspSysH_t h, unsigned varSymId, const cmDspValue_t* valPtr );
  66. cmDspRC_t cmDspSysPresetReadValue( cmDspSysH_t h, unsigned varSymId, cmDspValue_t* valPtr );
  67. //----------------------------------------------------------------------------------------------------
  68. // Generic constructors
  69. //
  70. // Allocate single DSP instances.
  71. cmDspInst_t* cmDspSysAllocInstSV( cmDspSysH_t h, const cmChar_t* classLabelStr, unsigned presetGroupSymId, const cmChar_t* instLabelStr, unsigned va_cnt, va_list vl );
  72. cmDspInst_t* cmDspSysAllocInstS( cmDspSysH_t h, const cmChar_t* classLabelStr, unsigned presetGroupSymId, const cmChar_t* instLabelStr, unsigned va_cnt, ... );
  73. cmDspInst_t* cmDspSysAllocInst( cmDspSysH_t h, const cmChar_t* classLabelStr, const cmChar_t* instLabelStr, unsigned va_cnt, ... );
  74. typedef const cmChar_t* (*cmDspSysLabelFunc_t)( cmDspSysH_t h, unsigned i );
  75. // Allocate arrays of DSP instances. The memory used by the array is allocated from
  76. // the cmDspSys linked heap and is therefore automatically garbage collected.
  77. cmDspInst_t** cmDspSysAllocInstArraySV( cmDspSysH_t h, unsigned cnt, unsigned presetGroupSymId, const cmChar_t* classLabelStr, const cmChar_t* instLabelStr, cmDspSysLabelFunc_t labelFunc, unsigned va_cnt, va_list vl );
  78. cmDspInst_t** cmDspSysAllocInstArrayS( cmDspSysH_t h, unsigned cnt, unsigned presetGroupSymId, const cmChar_t* classLabelStr, const cmChar_t* instLabelStr, cmDspSysLabelFunc_t labelFunc, unsigned va_cnt, ... );
  79. cmDspInst_t** cmDspSysAllocInstArray( cmDspSysH_t h, unsigned cnt, const cmChar_t* classLabelStr, const cmChar_t* instLabelStr, cmDspSysLabelFunc_t labelFunc, unsigned va_cnt, ... );
  80. cmDspRC_t cmDspSysNewColumn( cmDspSysH_t h, unsigned colW );
  81. cmDspRC_t cmDspSysInsertHorzBorder( cmDspSysH_t h );
  82. cmDspRC_t cmDspSysNewPage( cmDspSysH_t h, const cmChar_t* title );
  83. //----------------------------------------------------------------------------------------------------
  84. // Connection Functions.
  85. //
  86. cmDspRC_t cmDspSysConnectAudio( cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarLbl, cmDspInst_t* dstInstPtr, const cmChar_t* dstVarLbl );
  87. cmDspRC_t cmDspSysConnectAudioN11N( cmDspSysH_t h, cmDspInst_t* srcInstArray[], const cmChar_t* srcVarLabel, cmDspInst_t* dstInstPtr, const cmChar_t* dstVarPrefixStr, unsigned n );
  88. cmDspRC_t cmDspSysConnectAudio1NN1( cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarPrefixStr, cmDspInst_t* dstInstArray[], const cmChar_t* dstVarLabel, unsigned n );
  89. cmDspRC_t cmDspSysConnectAudio1N1N( cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarPrefixStr, cmDspInst_t* dstInstPtr, const cmChar_t* dstVarPrefixLabel, unsigned n );
  90. cmDspRC_t cmDspSysConnectAudioN1N1( cmDspSysH_t h, cmDspInst_t* srcInstArray[], const cmChar_t* srcVarLabel, cmDspInst_t* dstInstArray[], const cmChar_t* dstVarLabel, unsigned n );
  91. cmDspRC_t cmDspSysConnectAudio11N1( cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarLabel, cmDspInst_t* dstInstPArray[],const cmChar_t* dstVarPrefixStr, unsigned n );
  92. cmDspRC_t cmDspSysConnectAudio111N( cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarLabel, cmDspInst_t* dstInstPtr, const cmChar_t* dstVarLabel, unsigned n );
  93. // Connect srcInstArray[ map[i] ] to dstInst.in[i] - map[dstCnt] therefore contains dstCnt elements
  94. cmDspRC_t cmDspSysConnectAudioN11NM( cmDspSysH_t h, cmDspInst_t* srcInstArray[], const cmChar_t* srcVarLabel, unsigned srcCnt, cmDspInst_t* dstInstPtr, const cmChar_t* dstVarPrefixStr, unsigned dstCnt, const unsigned* map );
  95. cmDspRC_t cmDspSysInstallCb( cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarLabel, cmDspInst_t* dstInstPtr, const cmChar_t* dstVarLabel, void* dstCbDataPtr);
  96. cmDspRC_t cmDspSysInstallCbN11N( cmDspSysH_t h, cmDspInst_t* srcInstArray[], const cmChar_t* srcVarLabel, cmDspInst_t* dstInstPtr, const cmChar_t* dstVarPrefixStr, unsigned n );
  97. cmDspRC_t cmDspSysInstallCb1NN1( cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarPrefixStr, cmDspInst_t* dstInstArray[], const cmChar_t* dstVarLabel, unsigned n );
  98. cmDspRC_t cmDspSysInstallCb1N1N( cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarPrefixStr, cmDspInst_t* dstInstPtr, const cmChar_t* dstVarPrefixLabel, unsigned n );
  99. cmDspRC_t cmDspSysInstallCbN1N1( cmDspSysH_t h, cmDspInst_t* srcInstArray[], const cmChar_t* srcVarLabel, cmDspInst_t* dstInstArray[], const cmChar_t* dstVarLabel, unsigned n );
  100. cmDspRC_t cmDspSysInstallCb11N1( cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarLabel, cmDspInst_t* dstInstArray[], const cmChar_t* dstVarLabel, unsigned n );
  101. cmDspRC_t cmDspSysInstallCb111N( cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarLabel, cmDspInst_t* dstInstPtr, const cmChar_t* dstVarPrefixLabel, unsigned n );
  102. cmDspRC_t cmDspSysInstallCbN111( cmDspSysH_t h, cmDspInst_t* srcInstArray[], const cmChar_t* srcVarLabel, cmDspInst_t* dstInstPtr, const cmChar_t* dstVarLabel, unsigned n );
  103. cmDspRC_t cmDspSysInstallCb1N11( cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarPrefixStr, cmDspInst_t* dstInstPtr, const cmChar_t* dstVarLabel, unsigned n );
  104. cmDspRC_t cmDspSysInstallCb1N1NM( cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarPrefixStr, unsigned srcCnt, cmDspInst_t* dstInstPtr, const cmChar_t* dstVarPrefixLabel, unsigned dstCnt, const unsigned* map );
  105. cmDspRC_t cmDspSysInstallCb1NN1M( cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarPrefixStr, unsigned srcCnt, cmDspInst_t* dstInstArray[], const cmChar_t* dstVarLabel, unsigned dstCnt, const unsigned* map );
  106. cmDspRC_t cmDspSysInstallCb1NN1M2(cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarPrefixStr, unsigned srcCnt, const unsigned* map, cmDspInst_t* dstInstArray[], const cmChar_t* dstVarLabel, unsigned dstCnt );
  107. cmDspRC_t cmDspSysInstallNetCb( cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarLabel, const cmChar_t* dstNetNodeLabel, const cmChar_t* dstInstLabel, const cmChar_t* dstVarLabel );
  108. cmDspRC_t cmDspSysInstallNetCb1N1N( cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarPrefixStr, const cmChar_t* dstNetNodeLabel, const cmChar_t* dstInstLabel, const cmChar_t* dstVarPrefixStr, unsigned dstOffs, unsigned n );
  109. cmDspRC_t cmDspSysInstallNetCb1N1NM(cmDspSysH_t h, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarPrefixStr, unsigned srcCnt, const cmChar_t* dstNetNodeLabel, const cmChar_t* dstInstLabel, const cmChar_t* dstVarPrefixStr, unsigned dstCnt, const unsigned* map );
  110. //----------------------------------------------------------------------------------------------------
  111. // cmDspSysH_t Accessor Functions
  112. //
  113. double cmDspSysSampleRate( cmDspSysH_t h );
  114. cmJsonH_t cmDspSysPgmRsrcHandle( cmDspSysH_t h );
  115. cmSymTblH_t cmDspSysSymbolTable( cmDspSysH_t h );
  116. cmSeH_t cmDspSysSerialPort( cmDspSysH_t h );
  117. unsigned cmDspSysRegisterStaticSymbol( cmDspSysH_t h, const cmChar_t* symLabel );
  118. unsigned cmDspSysRegisterSymbol( cmDspSysH_t h, const cmChar_t* symLabel );
  119. cmCtx_t* cmDspSysPgmCtx( cmDspSysH_t h );
  120. cmLHeapH_t cmDspSysLHeap( cmDspSysH_t h );
  121. unsigned cmDspSysNetNodeId( cmDspSysH_t h );
  122. const cmChar_t* cmDspSysNetNodeLabel( cmDspSysH_t h );
  123. const cmChar_t* cmDspSysNetNodeIdToLabel( cmDspSysH_t h, unsigned netNodeId );
  124. unsigned cmDspSysNetNodeLabelToId( cmDspSysH_t h, const cmChar_t* netNodeLabel );
  125. //----------------------------------------------------------------------------------------------------
  126. // Attribute Symbol assignment and value broadcasing
  127. //
  128. // Each DSP instance can be tagged with an arbitrary number of 'attribute' symbols.
  129. // The primary use of an attribute symbol is to identify targets of
  130. // messages sent via the cmDspSysBroadcastValue() call.
  131. // This function declares an active attribute symbol which will be assigned to all DSP
  132. // instances which are created after the function is called and before
  133. // cmDspSysRemoveInstAttrSymbol(). Multiple attribute symbols may be made active
  134. // in this way - in which case all active attribute symbols will be assigned to any
  135. // DSP instances created during their life time.
  136. // Return symId or cmInvalidId on failure.
  137. unsigned cmDspSysRegisterInstAttrSymbol( cmDspSysH_t h, unsigned symId );
  138. unsigned cmDspSysRegisterInstAttrSymbolStr( cmDspSysH_t h, const cmChar_t* symLabel );
  139. // Assign a instance attribute symbol to a DSP instance.
  140. cmDspRC_t cmDspSysAssignInstAttrSymbol( cmDspSysH_t h, cmDspInst_t* inst, unsigned symId );
  141. // Return cmInvalidId on error otherwise returns the symbol id associated with symLabel.
  142. unsigned cmDspSysAssignInstAttrSymbolStr( cmDspSysH_t h, cmDspInst_t* inst, const cmChar_t* symLabel );
  143. // Remove a previously registered attribute symbol.
  144. cmDspRC_t cmDspSysRemoveInstAttrSymbol( cmDspSysH_t h, unsigned symId );
  145. cmDspRC_t cmDspSysRemoveInstAttrSymbolStr( cmDspSysH_t h, const cmChar_t* symLabel );
  146. // Send a value to every DSP instance tagged with the attribute symbol
  147. // 'instAttrSymId'.
  148. // Set instAttrSymId to cmInvalidId to send to all instances
  149. cmDspRC_t cmDspSysBroadcastValue( cmDspSysH_t h, unsigned instAttrSymId, const cmDspValue_t* valuePtr );
  150. //----------------------------------------------------------------------------------------------------
  151. // Specialized Constructors:
  152. //
  153. // align: kRightAlignDuiId, kLeftAlignDuiId, kCenterAlignDuiId
  154. cmDspInst_t* cmDspSysAllocLabel( cmDspSysH_t h, const cmChar_t* label, unsigned alignId );
  155. cmDspInst_t* cmDspSysAllocScalar( cmDspSysH_t h, const cmChar_t* label, cmReal_t min, cmReal_t max, cmReal_t step, cmReal_t val );
  156. cmDspInst_t* cmDspSysAllocScalarP( cmDspSysH_t h, unsigned presetGroupSymId, const cmChar_t* prefixLabel, const cmChar_t* label, cmReal_t min, cmReal_t max, cmReal_t step, cmReal_t val );
  157. cmDspInst_t* cmDspSysAllocScalarRsrc( cmDspSysH_t h, const cmChar_t* label, cmReal_t min, cmReal_t max, cmReal_t step, const cmChar_t* rsrcPath );
  158. cmDspInst_t** cmDspSysAllocScalarA( cmDspSysH_t h, unsigned cnt, unsigned presetGroupSymId, const cmChar_t* prefixLabel, const cmChar_t* label, cmReal_t min, cmReal_t max, cmReal_t step, cmReal_t val );
  159. cmDspInst_t* cmDspSysAllocButton( cmDspSysH_t h, const cmChar_t* label, cmReal_t val );
  160. cmDspInst_t* cmDspSysAllocButtonP( cmDspSysH_t h, const cmChar_t* prefixLabel, const cmChar_t* label, cmReal_t val );
  161. cmDspInst_t* cmDspSysAllocButtonRsrc( cmDspSysH_t h, const cmChar_t* label, const cmChar_t* rsrcPath );
  162. cmDspInst_t* cmDspSysAllocCheck( cmDspSysH_t h, const cmChar_t* label, cmReal_t val );
  163. cmDspInst_t* cmDspSysAllocCheckP( cmDspSysH_t h, unsigned presetGroupSymId, const cmChar_t* prefixLabel, const cmChar_t* label, cmReal_t val );
  164. cmDspInst_t* cmDspSysAllocCheckRsrc( cmDspSysH_t h, const cmChar_t* label, const cmChar_t* rsrcPath );
  165. // If 'fn' is NULL then the DSP rsrc tree is used to locate the resource.
  166. // The resource named by 'rsrcLabel' may be any place in the resource tree.
  167. cmDspInst_t* cmDspSysAllocMsgList( cmDspSysH_t h, const cmChar_t* fn, const cmChar_t* rsrcLabel, unsigned initSelIdx );
  168. cmDspInst_t* cmDspSysAllocMsgListP( cmDspSysH_t h, unsigned presetGroupSymId, const cmChar_t* preLabel, const cmChar_t* label, const cmChar_t* fn, const cmChar_t* rsrcLabel, unsigned initSelIdx );
  169. cmDspInst_t* cmDspSysAllocAudioIn( cmDspSysH_t h, unsigned chIdx, cmReal_t gain );
  170. // Set chMapRsrcLabel to NULL to use the rsrc named 'audioInMap'.
  171. // *retChCntPtr is set to the count of audio channels created (and the count of channels in the map).
  172. cmDspInst_t** cmDspSysAllocAudioInAR( cmDspSysH_t h, const cmChar_t* chMapRsrcLabel, cmReal_t gain, unsigned* retChCntPtr );
  173. cmDspInst_t* cmDspSysAllocAudioOut( cmDspSysH_t h, unsigned chIdx, cmReal_t gain );
  174. // Set chMapRsrcLabel to NULL to use the rsrc named 'audioOutMap'.
  175. // *retChCntPtr is set to the count of audio channels created (and the count of channels in the map).
  176. cmDspInst_t** cmDspSysAllocAudioOutAR( cmDspSysH_t h, const cmChar_t* chMapRsrcLabel, cmReal_t gain, unsigned* retChCntPtr );
  177. //----------------------------------------------------------------------------------------------------
  178. // Read resource values from the program resource file.
  179. //
  180. cmDspRC_t cmDspRsrcBoolV( cmDspSysH_t h, bool* vp, va_list vl );
  181. cmDspRC_t cmDspRsrcIntV( cmDspSysH_t h, int* vp, va_list vl );
  182. cmDspRC_t cmDspRsrcUIntV( cmDspSysH_t h, unsigned* vp, va_list vl );
  183. cmDspRC_t cmDspRsrcDblV( cmDspSysH_t h, double* vp, va_list vl );
  184. cmDspRC_t cmDspRsrcRealV( cmDspSysH_t h, cmReal_t* vp, va_list vl );
  185. cmDspRC_t cmDspRsrcStringV( cmDspSysH_t h, const cmChar_t** vp, va_list vl );
  186. cmDspRC_t cmDspRsrcArrayCountV( cmDspSysH_t h, unsigned* np, va_list vl );
  187. cmDspRC_t cmDspRsrcBoolArrayV( cmDspSysH_t h, unsigned* np, bool** vpp, va_list vl );
  188. cmDspRC_t cmDspRsrcIntArrayV( cmDspSysH_t h, unsigned* np, int** vpp, va_list vl );
  189. cmDspRC_t cmDspRsrcUIntArrayV( cmDspSysH_t h, unsigned* np, unsigned** vpp, va_list vl );
  190. cmDspRC_t cmDspRsrcDblArrayV( cmDspSysH_t h, unsigned* np, double** vpp, va_list vl );
  191. cmDspRC_t cmDspRsrcRealArrayV( cmDspSysH_t h, unsigned* np, cmReal_t** vpp, va_list vl );
  192. cmDspRC_t cmDspRsrcStringArrayV(cmDspSysH_t h, unsigned* np, const cmChar_t*** vpp, va_list vl );
  193. cmDspRC_t cmDspRsrcInt( cmDspSysH_t h, int* vp, ... );
  194. cmDspRC_t cmDspRsrcBool( cmDspSysH_t h, bool* vp, ... );
  195. cmDspRC_t cmDspRsrcUInt( cmDspSysH_t h, unsigned* vp, ... );
  196. cmDspRC_t cmDspRsrcDbl( cmDspSysH_t h, double* vp, ... );
  197. cmDspRC_t cmDspRsrcReal( cmDspSysH_t h, cmReal_t* vp, ... );
  198. cmDspRC_t cmDspRsrcString( cmDspSysH_t h, const cmChar_t** vp, ... );
  199. cmDspRC_t cmDspRsrcArrayCount( cmDspSysH_t h, unsigned* np, ... );
  200. cmDspRC_t cmDspRsrcBoolArray( cmDspSysH_t h, unsigned* np, bool** vpp, ... );
  201. cmDspRC_t cmDspRsrcIntArray( cmDspSysH_t h, unsigned* np, int** vpp, ... );
  202. cmDspRC_t cmDspRsrcUIntArray( cmDspSysH_t h, unsigned* np, unsigned** vpp, ... );
  203. cmDspRC_t cmDspRsrcDblArray( cmDspSysH_t h, unsigned* np, double** vpp, ... );
  204. cmDspRC_t cmDspRsrcRealArray( cmDspSysH_t h, unsigned* np, cmReal_t** vpp, ... );
  205. cmDspRC_t cmDspRsrcStringArray( cmDspSysH_t h, unsigned* np, const cmChar_t*** vpp, ... );
  206. cmDspRC_t cmDspRsrcWriteStringV( cmDspSysH_t h, const cmChar_t* v, va_list vl );
  207. cmDspRC_t cmDspRsrcWriteString( cmDspSysH_t h, const cmChar_t* v, ... );
  208. //)
  209. typedef cmDspInst_t inst_t;
  210. #define inst( classLabel, instLabel, ... ) cmDspSysAllocInst( h, classLabel, instLabel, PP_NARG(__VA_ARGS__), __VA_ARGS__ )
  211. #define button( label, real_val ) cmDspSysAllocButton( h, label, real_val )
  212. #define scalar( label, rmin, rmax, rstep, rval ) cmDspSysAllocScalar( h, label, rmin, rmax, rstep, rval )
  213. #define audio( src, sarg, dst, darg ) cmDspSysConnectAudio( h, src, #sarg, dst, #darg )
  214. #define event( src, sarg, dst, darg ) cmDspSysInstallCb( h, src, #sarg, dst, #darg, NULL )
  215. #ifdef __cplusplus
  216. }
  217. #endif
  218. #endif