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.

288 lines
11 KiB

  1. /*
  2. * MIDI.H
  3. *
  4. * Copyright (C) 1990 Microsoft Corporation.
  5. *
  6. * Include file for MIDI control panel.
  7. */
  8. #include <multimed.h>
  9. #define SZCODE char _based(_segname("_CODE"))
  10. /* we let an intern code the mapper */
  11. #define STUPID
  12. #if DBG
  13. #if defined(WIN16)
  14. extern VOID FAR PASCAL OutputDebugStr(LPSTR szString); // in COMM.ASM
  15. #endif //WIN16
  16. #define MDOUT(x) (OutputDebugStr("MIDI.CPL: "), OutputDebugStr(x), OutputDebugStr("\r\n"), 0)
  17. #define MDOUTX(x) (OutputDebugStr(x), 0)
  18. #else
  19. #define MDOUT(x) 0
  20. #define MDOUTX(x) 0
  21. #endif
  22. /********************************************************
  23. * *
  24. * D A T A T Y P E S *
  25. * *
  26. ********************************************************/
  27. typedef struct tag_midiboxdata {
  28. DLGPROC lpfnBox; // Dialog box function.
  29. int idBox; // Resource ID of dialog box.
  30. } MBDATA, FAR *LPMBDATA;
  31. /********************************************************
  32. * *
  33. * P R O T O T Y P E S *
  34. * *
  35. ********************************************************/
  36. BOOL FAR PASCAL _loadds EnumFunc (LPSTR, LPSTR, UINT, HWND, LPSTR);
  37. BOOL FAR PASCAL InvalidPortMsgBox (HWND);
  38. INT_PTR FAR PASCAL _loadds KeyBox (HWND, UINT, WPARAM, LPARAM);
  39. VOID FAR PASCAL Modify (BOOL);
  40. INT_PTR FAR PASCAL _loadds PatchBox (HWND, UINT, WPARAM, LPARAM);
  41. INT_PTR FAR PASCAL _loadds PropBox (HWND, UINT, WPARAM, LPARAM);
  42. int FAR PASCAL QuerySave (VOID);
  43. INT_PTR FAR PASCAL _loadds SetupBox (HWND, UINT, WPARAM, LPARAM);
  44. #ifdef STUPID
  45. //int FAR PASCAL DosDelete(LPSTR);
  46. BOOL FAR PASCAL DupMapCfg(LPSTR,LPSTR);
  47. BOOL FAR PASCAL UpdateMapCfg(LPSTR,LPSTR);
  48. #define ISSPACE(x) ((x)==' '||(x)=='\t')
  49. int FAR PASCAL ComboLookup(HWND, LPSTR);
  50. #define MAXPATHLEN 157 // 144 + "\12345678.123"
  51. #endif
  52. #ifdef ALLOW_SIZING
  53. VOID FAR PASCAL SizeBox (VOID);
  54. VOID FAR PASCAL WriteBoxRect (VOID);
  55. #endif // ALLOW_SIZING
  56. /********************************************************
  57. * *
  58. * C O M M O N D E F I N I T I O N S *
  59. * *
  60. ********************************************************/
  61. #define VERTMARGIN 4 // dialog units
  62. #define HORZMARGIN 6
  63. #define SEL_SETUP 0 // rgSelect array indices
  64. #define SEL_PATCH 1
  65. #define SEL_KEY 2
  66. #define ID_MAINBOX 700 // dialog box id's
  67. #define ID_KEYBOX 701
  68. #define ID_PROPBOX 702
  69. #define DLG_SETUPEDIT 800
  70. #define DLG_PATCHEDIT 801
  71. #define DLG_KEYEDIT 802
  72. #define IDH_DLG_MIDI_NEW 803
  73. #define ID_MAINSETUPCOMBO 100 // main dialog box ctrl id's
  74. #define ID_MAINPATCHCOMBO 101
  75. #define ID_MAINKEYCOMBO 102
  76. #define ID_MAINCOMBO 103
  77. #define ID_MAINSETUP 104
  78. #define ID_MAINPATCH 105
  79. #define ID_MAINKEY 106
  80. #define ID_MAINDELETE 107
  81. #define ID_MAINEDIT 108
  82. #define ID_MAINNEW 109
  83. #define ID_MAINDESC 110
  84. #define ID_MAINNAME 111
  85. #define ID_MAINFIRSTRADIO ID_MAINSETUP
  86. #define ID_MAINLASTRADIO ID_MAINKEY
  87. #define ID_PROPNAME 100 // propbox ctrl id's
  88. #define ID_PROPDESC 101
  89. #define EN_ACTIVATE 0x1000 // custom messages
  90. #define CBN_ACTIVATE 0x1000
  91. #define WM_MY_INITDIALOG 0x1000
  92. #define WM_MY_ENDDIALOG 0x1001
  93. #define WM_MY_FREEDATA 0x1002
  94. /********************************************************
  95. * *
  96. * S E T U P D E F I N I T I O N S *
  97. * *
  98. ********************************************************/
  99. #define NUM_CHANNELS 16
  100. #define ID_SETUPGHOSTEDITFIRST 108 // ghost ctrl: first ctrl with tabstop
  101. #define ID_SETUPGHOSTEDITLAST 109 // ghost ctrl: last ctrl with tabstop
  102. #define ID_SETUPPORTLIST 110 // listbox for invalid port names
  103. #define ID_SETUPEDIT 111 // channel number edit control id
  104. #define ID_SETUPARROW 112 // channel number edit control id
  105. #define ID_SETUPPORTCOMBO 113 // port name combo box control id
  106. #define ID_SETUPPATCHCOMBO 114 // patch name combo box control id
  107. #define ID_SETUPDESTMNEM 115
  108. #define ID_SETUPPORTMNEM 116
  109. #define ID_SETUPPATCHMNEM 117
  110. #define ID_SETUPCHECK 118 // first 3-state btn (there are 16)
  111. // don't define anything after this //
  112. /********************************************************
  113. * *
  114. * P A T C H M A P D E F I N I T I O N S *
  115. * *
  116. ********************************************************/
  117. #define ID_PATCHGHOSTEDITFIRST 108 // ghost ctrl: first ctrl with tabstop
  118. #define ID_PATCHGHOSTEDITLAST 109 // ghost ctrl: last ctrl with tabstop
  119. #define ID_PATCHNUMARROW 110 // patch number arrow control id
  120. #define ID_PATCHNUMEDIT 111 // patch number edit control id
  121. #define ID_PATCHVOLARROW 112 // volume percent arrow control id
  122. #define ID_PATCHVOLEDIT 113 // volume percent edit control id
  123. #define ID_PATCHCOMBO 114 // keymap combo box control id
  124. #define ID_PATCHSCROLL 115 // scroll bar control id
  125. #define ID_PATCHBASED 116
  126. #define ID_PATCHDESTMNEM 117
  127. #define ID_PATCHVOLMNEM 118
  128. #define ID_PATCHKEYMNEM 119
  129. /********************************************************
  130. * *
  131. * K E Y M A P D E F I N I T I O N S *
  132. * *
  133. ********************************************************/
  134. #define ID_KEYGHOSTEDITFIRST 108 // ghost ctrl: first ctrl with tabstop
  135. #define ID_KEYGHOSTEDITLAST 109 // ghost ctrl: last ctrl with tabstop
  136. #define ID_KEYEDIT 110 // key number edit control id
  137. #define ID_KEYARROW 111 // key number arrow control id
  138. #define ID_KEYSCROLL 112 // scroll bar control id
  139. #define ID_KEYDESTMNEM 113
  140. /********************************************************
  141. * *
  142. * S T R I N G D E F I N I T I O N S *
  143. * *
  144. ********************************************************/
  145. #define IDS_MIDIMAPPER 500
  146. #define IDS_VANILLANAME 502
  147. #define IDS_VANILLADESC 503
  148. #define IDS_SETUPS 1
  149. #define IDS_PATCHES 2
  150. #define IDS_KEYS 3
  151. #define IDS_TITLE 102
  152. /* The first three of these are singular. The next three are plural.
  153. ** These values must retain their relative values.
  154. */
  155. #define IDS_SETUP 103
  156. #define IDS_PATCH 104
  157. #define IDS_KEY 105
  158. #define IDS_SETUPPLURAL 106
  159. #define IDS_PATCHPLURAL 107
  160. #define IDS_KEYPLURAL 108
  161. #define IDS_NEW 109
  162. #define IDS_SAVE 110
  163. #define IDS_DELETE 111
  164. #define IDS_CLOSE 112
  165. #define IDS_NONE 113
  166. #define IDS_ERROR 114
  167. #define IDS_MIDIMAPCFG 115
  168. #define IDS_HELPFILE IDS_CONTROL_HLP
  169. #define IDS_NOENTRIES 117
  170. #define IDS_CAPTION 118
  171. #define IDS_PORTNAME 120
  172. #define IDS_PATCHNAME 121
  173. #define IDS_SOURCE 122
  174. #define IDS_DEST 123
  175. #define IDS_CHANNEL 124
  176. #define IDS_ACTIVE 125
  177. #define IDS_CREATE_QUESTION 126
  178. #define IDS_NEW_QUESTION 127
  179. #define IDS_CHANGE_QUESTION 128
  180. #define IDS_SAVE_CHANGES 129
  181. #define IDS_RESERVED 130
  182. #define IDS_SOURCEKEY 131
  183. #define IDS_SOURCEKEYNAME 132
  184. #define IDS_PATCHNUMBER 133
  185. #define IDS_SOURCEPATCH 134
  186. #define IDS_SOURCEPATCHNAME 135
  187. #define IDS_INVALIDDESTINATION 136
  188. #define IDS_USERERROR 137
  189. #define IDS_SOURCEMNUMONIC 138
  190. #define IDS_SOURCECHANNEL 139
  191. //#define IDS_NOCHANGEINUSE 140
  192. //#define IDS_NOEDITINUSE 141
  193. #define IDS_NODELISCURRENT 142
  194. #define IDS_NODELISREFERENCED 143
  195. #define IDS_VERIFYDELETE 144
  196. #define IDS_INVALIDPORT 145
  197. #define IDS_DUPLICATE 146
  198. #define IDS_READONLYMODE 147
  199. #define IDS_ACTIVETITLE 148
  200. #define IDS_NEW_KEY 149
  201. #define IDS_NEW_SETUP 150
  202. #define IDS_NEW_PATCH 151
  203. #define IDS_PATCHMAP_BASE 152 // there can be 128 patches
  204. #define IDS_KEYMAP_BASE 300 // there can be 128 keys
  205. // This is coding just designed to make debugging harder.
  206. //
  207. // Errors are in the .rc file with names like IDS_MMAPERR_INVALIDSETUP
  208. // Grepping on that id to see where it's used gives zilch.
  209. // It's defined here as 1004. Grepping on 1004 gives zilch.
  210. //
  211. // Instead there's a new name like MMAPERR_INVALIDSETUP defined in midimap.h as 4.
  212. // (Grepping on 4 of course gives HUNDREDS of spurious hits)
  213. // and a routine in midi.c called VShow_Error which adds IDS_MMAPERR_BASE
  214. // (i.e. 1000) to the error code (4) and puts out the text for that number.
  215. // Really clever stuff heh?
  216. #define IDS_MMAPERR_BASE 1000 // With about a dozen of them.
  217. #define IDS_MMAPERR_SUCCESS 1000
  218. //#define IDS_MMAPERR_FILENOTFOUND 1001
  219. //#define IDS_MMAPERR_INVALIDFLAG 1002
  220. //#define IDS_MMAPERR_INVALIDPORT 1003
  221. #define IDS_MMAPERR_INVALIDSETUP 1004
  222. #define IDS_MMAPERR_INVALIDPATCH 1005
  223. #define IDS_MMAPERR_INVALIDKEY 1006
  224. #define IDS_MMAPERR_MEMORY 1007
  225. #define IDS_MMAPERR_READ 1008
  226. #define IDS_MMAPERR_WRITE 1009
  227. #define IDS_MMAPERR_OPEN 1010
  228. #define IDS_MMAPERR_OPEN_READONLY 1011
  229. #define IDS_MMAPERR_CREATE 1012
  230. //#define IDS_MMAPERR_UNDEFINED 1013
  231. #define IDS_MMAPERR_FULL 1014
  232. #define IDS_FCERR_ERROR 1015
  233. #define IDS_FCERR_WARN 1016
  234. #define IDS_FCERR_SUCCESS 1017
  235. #define IDS_FCERR_NOSRC 1018
  236. #define IDS_FCERR_NODEST 1019
  237. #define IDS_FCERR_DISKFULL 1020
  238. #define IDS_FCERR_LOMEM 1021
  239. #define IDS_FCERR_WRITE 1022
  240. #define IDS_FCERR_DISK 1023
  241. #define IDS_FCERR_READONLY 1024
  242. VOID FAR PASCAL VShowError(
  243. HWND hwnd,
  244. MMAPERR mmaperr);
  245. extern UINT NEAR uHelpMessage;
  246. extern DWORD NEAR dwContext;