libcm is a C development framework with an emphasis on audio signal processing applications.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

cmRtSysMsg.h 3.5KB

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