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.

156 lines
3.6 KiB

  1. /****************************************************************************
  2. *
  3. * driver.h
  4. *
  5. * Copyright (c) 1991-1994 Microsoft Corporation
  6. *
  7. ***************************************************************************/
  8. #include <drvlib.h>
  9. #include <synth.h>
  10. #define SR_ALERT_NORESOURCE 11
  11. #define DATA_FMPATCHES 1234
  12. #ifndef RC_INVOKED
  13. #define RT_BINARY MAKEINTRESOURCE( 256 )
  14. #else
  15. #define RT_BINARY 256
  16. #endif
  17. //
  18. // Porting stuff
  19. //
  20. #define BCODE
  21. #define fEnabled TRUE
  22. #define AsULMUL(a, b) ((DWORD)((DWORD)(a) * (DWORD)(b)))
  23. #define AsLSHL(a, b) ((DWORD)((DWORD)(a) << (DWORD)(b)))
  24. #define AsULSHR(a, b) ((DWORD)((DWORD)(a) >> (DWORD)(b)))
  25. #define AsMemCopy CopyMemory
  26. extern HANDLE MidiDeviceHandle;
  27. extern SYNTH_DATA DeviceData[];
  28. extern int MidiPosition;
  29. extern VOID MidiFlush(VOID);
  30. extern VOID MidiCloseDevice(HANDLE DeviceHandle);
  31. extern MMRESULT MidiOpenDevice(LPHANDLE lpHandle, BOOL Write);
  32. extern MMRESULT MidiSetVolume(DWORD Left, DWORD Right);
  33. extern VOID MidiCheckVolume(VOID);
  34. extern MMRESULT MidiGetVolume(LPDWORD lpVolume);
  35. #define SYNTH_DATA_SIZE 80
  36. extern VOID FAR PASCAL MidiSendFM (DWORD wAddress, BYTE bValue);
  37. extern VOID FAR PASCAL MidiNewVolume (WORD wLeft, WORD wRight);
  38. extern WORD FAR PASCAL MidiInit (VOID);
  39. extern BYTE gbVelocityAtten[32];
  40. //
  41. // End of porting stuff
  42. //
  43. /*
  44. * midi device type - determined by kernel driver
  45. */
  46. UINT gMidiType;
  47. /*
  48. * values for gMidiType - set in MidiOpenDevice
  49. */
  50. #define TYPE_ADLIB 1
  51. #define TYPE_OPL3 2
  52. /*
  53. * String IDs
  54. * NOTE - these are shared with the drivers and should be made COMMON
  55. * definitions
  56. */
  57. #define SR_ALERT 1
  58. #define SR_ALERT_NOPATCH 10
  59. #define SYSEX_ERROR 0xFF // internal error code for sysexes on input
  60. #define STRINGLEN (100)
  61. /* volume defines */
  62. #define VOL_MIDI (0)
  63. #define VOL_NUMVOL (1)
  64. #define VOL_LEFT (0)
  65. #define VOL_RIGHT (1)
  66. /* MIDI defines */
  67. #define NUMCHANNELS (16)
  68. #define NUMPATCHES (256)
  69. #define DRUMCHANNEL (9) /* midi channel 10 */
  70. /****************************************************************************
  71. typedefs
  72. ***************************************************************************/
  73. // per allocation structure for midi
  74. typedef struct portalloc_tag {
  75. DWORD_PTR dwCallback; // client's callback
  76. DWORD_PTR dwInstance; // client's instance data
  77. HMIDIOUT hMidi; // handle for stream
  78. DWORD dwFlags; // allocation flags
  79. }PORTALLOC, NEAR *NPPORTALLOC;
  80. /****************************************************************************
  81. strings
  82. ***************************************************************************/
  83. #define INI_STR_PATCHLIB TEXT("Patches")
  84. #define INI_SOUND TEXT("synth.ini")
  85. #define INI_DRIVER TEXT("Driver")
  86. /****************************************************************************
  87. globals
  88. ***************************************************************************/
  89. /* midi.c */
  90. extern BYTE gbMidiInUse; /* if MIDI is in use */
  91. extern HMODULE ghModule; // our module handle
  92. /***************************************************************************
  93. prototypes
  94. ***************************************************************************/
  95. /* midi.c */
  96. VOID NEAR PASCAL MidiMessage (DWORD dwData);
  97. DWORD APIENTRY modSynthMessage(UINT id,
  98. UINT msg, DWORD_PTR dwUser, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
  99. UINT MidiOpen (VOID);
  100. VOID MidiClose (VOID);
  101. void MidiReset(void);
  102.