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.

138 lines
4.7 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. ntddwave.h
  5. Abstract:
  6. This include file defines all constants and types for
  7. accessing an NT wave device.
  8. Author:
  9. NigelThompson (NigelT) 17-May-91
  10. Revision History:
  11. --*/
  12. #ifndef _NTDDWAVE_
  13. #define _NTDDWAVE_
  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. //
  22. // Device Name - this string is the name of the device. It is the name
  23. // that when added to the name of the root of the device tree and with
  24. // the device number appended, gives the name of the device required for
  25. // a call to NtOpenFile.
  26. // So for example, if the root is \Device and the Device type is
  27. // WaveIn and the device number is 2, the full name is \Device\WaveIn2
  28. //
  29. #define DD_WAVE_IN_DEVICE_NAME "\\Device\\WaveIn"
  30. #define DD_WAVE_IN_DEVICE_NAME_U L"\\Device\\WaveIn"
  31. #define DD_WAVE_OUT_DEVICE_NAME "\\Device\\WaveOut"
  32. #define DD_WAVE_OUT_DEVICE_NAME_U L"\\Device\\WaveOut"
  33. //
  34. // WAVE device driver IOCTL set
  35. //
  36. #define IOCTL_WAVE_QUERY_FORMAT CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
  37. #define IOCTL_WAVE_SET_FORMAT CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  38. #define IOCTL_WAVE_GET_CAPABILITIES CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
  39. #define IOCTL_WAVE_SET_STATE CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  40. #define IOCTL_WAVE_GET_STATE CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0005, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  41. #define IOCTL_WAVE_GET_POSITION CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0006, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  42. #define IOCTL_WAVE_SET_VOLUME CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS)
  43. #define IOCTL_WAVE_GET_VOLUME CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0008, METHOD_BUFFERED, FILE_READ_ACCESS)
  44. #define IOCTL_WAVE_SET_PITCH CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0009, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  45. #define IOCTL_WAVE_GET_PITCH CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000A, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  46. #define IOCTL_WAVE_SET_PLAYBACK_RATE CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000B, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  47. #define IOCTL_WAVE_GET_PLAYBACK_RATE CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000C, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  48. #define IOCTL_WAVE_PLAY CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000D, METHOD_IN_DIRECT, FILE_WRITE_ACCESS)
  49. #define IOCTL_WAVE_RECORD CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000E, METHOD_OUT_DIRECT, FILE_WRITE_ACCESS)
  50. #define IOCTL_WAVE_BREAK_LOOP CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000F, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  51. #define IOCTL_WAVE_SET_LOW_PRIORITY CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0010, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  52. //
  53. // IOCTLs used in the debug build only
  54. //
  55. #if DBG
  56. #define IOCTL_WAVE_SET_DEBUG_LEVEL CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0040, METHOD_BUFFERED, FILE_READ_ACCESS)
  57. #endif // DBG
  58. //
  59. // Wave position structure
  60. //
  61. typedef struct _WAVE_DD_POSITION {
  62. ULONG SampleCount; // Number of sound samples
  63. ULONG ByteCount; // Number of bytes (in SampleCount samples)
  64. } WAVE_DD_POSITION, *PWAVE_DD_POSITION;
  65. //
  66. // Wave volume structure
  67. //
  68. typedef struct _WAVE_DD_VOLUME {
  69. ULONG Left;
  70. ULONG Right;
  71. } WAVE_DD_VOLUME, *PWAVE_DD_VOLUME;
  72. #define WAVE_DD_MAX_VOLUME 0xFFFFFFFF // Maximum volume
  73. //
  74. // Wave pitch shift structure
  75. //
  76. typedef struct _WAVE_DD_PITCH {
  77. ULONG Pitch; // fixed point value 1.0 = 0x10000
  78. } WAVE_DD_PITCH, *PWAVE_DD_PITCH;
  79. //
  80. // Wave playback rate structure
  81. //
  82. typedef struct _WAVE_DD_PLAYBACK_RATE {
  83. ULONG Rate; // fixed point value 1.0 = 0x10000
  84. } WAVE_DD_PLAYBACK_RATE, *PWAVE_DD_PLAYBACK_RATE;
  85. //
  86. // State flags used to set the state of a driver
  87. //
  88. #define WAVE_DD_STOP 0x0001
  89. #define WAVE_DD_PLAY 0x0002 // output devices only
  90. #define WAVE_DD_RECORD 0x0003 // input devices only
  91. #define WAVE_DD_RESET 0x0004
  92. //
  93. // States returned by the get state ioctl
  94. //
  95. #define WAVE_DD_IDLE 0x0000
  96. #define WAVE_DD_STOPPED 0x0001 // stopped
  97. #define WAVE_DD_PLAYING 0x0002 // output devices only
  98. #define WAVE_DD_RECORDING 0x0003 // input devices only
  99. #ifdef __cplusplus
  100. }
  101. #endif
  102. #endif // _NTDDWAVE_