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.

218 lines
6.4 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ntddmix.h
  5. Abstract:
  6. This include file defines all constants and types for
  7. accessing a Windows NT sound mixer device.
  8. Author:
  9. Robin Speed (RobinSp) - 14-Sep-1993
  10. Revision History:
  11. --*/
  12. #ifndef _NTDDMIX_
  13. #define _NTDDMIX_
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17. #include <ntddsnd.h> // general sound stuff
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. #define IOCTL_MIX_BASE 0x0180
  22. //
  23. // Device Name - this string is the name of the device. It is the name
  24. // that when added to the name of the root of the device tree and with
  25. // the device number appended, gives the name of the device required for
  26. // a call to NtOpenFile.
  27. // So for example, if the root is \Device and the Device type is
  28. // MMMix and the device number is 2, the full name is \Device\MMMix2
  29. //
  30. #define DD_MIX_DEVICE_NAME "\\Device\\MMMix"
  31. #define DD_MIX_DEVICE_NAME_U L"\\Device\\MMMix"
  32. //
  33. // Mixer device driver IOCTL set
  34. // No caps call - the caps are dumped to the registry on load which saves
  35. // some code and time.
  36. //
  37. #define IOCTL_MIX_GET_CONFIGURATION CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIX_BASE + 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
  38. #define IOCTL_MIX_GET_CONTROL_DATA CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIX_BASE + 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
  39. #define IOCTL_MIX_GET_LINE_DATA CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIX_BASE + 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS)
  40. #define IOCTL_MIX_REQUEST_NOTIFY CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIX_BASE + 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS)
  41. //
  42. // mix structures
  43. //
  44. //
  45. // IOCTL_MIX_GET_LINE_DATA and
  46. // IOCTL_MIX_GET_CONTROL_DATA
  47. //
  48. // Line structure (NB LineID is implicit from location in array)
  49. //
  50. typedef struct {
  51. ULONG Id; // Either Line or control ID
  52. } MIXER_DD_READ_DATA, *PMIXER_DD_READ_DATA;
  53. //
  54. // Variable line data
  55. //
  56. typedef struct {
  57. ULONG fdwLine;
  58. } MIXER_DD_LINE_DATA;
  59. typedef struct {
  60. UCHAR Destination; // Destination
  61. UCHAR Source; // Source (relative to destination)
  62. UCHAR cChannels;
  63. UCHAR cConnections; // Redundant
  64. UCHAR cControls; // NB - redundant - could be deduced
  65. // from the control set.
  66. ULONG dwUser; // settable?
  67. SHORT ShortNameStringId;
  68. SHORT LongNameStringId;
  69. ULONG dwComponentType; // SRC and DEST types
  70. //
  71. // Target information
  72. //
  73. USHORT Type;
  74. USHORT wPid; // No USHORT !!!
  75. SHORT PnameStringId; // Target product name
  76. } MIXER_DD_LINE_CONFIGURATION_DATA, *PMIXER_DD_LINE_CONFIGURATION_DATA;
  77. //
  78. // Control structure (NB Control ID is implicit from location in array)
  79. //
  80. typedef struct {
  81. ULONG dwControlType;
  82. ULONG fdwControl;
  83. UCHAR LineID;
  84. UCHAR cMultipleItems;
  85. SHORT ShortNameStringId;
  86. SHORT LongNameStringId;
  87. union
  88. {
  89. struct
  90. {
  91. LONG lMinimum; // signed minimum for this control
  92. LONG lMaximum; // signed maximum for this control
  93. };
  94. struct
  95. {
  96. ULONG dwMinimum; // unsigned minimum for this control
  97. ULONG dwMaximum; // unsigned maximum for this control
  98. };
  99. ULONG dwReserved[6];
  100. } Bounds;
  101. union
  102. {
  103. ULONG cSteps; // # of steps between min & max
  104. ULONG cbCustomData; // size in bytes of custom data
  105. ULONG dwReserved[6]; // !!! needed? we have cbStruct....
  106. } Metrics;
  107. ULONG TextDataOffset; // Offset to strings if any (or 0)
  108. // Each string is indexed by a string id.
  109. } MIXER_DD_CONTROL_CONFIGURATION_DATA, *PMIXER_DD_CONTROL_CONFIGURATION_DATA;
  110. typedef struct {
  111. ULONG dwParam1;
  112. ULONG dwParam2;
  113. SHORT SubControlTextStringId;
  114. USHORT ControlId; // Debug cross reference.
  115. } MIXER_DD_CONTROL_LISTTEXT, *PMIXER_DD_CONTROL_LISTTEXT;
  116. //
  117. // Capabilities data (using string id)
  118. //
  119. typedef struct {
  120. USHORT wMid; // manufacturer id
  121. USHORT wPid; // product id
  122. MMVERSION vDriverVersion; // version of the driver
  123. ULONG PnameStringId; // product name
  124. ULONG fdwSupport; // misc. support bits
  125. ULONG cDestinations; // count of destinations
  126. } MIXER_DD_CAPS;
  127. //
  128. // The data dumped into the registry.
  129. // The two counts are followed immediately by the appropriate number of
  130. //
  131. // MIXER_DD_LINE_CONFIGURATION_DATA and
  132. //
  133. // MIXER_DD_CONTROL_CONFIGURATION_DATA structures
  134. //
  135. // Next is the set of
  136. //
  137. // MIXER_DD_CONTROL_LISTTEXT structures ordered by control id.
  138. //
  139. // The MIXER_DD_LINE_CONFIGURATION_DATA structures must be ordered
  140. // dest lines first (ie the destination lines have the lowest ids).
  141. // The source lines must be ordered so that their destination lines
  142. // either increase and stay the same - ie the sources for the first
  143. // destination are first etc etc.
  144. //
  145. typedef struct {
  146. ULONG cbSize; // Total size including this field
  147. MIXER_DD_CAPS DeviceCaps; // Mixer device capabilities
  148. ULONG NumberOfLines;
  149. ULONG NumberOfControls;
  150. } MIXER_DD_CONFIGURATION_DATA, *PMIXER_DD_CONFIGURATION_DATA;
  151. //
  152. //
  153. // IOCTL_MIX_REQUEST_NOTIFY - use same data for input and output
  154. // This request will continue to be completed until either
  155. // SetCurrentLogicalTime is set or
  156. //
  157. // CurrentLogicalTime = Logical time of last change to mixer
  158. // controls or lines.
  159. //
  160. // It will next be completed either when the device is closed or the
  161. // next change is made to a control or line.
  162. //
  163. typedef struct {
  164. LARGE_INTEGER CurrentLogicalTime; // Used by driver
  165. BOOLEAN Initialized; // Set to 0 on first use
  166. USHORT Message; // What sort of thing changed?
  167. USHORT Id; // Id of thing that changed
  168. } MIXER_DD_REQUEST_NOTIFY, *PMIXER_DD_REQUEST_NOTIFY;
  169. //
  170. // Data returned by IOCTL_MIX_GET_CAPABILITIES is MIXCAPSW structure
  171. // defined in mmsystem.h
  172. //
  173. #ifdef __cplusplus
  174. }
  175. #endif
  176. #endif // _NTDDMIX_