Source code of Windows XP (NT5)
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.

258 lines
10 KiB

  1. /***************************************************************************
  2. * *
  3. * DMusProp.h -- This module defines property items for DirectMusic WDM *
  4. * *
  5. * Copyright (c) 1998, Microsoft Corp. All rights reserved. *
  6. * *
  7. ***************************************************************************/
  8. #ifndef _DMusProp_
  9. #define _DMusProp_
  10. #include "dmusbuff.h"
  11. /*
  12. Formats
  13. */
  14. #define STATIC_KSDATAFORMAT_SUBTYPE_DIRECTMUSIC\
  15. 0x1a82f8bc, 0x3f8b, 0x11d2, 0xb7, 0x74, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1
  16. DEFINE_GUIDSTRUCT("1a82f8bc-3f8b-11d2-b774-0060083316c1", KSDATAFORMAT_SUBTYPE_DIRECTMUSIC);
  17. #define KSDATAFORMAT_SUBTYPE_DIRECTMUSIC DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DIRECTMUSIC)
  18. /*
  19. Topology
  20. */
  21. #define STATIC_KSNODETYPE_DMSYNTH\
  22. 0x94824f88, 0x6183, 0x11d2, 0x8f, 0x7a, 0x0, 0xc0, 0x4f, 0xbf, 0x8f, 0xef
  23. DEFINE_GUIDSTRUCT("94824F88-6183-11d2-8F7A-00C04FBF8FEF", KSNODETYPE_DMSYNTH);
  24. #define KSNODETYPE_DMSYNTH DEFINE_GUIDNAMED(KSNODETYPE_DMSYNTH)
  25. /*
  26. Caps node (per pin)
  27. */
  28. #define STATIC_KSNODETYPE_DMSYNTH_CAPS\
  29. 0xbca2a2f1, 0x93c6, 0x11d2, 0xba, 0x1d, 0x0, 0x0, 0xf8, 0x75, 0xac, 0x12
  30. DEFINE_GUIDSTRUCT("bca2a2f1-93c6-11d2-ba1d-0000f875ac12", KSNODETYPE_DMSYNTH_CAPS);
  31. #define KSNODETYPE_DMSYNTH_CAPS DEFINE_GUIDNAMED(KSNODETYPE_DMSYNTH_CAPS)
  32. /*
  33. DDK Property sets and items
  34. */
  35. #define STATIC_KSPROPSETID_Synth_Dls\
  36. 0xd523fa2c, 0xdee3, 0x11d1, 0xa7, 0x89, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12
  37. DEFINE_GUIDSTRUCT("d523fa2c-dee3-11d1-a789-0000f875ac12", KSPROPSETID_Synth_Dls);
  38. #define KSPROPSETID_Synth_Dls DEFINE_GUIDNAMED(KSPROPSETID_Synth_Dls)
  39. typedef enum
  40. {
  41. KSPROPERTY_SYNTH_DLS_DOWNLOAD = 0,
  42. KSPROPERTY_SYNTH_DLS_UNLOAD,
  43. KSPROPERTY_SYNTH_DLS_COMPACT,
  44. KSPROPERTY_SYNTH_DLS_APPEND,
  45. KSPROPERTY_SYNTH_DLS_WAVEFORMAT
  46. } KSPROPERTY_SYNTH_DLS;
  47. typedef struct _SYNTH_BUFFER
  48. {
  49. ULONG BufferSize;
  50. PVOID BufferAddress;
  51. } SYNTH_BUFFER, *PSYNTH_BUFFER;
  52. typedef struct _SYNTHDOWNLOAD
  53. {
  54. HANDLE DownloadHandle;
  55. BOOL Free; /* the client buffer can be freed */
  56. } SYNTHDOWNLOAD, *PSYNTHDOWNLOAD;
  57. #define STATIC_KSPROPSETID_Synth\
  58. 0xfedfae25L, 0xe46e, 0x11d1, 0xaa, 0xce, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12
  59. DEFINE_GUIDSTRUCT("fedfae25-e46e-11d1-aace-0000f875ac12", KSPROPSETID_Synth);
  60. #define KSPROPSETID_Synth DEFINE_GUIDNAMED(KSPROPSETID_Synth)
  61. typedef enum
  62. {
  63. KSPROPERTY_SYNTH_VOLUME = 0, /* must be first */
  64. KSPROPERTY_SYNTH_VOLUMEBOOST,
  65. KSPROPERTY_SYNTH_CAPS,
  66. KSPROPERTY_SYNTH_PORTPARAMETERS,
  67. KSPROPERTY_SYNTH_CHANNELGROUPS,
  68. KSPROPERTY_SYNTH_VOICEPRIORITY,
  69. KSPROPERTY_SYNTH_LATENCYCLOCK,
  70. KSPROPERTY_SYNTH_RUNNINGSTATS
  71. } KSPROPERTY_SYNTH;
  72. #define SYNTH_PC_DLS (0x00000001)
  73. #define SYNTH_PC_EXTERNAL (0x00000002)
  74. #define SYNTH_PC_SOFTWARESYNTH (0x00000004)
  75. #define SYNTH_PC_MEMORYSIZEFIXED (0x00000008)
  76. #define SYNTH_PC_GMINHARDWARE (0x00000010)
  77. #define SYNTH_PC_GSINHARDWARE (0x00000020)
  78. #define SYNTH_PC_XGINHARDWARE (0x00000040)
  79. // 0x80 used in user mode
  80. // 0x100 used in user mode
  81. #define SYNTH_PC_DLS2 (0x00000200)
  82. // 0x400 used in user mode
  83. // 0x800 used in user mode
  84. #define SYNTH_PC_REVERB (0x40000000)
  85. #define SYNTH_PC_SYSTEMMEMORY (0x7fffffff)
  86. typedef struct _SYNTHCAPS
  87. {
  88. GUID Guid;
  89. DWORD Flags;
  90. DWORD MemorySize;
  91. DWORD MaxChannelGroups;
  92. DWORD MaxVoices;
  93. DWORD MaxAudioChannels;
  94. DWORD EffectFlags;
  95. WCHAR Description[128];
  96. } SYNTHCAPS, *PSYNTHCAPS;
  97. typedef struct _SYNTH_PORTPARAMS
  98. {
  99. DWORD ValidParams;
  100. DWORD Voices;
  101. DWORD ChannelGroups;
  102. DWORD AudioChannels;
  103. DWORD SampleRate;
  104. DWORD EffectsFlags;
  105. DWORD Share;
  106. } SYNTH_PORTPARAMS, *PSYNTH_PORTPARAMS;
  107. /* These flags (set in ValidParams) indicate which
  108. * other members of the SYNTH_PORTPARAMS are valid
  109. */
  110. #define SYNTH_PORTPARAMS_VOICES 0x00000001
  111. #define SYNTH_PORTPARAMS_CHANNELGROUPS 0x00000002
  112. #define SYNTH_PORTPARAMS_AUDIOCHANNELS 0x00000004
  113. #define SYNTH_PORTPARAMS_SAMPLERATE 0x00000008
  114. #define SYNTH_PORTPARAMS_EFFECTS 0x00000020
  115. #define SYNTH_PORTPARAMS_SHARE 0x00000040
  116. /* SYNTH_EFFECT_ flags are used in the
  117. * EffectFlags fields of SYNTH_PORTPARAMS.
  118. */
  119. #define SYNTH_EFFECT_NONE 0x00000000
  120. #define SYNTH_EFFECT_REVERB 0x00000001
  121. #define SYNTH_EFFECT_CHORUS 0x00000002
  122. #define SYNTH_EFFECT_DELAY 0x00000004
  123. /*
  124. * Instance data for KSPROPERTY_ITEM_SynthVoicePriority
  125. */
  126. typedef struct _SYNTHVOICEPRIORITY_INSTANCE
  127. {
  128. DWORD ChannelGroup;
  129. DWORD Channel;
  130. } SYNTHVOICEPRIORITY_INSTANCE, *PSYNTHVOICEPRIORITY_INSTANCE;
  131. /*
  132. * Data returned by KSPROPERTY_SYNTH_RUNNINGSTATS
  133. */
  134. typedef struct _SYNTH_STATS
  135. {
  136. DWORD ValidStats; /* Flags indicating which fields below are valid. */
  137. DWORD Voices; /* Average number of voices playing. */
  138. DWORD TotalCPU; /* Total CPU usage as percent * 100. */
  139. DWORD CPUPerVoice; /* CPU per voice as percent * 100. */
  140. DWORD LostNotes; /* Number of notes lost in 1 second. */
  141. DWORD FreeMemory; /* Free memory in bytes */
  142. LONG PeakVolume; /* Decibel level * 100. */
  143. } SYNTH_STATS, *PSYNTH_STATS;
  144. #define SYNTH_STATS_VOICES (1 << 0)
  145. #define SYNTH_STATS_TOTAL_CPU (1 << 1)
  146. #define SYNTH_STATS_CPU_PER_VOICE (1 << 2)
  147. #define SYNTH_STATS_LOST_NOTES (1 << 3)
  148. #define SYNTH_STATS_PEAK_VOLUME (1 << 4)
  149. #define SYNTH_STATS_FREE_MEMORY (1 << 5)
  150. #ifndef _DIRECTAUDIO_PRIORITIES_DEFINED_
  151. #define _DIRECTAUDIO_PRIORITIES_DEFINED_
  152. #define DAUD_CRITICAL_VOICE_PRIORITY (0xF0000000)
  153. #define DAUD_HIGH_VOICE_PRIORITY (0xC0000000)
  154. #define DAUD_STANDARD_VOICE_PRIORITY (0x80000000)
  155. #define DAUD_LOW_VOICE_PRIORITY (0x40000000)
  156. #define DAUD_PERSIST_VOICE_PRIORITY (0x10000000)
  157. /* These are the default priorities assigned if not overridden. By default priorities are
  158. * equal across channel groups (e.g. channel 5 on channel group 1 has the same priority as
  159. * channel 5 on channel group 2).
  160. *
  161. * In accordance with DLS level 1, channel 10 has the highest priority, followed by 1 through 16
  162. * except for 10.
  163. */
  164. #define DAUD_CHAN1_VOICE_PRIORITY_OFFSET (0x0000000E)
  165. #define DAUD_CHAN2_VOICE_PRIORITY_OFFSET (0x0000000D)
  166. #define DAUD_CHAN3_VOICE_PRIORITY_OFFSET (0x0000000C)
  167. #define DAUD_CHAN4_VOICE_PRIORITY_OFFSET (0x0000000B)
  168. #define DAUD_CHAN5_VOICE_PRIORITY_OFFSET (0x0000000A)
  169. #define DAUD_CHAN6_VOICE_PRIORITY_OFFSET (0x00000009)
  170. #define DAUD_CHAN7_VOICE_PRIORITY_OFFSET (0x00000008)
  171. #define DAUD_CHAN8_VOICE_PRIORITY_OFFSET (0x00000007)
  172. #define DAUD_CHAN9_VOICE_PRIORITY_OFFSET (0x00000006)
  173. #define DAUD_CHAN10_VOICE_PRIORITY_OFFSET (0x0000000F)
  174. #define DAUD_CHAN11_VOICE_PRIORITY_OFFSET (0x00000005)
  175. #define DAUD_CHAN12_VOICE_PRIORITY_OFFSET (0x00000004)
  176. #define DAUD_CHAN13_VOICE_PRIORITY_OFFSET (0x00000003)
  177. #define DAUD_CHAN14_VOICE_PRIORITY_OFFSET (0x00000002)
  178. #define DAUD_CHAN15_VOICE_PRIORITY_OFFSET (0x00000001)
  179. #define DAUD_CHAN16_VOICE_PRIORITY_OFFSET (0x00000000)
  180. #define DAUD_CHAN1_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN1_VOICE_PRIORITY_OFFSET)
  181. #define DAUD_CHAN2_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN2_VOICE_PRIORITY_OFFSET)
  182. #define DAUD_CHAN3_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN3_VOICE_PRIORITY_OFFSET)
  183. #define DAUD_CHAN4_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN4_VOICE_PRIORITY_OFFSET)
  184. #define DAUD_CHAN5_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN5_VOICE_PRIORITY_OFFSET)
  185. #define DAUD_CHAN6_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN6_VOICE_PRIORITY_OFFSET)
  186. #define DAUD_CHAN7_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN7_VOICE_PRIORITY_OFFSET)
  187. #define DAUD_CHAN8_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN8_VOICE_PRIORITY_OFFSET)
  188. #define DAUD_CHAN9_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN9_VOICE_PRIORITY_OFFSET)
  189. #define DAUD_CHAN10_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN10_VOICE_PRIORITY_OFFSET)
  190. #define DAUD_CHAN11_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN11_VOICE_PRIORITY_OFFSET)
  191. #define DAUD_CHAN12_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN12_VOICE_PRIORITY_OFFSET)
  192. #define DAUD_CHAN13_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN13_VOICE_PRIORITY_OFFSET)
  193. #define DAUD_CHAN14_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN14_VOICE_PRIORITY_OFFSET)
  194. #define DAUD_CHAN15_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN15_VOICE_PRIORITY_OFFSET)
  195. #define DAUD_CHAN16_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN16_VOICE_PRIORITY_OFFSET)
  196. #endif /* _DIRECTAUDIO_PRIORITIES_DEFINED_ */
  197. /*
  198. SDK Property sets and items
  199. */
  200. typedef struct _SYNTH_REVERB_PARAMS
  201. {
  202. float fInGain; /* Input gain in dB (to avoid output overflows) */
  203. float fReverbMix; /* Reverb mix in dB. 0dB means 100% wet reverb (no direct signal).
  204. Negative values gives less wet signal. The coeficients are
  205. calculated so that the overall output level stays (approximately)
  206. constant regardless of the ammount of reverb mix. */
  207. float fReverbTime; /* The reverb decay time, in milliseconds. */
  208. float fHighFreqRTRatio; /* The ratio of the high frequencies to the global reverb time.
  209. Unless very 'splashy-bright' reverbs are wanted, this should be set to
  210. a value < 1.0. For example if dRevTime==1000ms and dHighFreqRTRatio=0.1
  211. than the decay time for high frequencies will be 100ms.*/
  212. } SYNTH_REVERB_PARAMS, *PSYNTH_REVERB_PARAMS;
  213. #define STATIC_KSPROPSETID_SynthClock \
  214. 0xfedfae26L, 0xe46e, 0x11d1, 0xaa, 0xce, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12
  215. DEFINE_GUIDSTRUCT("fedfae26-e46e-11d1-aace-0000f875ac12", KSPROPSETID_SynthClock);
  216. #define KSPROPSETID_SynthClock DEFINE_GUIDNAMED(KSPROPSETID_SynthClock)
  217. typedef enum
  218. {
  219. KSPROPERTY_SYNTH_MASTERCLOCK
  220. } KSPROPERTY_SYNTHCLOCK;
  221. #endif /* _DMusProp_ */