libcm is a C development framework with an emphasis on audio signal processing applications.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

cmRtSysMsg.h 3.3KB

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