Leaked source code of windows server 2003
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.

182 lines
4.3 KiB

  1. /* MIDI.H
  2. **
  3. ** Copyright (C) Microsoft, 1990, All Rights Reserved.
  4. **
  5. **
  6. ** Multimedia Control Panel MIDI Applet.
  7. **
  8. ** Display a list of all installed MIDI devices, allow user to configure
  9. ** existing or install new ones.
  10. **
  11. */
  12. //---------------------------------------------------------------------------
  13. #ifndef RC_INVOKED
  14. //---------------------------------------------------------------------------
  15. #ifndef MIDI_DPF
  16. #define MIDI_DPF AuxDebugEx
  17. #endif
  18. void PASCAL UpdateListBox(HWND hDlg);
  19. #define MAX_ALIAS 80
  20. #define NUM_CHANNEL 16
  21. #define NUM_TABSTOPS 1
  22. #define BITONE 1
  23. // Common states
  24. #define CHANGE_NONE 0
  25. // Instrument states
  26. #define CHANGE_ACTIVE 1
  27. #define CHANGE_CHANNEL 2
  28. // Driver states
  29. #define CHANGE_REMOVE 4
  30. #define CHANGE_ADD 8
  31. #define IS_INSTRUMENT(hwnd, i) (!((LPINSTRUMENT)ListBox_GetItemData(hwnd, i))->fDevice)
  32. typedef struct tag_Driver FAR * LPDRIVER;
  33. #ifndef NUMELMS
  34. #define NUMELMS(aa) (sizeof(aa)/sizeof((aa)[0]))
  35. #endif
  36. #define SetDlgData(h,lp) SetWindowLongPtr (h, DWLP_USER, (LONG_PTR)lp)
  37. #define GetDlgData(h) (LPVOID)GetWindowLongPtr (h, DWLP_USER)
  38. // lParam of PROPSHEETPAGE points to a struct like this.
  39. // it is freed in ReleasePropSheet() function.
  40. //
  41. typedef struct _midi_ps_args {
  42. LPFNMMEXTPROPSHEETCALLBACK lpfnMMExtPSCallback;
  43. LPARAM lParam;
  44. TCHAR szTitle[1];
  45. } MPSARGS, * PMPSARGS;
  46. // info for internal & external midi instruments
  47. //
  48. typedef struct _instrum * PINSTRUM;
  49. typedef struct _instrum {
  50. PINSTRUM piParent;
  51. BOOL bExternal;
  52. BOOL bActive;
  53. BOOL fGSSynth;
  54. UINT uID;
  55. TCHAR szKey[MAX_ALIAS];
  56. TCHAR szFriendly[MAX_ALIAS];
  57. } INSTRUM;
  58. // the the loaded array of all instruments, used to refresh
  59. // lists of all instruments and the treeview's of instruments
  60. // and how they are connected
  61. //
  62. typedef struct _midi_instrums {
  63. HKEY hkMidi;
  64. UINT nInstr;
  65. BOOL bHasExternal;
  66. PINSTRUM api[128];
  67. } MCMIDI, * PMCMIDI;
  68. //------------------ function prototypes ------------------------------------
  69. // midi.c
  70. //
  71. INT_PTR CALLBACK MidiCplDlgProc (
  72. HWND hWnd,
  73. UINT uMsgId,
  74. WPARAM wParam,
  75. LPARAM lParam);
  76. LONG WINAPI GetAlias (
  77. HKEY hKey,
  78. LPTSTR szSub,
  79. LPTSTR pszAlias,
  80. DWORD cbAlias,
  81. BOOL *pbExtern,
  82. BOOL *pbActive);
  83. void WINAPI LoadInstruments (
  84. PMCMIDI pmcm,
  85. BOOL bDriverAsAlias);
  86. void WINAPI FreeInstruments (
  87. PMCMIDI pmcm);
  88. PINSTRUM WINAPI FindInstrument (
  89. PMCMIDI pmcm,
  90. LPTSTR pszFriendly);
  91. void WINAPI KickMapper (
  92. HWND hWnd);
  93. // iface.c
  94. //
  95. BOOL WINAPI InitIface (
  96. HINSTANCE hInst,
  97. DWORD dwReason,
  98. LPVOID lpReserved);
  99. // class.c
  100. //
  101. INT_PTR CALLBACK MidiClassDlgProc (
  102. HWND hWnd,
  103. UINT uMsgId,
  104. WPARAM wParam,
  105. LPARAM lParam);
  106. INT_PTR CALLBACK MidiInstrumentDlgProc (
  107. HWND hWnd,
  108. UINT uMsgId,
  109. WPARAM wParam,
  110. LPARAM lParam);
  111. INT_PTR MidiInstrumentsWizard (
  112. HWND hWnd,
  113. PMCMIDI pmcm, // optional
  114. LPTSTR pszCmd);
  115. //void LoadInstrumentsIntoTree (
  116. // HWND hWnd,
  117. // UINT uId,
  118. // LPTSTR pszSelect,
  119. // HKEY * phkMidi);
  120. BOOL WINAPI RemoveInstrumentByKeyName (
  121. LPCTSTR pszKey);
  122. // containing struct for what would otherwise be global variables
  123. // only one instance of this structure is used. (declared in main.c)
  124. //
  125. struct _globalstate {
  126. int cRef;
  127. BOOL fLoadedRegInfo;
  128. TCHAR szPlayCmdLn[128];
  129. TCHAR szOpenCmdLn[128];
  130. TCHAR szNewCmdLn[128];
  131. HWND hWndDeviceList;
  132. HWND hWndInstrList;
  133. //HWND hWndMainList;
  134. BOOL fChangeInput;
  135. BOOL fChangeOutput;
  136. BOOL fInputPort;
  137. DWORD dwReconfigFlags;
  138. WORD wHelpMessage;
  139. WORD wFill;
  140. UINT nDrivers;
  141. UINT nMaxDrivers;
  142. //DRIVER aDrivers[16];
  143. };
  144. extern struct _globalstate gs;
  145. #endif // ifndef RC_INVOKED