libcm is a C development framework with an emphasis on audio signal processing applications.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

cmRtSysMsg.h 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #ifndef cmRtSysMsg_h
  2. #define cmRtSysMsg_h
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. //( { file_desc:"rtSys message contants and data structures." kw:[rtsys] }
  7. // Reserved DSP message selector id's (second field of all
  8. // host<->audio system messages)
  9. enum
  10. {
  11. kMidiMsgArraySelRtId = 1000,
  12. kMidiSysExSelRtId,
  13. kUiDrvrSelRtId, // cmUiDriverArg_t message to/from the UI driver
  14. kUiSelRtId, // cmUiDriverArg_t message from the UI mgr to a client
  15. kUiMstrSelRtId, // indicates a cmDspUiHdr_t msg containing master control information for the audio system
  16. kStatusSelRtId, // indicates the msg is of type cmRtSysStatus_t
  17. kNetSyncSelRtId, // sent with a cmDspNetMsg_t object
  18. kMsgSelRtId, // client defined msg transmitted between threads or network nodes
  19. };
  20. typedef struct
  21. {
  22. unsigned rtSubIdx;
  23. unsigned selId; // Message selector id See kXXXSelRtId above
  24. } cmRtSysMsgHdr_t;
  25. // All of the UI messages that create a UI control contain an array of integers
  26. // as in the 'value' field. The array contains the id's associated with
  27. // the different programmable paramters which are part of the control.
  28. // For example a slider control has minimum,maximum, step size, and value
  29. // parameters. The location in the array is hard coded according to the
  30. // parameters meaning but the actual value of the id is left up to the
  31. // engine. This allows the engine to use whatever values work best for
  32. // it on a per instance basis.
  33. // Header record for all messages between the host and the DSP controllers.
  34. typedef struct
  35. {
  36. cmRtSysMsgHdr_t hdr;
  37. unsigned devIdx;
  38. unsigned chIdx;
  39. bool inFl;
  40. unsigned ctlId;
  41. double value;
  42. } cmRtSysMstr_t;
  43. // Control id's used to identify the control type of master contols.
  44. enum
  45. {
  46. kSliderUiRtId = 0,
  47. kMeterUiRtId = 1,
  48. kMuteUiRtId = 2,
  49. kToneUiRtId = 3,
  50. kPassUiRtId = 4
  51. };
  52. // Audio sub-system status record - this message can be transmitted to the host at
  53. // periodic intervals. See cmRtSysStatusNotifyEnable().
  54. // When transmitted to the host this record acts as the message header.
  55. // This header is followed by two arrays of doubles containing the input
  56. // and output meter values associated with the input and output audio devices.
  57. // Message Layout:
  58. // [ rtSubIdx kStatusSelId cmRtSysStatus_t iMeterArray[iMeterCnt] oMeterArray[oMeterCnt] ]
  59. typedef struct
  60. {
  61. cmRtSysMsgHdr_t hdr;
  62. unsigned updateCnt; // count of callbacks from the audio devices.
  63. unsigned wakeupCnt; // count of times the audio system thread has woken up after the cond. var has been signaled by the audio update thread.
  64. unsigned msgCbCnt; // count of msgs delivered via cmRtCallback() .
  65. unsigned audioCbCnt; // count of times the DSP execution was requested via cmRtCallback().
  66. unsigned iDevIdx; // Input device index
  67. unsigned oDevIdx; // Output device index
  68. unsigned overflowCnt; // count of times the audio input buffers overflowed
  69. unsigned underflowCnt; // count of times the audio output buffers underflowed
  70. unsigned iMeterCnt; // count of input meter channels
  71. unsigned oMeterCnt; // count of output meter channels
  72. } cmRtSysStatus_t;
  73. typedef struct
  74. {
  75. cmRtSysMsgHdr_t hdr;
  76. unsigned devIdx;
  77. unsigned portIdx;
  78. unsigned msgCnt;
  79. // cmMidiMsg msgArray[msgCnt]
  80. } cmRtSysMidi_t;
  81. typedef struct
  82. {
  83. cmRtSysMsgHdr_t hdr; // hdr.rtSubIdx = dest rtSubIdx
  84. // hdr.selId = msg contents
  85. unsigned dstEndPtId; // = dest endpoint
  86. unsigned srcEndPtId; // = src endpoint id
  87. unsigned srcNodeIdx; // = src node index (filled in by receiving cmRtNet mgr)
  88. // char msg[ msgByteCnt ]
  89. } cmRtNetMsg_t;
  90. //)
  91. #ifdef __cplusplus
  92. }
  93. #endif
  94. #endif