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.

148 lines
4.0 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. ntddmidi.h
  5. Abstract:
  6. This include file defines all constants and types for
  7. accessing an NT wave device.
  8. Author:
  9. Robin Speed (RobinSp) 12-Dec-91
  10. Revision History:
  11. --*/
  12. #ifndef _NTDDMIDI_
  13. #define _NTDDMIDI_
  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. // MidiIn and the device number is 2, the full name is \Device\MidiIn2
  28. //
  29. #define DD_MIDI_IN_DEVICE_NAME "\\Device\\MidiIn"
  30. #define DD_MIDI_IN_DEVICE_NAME_U L"\\Device\\MidiIn"
  31. #define DD_MIDI_OUT_DEVICE_NAME "\\Device\\MidiOut"
  32. #define DD_MIDI_OUT_DEVICE_NAME_U L"\\Device\\MidiOut"
  33. //
  34. // MIDI device driver IOCTL set
  35. //
  36. #define IOCTL_MIDI_GET_CAPABILITIES CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
  37. #define IOCTL_MIDI_SET_STATE CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  38. #define IOCTL_MIDI_GET_STATE CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  39. #define IOCTL_MIDI_SET_VOLUME CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS)
  40. #define IOCTL_MIDI_GET_VOLUME CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS)
  41. #define IOCTL_MIDI_PLAY CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0006, METHOD_NEITHER, FILE_WRITE_ACCESS)
  42. #define IOCTL_MIDI_RECORD CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0007, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  43. #define IOCTL_MIDI_CACHE_PATCHES CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0008, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  44. #define IOCTL_MIDI_CACHE_DRUM_PATCHES CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0009, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  45. //
  46. // IOCTL used in the debug build only
  47. //
  48. #if DBG
  49. #define IOCTL_MIDI_SET_DEBUG_LEVEL CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0040, METHOD_BUFFERED, FILE_READ_ACCESS)
  50. #endif // DBG
  51. //
  52. // Product Ids - see winmm.h
  53. //
  54. //
  55. // Midi input output buffer format
  56. //
  57. typedef struct {
  58. LARGE_INTEGER Time; // Time when data received
  59. // (in units of 100ns from when
  60. // midi input was started)
  61. UCHAR Data[sizeof(ULONG)]; // Data (at least 4 byts for
  62. // alignment).
  63. } MIDI_DD_INPUT_DATA, *PMIDI_DD_INPUT_DATA;
  64. //
  65. // Midi volume structure
  66. //
  67. typedef struct _MIDI_DD_VOLUME {
  68. ULONG Left;
  69. ULONG Right;
  70. } MIDI_DD_VOLUME, *PMIDI_DD_VOLUME;
  71. //
  72. // Patch array structure
  73. //
  74. //
  75. // Midi cache patches structures
  76. //
  77. typedef struct _MIDI_DD_CACHE_PATCHES {
  78. ULONG Bank;
  79. ULONG Flags;
  80. USHORT Patches[128];
  81. } MIDI_DD_CACHE_PATCHES, *PMIDI_DD_CACHE_PATCHES;
  82. //
  83. // Midi cache drum patches structures
  84. //
  85. typedef struct _MIDI_DD_CACHE_DRUM_PATCHES {
  86. ULONG Patch;
  87. ULONG Flags;
  88. USHORT DrumPatches[128];
  89. } MIDI_DD_CACHE_DRUM_PATCHES, *PMIDI_DD_CACHE_DRUM_PATCHES;
  90. //
  91. // State flags used to set the state of a driver
  92. //
  93. #define MIDI_DD_STOP 0x0001
  94. #define MIDI_DD_PLAY 0x0002 // output devices only
  95. #define MIDI_DD_RECORD 0x0003 // input devices only
  96. #define MIDI_DD_RESET 0x0004
  97. //
  98. // States returned by the get state ioctl
  99. //
  100. #define MIDI_DD_IDLE 0x0000
  101. #define MIDI_DD_STOPPED 0x0001 // stopped
  102. #define MIDI_DD_PLAYING 0x0002 // output devices only
  103. #define MIDI_DD_RECORDING 0x0003 // input devices only
  104. #ifdef __cplusplus
  105. }
  106. #endif
  107. #endif // _NTDDMIDI_