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.

cmDspClass.h 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. #ifndef cmDspClass_h
  2. #define cmDspClass_h
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. typedef unsigned cmDspRC_t;
  7. enum
  8. {
  9. kOkDspRC = cmOkRC, // 0
  10. kMemAllocFailDspRC, // 1
  11. kLHeapFailDspRC, // 2
  12. kJsonFailDspRC, // 3
  13. kFileSysFailDspRC, // 4
  14. kSymTblFailDspRC, // 5
  15. kThreadFailDspRC, // 6
  16. kNetFailDspRC, // 7
  17. kCsvFailDspRC, // 8
  18. kDspStoreFailDspRC,
  19. kProcFailDspRC,
  20. kAllocInstFailDspRC,
  21. kClassFinalFailDspRC,
  22. kInstFinalFailDspRC,
  23. kInstResetFailDspRC,
  24. kInstExecFailDspRC,
  25. kInstStoreFailDspRC,
  26. kInstRecallFailDspRC,
  27. kInstMsgRcvFailDspRC,
  28. kNetSendAllocFailDspRC,
  29. kClassNotFoundDspRC,
  30. kInstNotFoundDspRC,
  31. kDuplInstSymIdDspRC,
  32. kVarNotFoundDspRC,
  33. kSrcVarNotFoundDspRC,
  34. kRsrcNotFoundDspRC,
  35. kSymNotFoundDspRC,
  36. kNetNodeNotFoundDspRC,
  37. kDuplPresetInstDspRC,
  38. kDuplPresetVarDspRC,
  39. kPresetGrpNotFoundDspRC,
  40. kPresetPreNotFoundDspRC,
  41. kPresetInstNotFoundDspRC,
  42. kPresetVarNotFoundDspRC,
  43. kVarDuplicateDspRC,
  44. kVarTypeErrDspRC,
  45. kVarNotValidDspRC,
  46. kVarArgParseFailDspRC,
  47. kInstCbInstallFailDspRC,
  48. kConnectFailDspRC,
  49. kInstSetFlagsFailDspRC,
  50. kSerializeUiMsgFailDspRC,
  51. kSendToHostFailDspRC,
  52. kUiEleCreateFailDspRC,
  53. kInvalidArgDspRC,
  54. kInvalidStateDspRC,
  55. kSubSysFailDspRC,
  56. kFileWriteFailDspRC,
  57. kFileReadFailDspRC,
  58. kFileOpenFailDspRC,
  59. kFileCloseFailDspRC,
  60. kInvalidPgmIdxDspRC,
  61. kPgmCfgFailDspRC
  62. };
  63. struct cmDspClass_str;
  64. struct cmDspInst_str;
  65. enum
  66. {
  67. kUiDspFl = 0x01, // set in cmDspSysHandleUiMsg() to indicate that a msg originated from a UI control.
  68. kUiEchoDspFl = 0x02, // set in cmDspSysHandleUiMsg() to indicate that the value set from a UI control should sent back to it by the DSP engine.
  69. kDfltEvtDspFlags = 0
  70. };
  71. // DSP event record
  72. typedef struct
  73. {
  74. unsigned flags; // See kXXDspFl
  75. struct cmDspInst_str* srcInstPtr; // source instance of the event or NULL if the system generated the event
  76. unsigned srcVarId; // source selector id used to identify this event (See Note 1 below.)
  77. unsigned dstVarId; // dest. selector id used to identify the target of the event
  78. void* dstDataPtr; // dest. supplied custom callback data pointer
  79. const cmDspValue_t* valuePtr; // event message data
  80. } cmDspEvt_t;
  81. #define cmDspEvtCopy( e0, e1 ) (*(e0)) = (*(e1))
  82. // Note 1: When the event was generated from a UI msg then:
  83. // a. The kUiDspFl is set and the kUiEchoDspFl if the UI requested duplex operation.
  84. // b. srcVarId is set with the cmDspUiHdr_t selId value of the UI msg.
  85. typedef struct cmDspClass_str* (*cmDspClassConsFunc_t)(cmDspCtx_t* ctx);
  86. typedef cmDspRC_t (*cmDspClassFunc_t)( cmDspCtx_t* ctx, struct cmDspClass_str* classPtr );
  87. typedef struct cmDspInst_str* (*cmDspConsFunc_t)( cmDspCtx_t* ctx, struct cmDspClass_str* classPtr, unsigned storeSymId, unsigned instSymId, unsigned id, unsigned va_cnt, va_list vl );
  88. typedef cmDspRC_t (*cmDspFunc_t)( cmDspCtx_t* ctx, struct cmDspInst_str* thisPtr, const cmDspEvt_t* evtPtr );
  89. typedef cmDspRC_t (*cmDspStoreFunc_t)( cmDspCtx_t* ctx, struct cmDspInst_str* thisPtr, bool Fl );
  90. typedef cmDspRC_t (*cmDspAttrSymFunc_t)(cmDspCtx_t* ctx, struct cmDspInst_str* thisPtr, unsigned attrSymId, const cmDspValue_t* value );
  91. // DSP class record
  92. typedef struct cmDspClass_str
  93. {
  94. cmErr_t err;
  95. const cmChar_t* labelStr;
  96. const cmChar_t* doc;
  97. cmDspClassFunc_t finalClassFunc; // finalize the class
  98. cmDspConsFunc_t allocFunc; // allocate an instance
  99. cmDspFunc_t freeFunc; // free an instance
  100. cmDspFunc_t resetFunc; //
  101. cmDspFunc_t execFunc; //
  102. cmDspFunc_t recvFunc; //
  103. cmDspStoreFunc_t storeFunc; // store the state of this instance
  104. cmDspAttrSymFunc_t sysRecvFunc; // attr/value recv function (see cmDspSysBroadcastValue()
  105. } cmDspClass_t;
  106. // record used to maintain an event target callback chain
  107. typedef struct cmDspInstCb_str
  108. {
  109. unsigned srcVarSymId; // src var symbol id
  110. struct cmDspInst_str* dstInstPtr; // target instance
  111. unsigned dstVarId; // target instance sel id
  112. void* dstDataPtr; // target instance custom data
  113. struct cmDspInstCb_str* linkPtr; // chain link
  114. } cmDspCb_t;
  115. // record used to maintain instance variables
  116. typedef struct
  117. {
  118. unsigned flags; // see xxxDsvFl in cmDspValue.h for possible flag values
  119. unsigned constId; // constant id provided by the instance
  120. unsigned symId; // symbol id assoc'd with this var's label
  121. cmDspValue_t value; // current value of this variable
  122. cmDspValue_t dflt; // default value for this variable
  123. cmDspCb_t* cbList; // event targets registered with this instance
  124. const cmChar_t* doc; // document string
  125. } cmDspVar_t;
  126. typedef struct
  127. {
  128. const char* label;
  129. unsigned constId;
  130. unsigned rn;
  131. unsigned cn;
  132. unsigned flags;
  133. const cmChar_t* doc;
  134. } cmDspVarArg_t;
  135. typedef struct cmDspInstSymId_str
  136. {
  137. unsigned symId; // set to cmInvalidId if the recd is not active
  138. struct cmDspInstSymId_str* link;
  139. } cmDspInstSymId_t;
  140. enum
  141. {
  142. kDisableExecInstFl = 0x01
  143. };
  144. typedef struct cmDspInst_str
  145. {
  146. struct cmDspClass_str* classPtr; // ptr to class for this instance
  147. unsigned symId; // optional unique instance label symbol id
  148. unsigned id; // id is unique among all insts
  149. unsigned flags; // See kXXXInstFl above
  150. cmDspVar_t* varArray; //
  151. unsigned varCnt; //
  152. cmDspFunc_t freeFunc; // free an instance
  153. cmDspFunc_t resetFunc; // reset a instance to its default values
  154. cmDspFunc_t execFunc; // DSP clock tick
  155. cmDspFunc_t recvFunc; // recv an event
  156. cmDspStoreFunc_t storeFunc; //
  157. cmDspAttrSymFunc_t sysRecvFunc;
  158. unsigned presetGroupSymId;//
  159. cmDspInstSymId_t* symIdList; //
  160. } cmDspInst_t;
  161. cmDspRC_t cmDspClassSetup(
  162. cmDspClass_t* classPtr, // class to setup
  163. cmDspCtx_t* ctx, //
  164. const cmChar_t* classLabel, //
  165. cmDspClassFunc_t finalClassFunc, // finalize the class
  166. cmDspConsFunc_t allocFunc, // allocate an instance
  167. cmDspFunc_t freeFunc, // free an instance
  168. cmDspFunc_t resetFunc,
  169. cmDspFunc_t execFunc,
  170. cmDspFunc_t recvFunc,
  171. cmDspStoreFunc_t storeFunc,
  172. cmDspAttrSymFunc_t sysRecvFunc,
  173. const cmChar_t* doc
  174. );
  175. void* cmDspInstAllocate(cmDspCtx_t* ctx, cmDspClass_t* classPtr, const cmDspVarArg_t* argV, unsigned instByteCnt, unsigned instSymId, unsigned instId, unsigned storeSymId, unsigned vargCnt, va_list vl );
  176. #define cmDspInstAlloc(T,ctx,classPtr,args,symId,id,storeSymId,vargCnt,vl) (T*)cmDspInstAllocate(ctx,classPtr,args,sizeof(T),symId,id,storeSymId,vargCnt,vl)
  177. void* cmDspInstAllocateV(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsigned instByteCnt, unsigned instSymId, unsigned instId, unsigned storeSymId, unsigned vargCnt, va_list vl0, ... );
  178. #define cmDspInstAllocV(T,ctx,classPtr,symId,id,storeSymId,va_cnt,vl, ... ) (T*)cmDspInstAllocateV(ctx,classPtr,sizeof(T),symId,id,storeSymId,va_cnt,vl, __VA_ARGS__ )
  179. bool cmDspInstHasAttrSym( cmDspInst_t* inst, unsigned attrSymId );
  180. cmDspRC_t cmDspInstRegisterAttrSym( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned attrSymId );
  181. cmDspRC_t cmDspInstRemoveAttrSym( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned attrSymId );
  182. cmDspRC_t cmDspClassErr( cmDspCtx_t* ctx, cmDspClass_t* classPtr, cmDspRC_t rc, const cmChar_t* fmt, ... );
  183. cmDspRC_t cmDspInstErr( cmDspCtx_t* ctx, cmDspInst_t* inst, cmDspRC_t rc, const cmChar_t* fmt, ... );
  184. // Helper functions for setting up enumerated cmDspVarArg_t records.
  185. void cmDspArgSetup( cmDspCtx_t* ctx, cmDspVarArg_t* arg, const cmChar_t* labelPrefix, unsigned labelId, unsigned constId, unsigned rn, unsigned cn, unsigned flags, const cmChar_t* docStr );
  186. unsigned cmDspArgCopy( cmDspVarArg_t* argArray, unsigned argN, unsigned dstIdx, const cmDspVarArg_t* s, unsigned sn );
  187. unsigned cmDspArgSetupN( cmDspCtx_t* ctx, cmDspVarArg_t* arg, unsigned argN, unsigned dstIdx, unsigned cnt, const cmChar_t* labelPrefix, unsigned baseConstId, unsigned rn, unsigned cn, unsigned flags, const cmChar_t* staticDocStr );
  188. void cmDspArgSetupNull( cmDspVarArg_t* arg );
  189. const cmChar_t* cmDspInstLabel( cmDspCtx_t* ctx, cmDspInst_t* inst );
  190. // Given and instance and a variable symbol id return a pointer to the variable.
  191. cmDspVar_t* cmDspVarSymbolToPtr( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varSymId, unsigned flags );
  192. // Given an instance and a var id return a pointer to the variable.
  193. const cmDspVar_t* cmDspVarIdToCPtr( const cmDspInst_t* inst, unsigned varId );
  194. cmDspVar_t* cmDspVarIdToPtr( cmDspInst_t* inst, unsigned varId );
  195. const cmChar_t* cmDspVarLabel( cmDspCtx_t* ctx, const cmDspInst_t* inst, unsigned varId );
  196. // Make callbacks for the specified instance var.
  197. cmDspRC_t cmDspOutputEvent( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId );
  198. cmDspRC_t cmDspVarPresetWrite( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId );
  199. cmDspRC_t cmDspVarPresetRead( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId );
  200. cmDspRC_t cmDspVarPresetRdWr( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, bool storeFl );
  201. double cmDspSampleRate( cmDspCtx_t* ctx );
  202. unsigned cmDspSamplesPerCycle( cmDspCtx_t* ctx );
  203. // Query the type of a variable
  204. unsigned cmDspTypeFlags(const cmDspInst_t* inst, unsigned varId );
  205. bool cmDspIsBool( const cmDspInst_t* inst, unsigned varId );
  206. bool cmDspIsInt( const cmDspInst_t* inst, unsigned varId );
  207. bool cmDspIsUInt( const cmDspInst_t* inst, unsigned varId );
  208. bool cmDspIsDouble( const cmDspInst_t* inst, unsigned varId );
  209. bool cmDspIsStrz( const cmDspInst_t* inst, unsigned varId );
  210. bool cmDspIsSymbol( const cmDspInst_t* inst, unsigned varId );
  211. bool cmDspIsJson( const cmDspInst_t* inst, unsigned varId );
  212. // Get the value of an instance variable.
  213. bool cmDspBool( cmDspInst_t* inst, unsigned varId );
  214. int cmDspInt( cmDspInst_t* inst, unsigned varId );
  215. unsigned cmDspUInt( cmDspInst_t* inst, unsigned varId );
  216. double cmDspDouble( cmDspInst_t* inst, unsigned varId );
  217. cmSample_t cmDspSample( cmDspInst_t* inst, unsigned varId );
  218. cmReal_t cmDspReal( cmDspInst_t* inst, unsigned varId );
  219. const cmChar_t* cmDspStrcz( cmDspInst_t* inst, unsigned varId );
  220. unsigned cmDspSymbol( cmDspInst_t* inst, unsigned varId );
  221. cmJsonNode_t* cmDspJson( cmDspInst_t* inst, unsigned varId );
  222. // Get the default value of an instance variable.
  223. bool cmDspDefaultBool( cmDspInst_t* inst, unsigned varId );
  224. int cmDspDefaultInt( cmDspInst_t* inst, unsigned varId );
  225. unsigned cmDspDefaultUInt( cmDspInst_t* inst, unsigned varId );
  226. double cmDspDefaultDouble( cmDspInst_t* inst, unsigned varId );
  227. cmSample_t cmDspDefaultSample( cmDspInst_t* inst, unsigned varId );
  228. cmReal_t cmDspDefaultReal( cmDspInst_t* inst, unsigned varId );
  229. const cmChar_t* cmDspDefaultStrcz( cmDspInst_t* inst, unsigned varId );
  230. unsigned cmDspDefaultSymbol( cmDspInst_t* inst, unsigned varId );
  231. cmJsonNode_t* cmDspDefaultJson( cmDspInst_t* inst, unsigned varId );
  232. // Possible values for cmDspSetXXX()
  233. enum
  234. {
  235. kUpdateUiDspFl = 0x00, //
  236. kNoUpdateUiDspFl = 0x01, // don't callback the UI
  237. kNoAllocDspFl = 0x02, // the caller is handling memory mgmt for the incoming value don't allocate space for it internally
  238. kSetDefaultDspFl = 0x04, // set the var default value rather than the current value
  239. kNoSendDspFl = 0x08 // do not transmit the value to connected objects
  240. };
  241. // Instance variable setter functions:
  242. //
  243. // All forms of the setter assign a value to of the specified instance variable and
  244. // then make the callbacks attached to the variable. Note that callbacks to the UI
  245. // can be prevented by setting the kNoUpdateUiDspFl in the call to cmDspSet<type>X().
  246. //
  247. //
  248. // All setters are implemented in terms of the cmDspValueSet()
  249. //
  250. // Convert the source value (svp) to the type of the target var (inst->varArray[varId])
  251. // and assign it to the var value. All the cmDspSetXXX() functions work in terms of this function.
  252. // See the kXXXDspFl flags above for possible 'flag' values.
  253. cmDspRC_t cmDspValueSet( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, const cmDspValue_t* vp, unsigned flags );
  254. // Assign the default value to the current value (if the the specified variable has a valid default value).
  255. cmDspRC_t cmDspApplyDefault( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId );
  256. // Apply the default value to the current value for all variables which has a valid default value.
  257. // This is
  258. cmDspRC_t cmDspApplyAllDefaults( cmDspCtx_t* ctx, cmDspInst_t* inst );
  259. // Set the default value of a variable.
  260. cmDspRC_t cmDspSetDefault( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, const cmDspValue_t* valPtr );
  261. // Set the default variable of a variable to 'val'.
  262. // The call is ignored (and the default value is not set) if the default
  263. // value was previously set to a vaue which is not equal to 'nonInitVal'.
  264. cmDspRC_t cmDspSetDefaultBool( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, bool nonInitVal, bool val );
  265. cmDspRC_t cmDspSetDefaultInt( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, int nonInitVal, int val );
  266. cmDspRC_t cmDspSetDefaultUInt( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, unsigned nonInitVal, unsigned val );
  267. cmDspRC_t cmDspSetDefaultDouble( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, double nonInitVal, double val );
  268. cmDspRC_t cmDspSetDefaultSample( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, cmSample_t nonInitVal, cmSample_t val );
  269. cmDspRC_t cmDspSetDefaultReal( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, cmReal_t nonInitVal, cmReal_t val );
  270. cmDspRC_t cmDspSetDefaultStrcz( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, const cmChar_t* nonInitVal, const cmChar_t* val );
  271. cmDspRC_t cmDspSetDefaultSymbol( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, /*unsigned cmInvalidId*/ unsigned val );
  272. cmDspRC_t cmDspSetDefaultJson( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, cmJsonNode_t* nonInitVal, cmJsonNode_t* val );
  273. // Set the value of a variable and make any attached callbacks.
  274. // If the kUiDsvFl is set on the variable then the UI is also informed of the new value.
  275. // If the source ('val') type does not match the variable type then if possible the
  276. // source is converted to the dest (variable) type.
  277. // This function is implemented in terms of cmDspValueSet().
  278. cmDspRC_t cmDspSetBool( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, bool val );
  279. cmDspRC_t cmDspSetInt( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, int val );
  280. cmDspRC_t cmDspSetUInt( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, unsigned val );
  281. cmDspRC_t cmDspSetDouble( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, double val );
  282. cmDspRC_t cmDspSetSample( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, cmSample_t val );
  283. cmDspRC_t cmDspSetReal( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, cmReal_t val );
  284. cmDspRC_t cmDspSetStrcz( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, const cmChar_t* val );
  285. cmDspRC_t cmDspSetSymbol( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, unsigned val );
  286. cmDspRC_t cmDspSetJson( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, cmJsonNode_t* val );
  287. // Set the value of a variable to the *evt->valuePtr and make any attached callbacks.
  288. // If the kUiDsvFl is set and kNoUiEchoDspFl is not set in evt->flags then UI is informed of the new value.
  289. // If the source (*evt->valuePtr) type does not match the variable type then if possible the
  290. // source is converted to the dest (variable) type.
  291. // This function is implemented in terms of cmDspValueSet().
  292. cmDspRC_t cmDspSetEvent( cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t* evt );
  293. // Same as cmDspSetEvent() but the event is automatically echoed to the UI.
  294. cmDspRC_t cmDspSetEventUi( cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t* evt );
  295. // Same as cmDspSetEventUi() but change the event target variable to 'varId'.
  296. cmDspRC_t cmDspSetEventUiId( cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t* evt, unsigned varId );
  297. // Get the row and col count of a matrix valued instance variable.
  298. unsigned cmDspVarRows( cmDspInst_t* inst, unsigned varId );
  299. unsigned cmDspVarCols( cmDspInst_t* inst, unsigned varId );
  300. // Audio buffer helper functions
  301. bool cmDspIsAudioInputConnected( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId );
  302. cmDspRC_t cmDspZeroAudioBuf( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId );
  303. cmSample_t* cmDspAudioBuf( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, unsigned chIdx );
  304. unsigned cmDspAudioBufSmpCount( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, unsigned chIdx );
  305. // Register dspInstPtr to receive a callback when srcInstPtr generates an event identified by srcVarId.
  306. cmDspRC_t cmDspInstInstallCb( cmDspCtx_t* ctx, cmDspInst_t* srcInstPtr, unsigned srcVarId, cmDspInst_t* dstInstPtr, unsigned dstVarSymId, void* dstCbDataPtr);
  307. cmDspRC_t cmDspInstallCb( cmDspCtx_t* ctx, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarLabel, cmDspInst_t* dstInstPtr, const cmChar_t* dstVarLabel, void* dstCbDataPtr);
  308. // Uninstall a previous registred instance variable callback function.
  309. cmDspRC_t cmDspInstRemoveCb( cmDspCtx_t* ctx, cmDspInst_t* srcInstPtr, unsigned srcVarId, cmDspInst_t* dstInstPtr, unsigned dstVarId );
  310. cmDspRC_t cmDspRemoveCb( cmDspCtx_t* ctx, cmDspInst_t* srcInstPtr, const cmChar_t* srcVarLabel, cmDspInst_t* dstInstPtr, unsigned dstVarId );
  311. //
  312. cmDspRC_t cmDspInstVarSetFlags( cmDspCtx_t* ctx, cmDspInst_t* instPtr, unsigned varId, unsigned flags );
  313. // Used to transmit messages to the audio system.
  314. cmDspRC_t cmDspSendValueToAudioSys( cmDspCtx_t* ctx, unsigned msgTypeId, unsigned selId, unsigned valId, const cmDspValue_t* valPtr );
  315. // The following functions are used to send message to the UI and are
  316. // implemented in cmDspUi.c. They are declared here because they are
  317. // visible to the cmDspInst functions which use them but are not available
  318. // to the host UI. The other values defined and declared in cmDspUi.h are
  319. // common to both the host UI and the DSP instances.
  320. cmDspRC_t cmDspUiConsolePrint( cmDspCtx_t* ctx, cmChar_t* text );
  321. cmDspRC_t cmDspUiSendValue( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned varId, const cmDspValue_t* valPtr );
  322. cmDspRC_t cmDspUiSendVar( cmDspCtx_t* ctx, cmDspInst_t* inst, cmDspVar_t* var );
  323. cmDspRC_t cmDspUiScalarCreate( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned typeDuiId, unsigned minVarId, unsigned maxVarId, unsigned stpVarId, unsigned valVarId, unsigned lblVarId );
  324. cmDspRC_t cmDspUiTextCreate( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned valVarId, unsigned lblVarId );
  325. cmDspRC_t cmDspUiMeterCreate( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned minVarId, unsigned maxVarId, unsigned valVarId, unsigned lblVarId );
  326. cmDspRC_t cmDspUiButtonCreate( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned typeDuiId, unsigned outVarId, unsigned lblVarId );
  327. cmDspRC_t cmDspUiLabelCreate( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned lblVarId, unsigned alignVarId );
  328. cmDspRC_t cmDspUiTimeLineCreate(cmDspCtx_t* ctx,cmDspInst_t* inst, unsigned tlFileVarId, unsigned audPathVarId, unsigned selVarId, unsigned cursVarId );
  329. cmDspRC_t cmDspUiScoreCreate( cmDspCtx_t* ctx,cmDspInst_t* inst, unsigned scFileVarId, unsigned selVarId, unsigned smpIdxVarId, unsigned pitchVarId, unsigned velVarId, unsigned locIdxVarIdx, unsigned evtIdxVarIdx, unsigned dynLvlVarIdx, unsigned valTypeVarIdx, unsigned valueVarIdx );
  330. cmDspRC_t cmDspUiNewColumn( cmDspCtx_t* ctx, unsigned colW );
  331. cmDspRC_t cmDspUiInsertHorzBorder( cmDspCtx_t* ctx );
  332. cmDspRC_t cmDspUiNewPage( cmDspCtx_t* ctx, const cmChar_t* title );
  333. enum { kFnameFnDspFl=0x00, kFnameDirDspFl=0x01 };
  334. cmDspRC_t cmDspUiFnameCreate( cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned valVarId, unsigned patVarId, unsigned dirVarId );
  335. cmDspRC_t cmDspUiMsgListCreate(cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned height, unsigned listVarId, unsigned selVarId );
  336. #ifdef __cplusplus
  337. }
  338. #endif
  339. #endif