home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / graphics / audio / midimon / midimon.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-05  |  3.4 KB  |  120 lines

  1. /**************************************************************************
  2.  *
  3.  *  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4.  *  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5.  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6.  *  PURPOSE.
  7.  *
  8.  *  Copyright (C) 1993 - 1997  Microsoft Corporation.  All Rights Reserved.
  9.  * 
  10.  **************************************************************************/
  11.  
  12. /*
  13.  *    midimon.h
  14.  */
  15.  
  16.  
  17. /* Compile-time application metrics
  18.  */
  19. #define MAX_NUM_DEVICES         8       // max # of MIDI input devices
  20. #define INPUT_BUFFER_SIZE       200     // size of input buffer in events
  21. #define DISPLAY_BUFFER_SIZE     1000    // size of display buffer in events
  22.  
  23. /* Menu IDs 
  24.  */
  25. #define IDM_SAVE                101
  26. #define IDM_EXIT                102
  27. #define IDM_SETBUFSIZE          201
  28. #define IDM_SETDISPLAY          202
  29. #define IDM_SAVESETUP           203
  30. #define IDM_SENDTOMAPPER        204
  31. #define IDM_FILTCHAN0           300
  32. #define IDM_FILTCHAN1           301
  33. #define IDM_FILTCHAN2           302
  34. #define IDM_FILTCHAN3           303
  35. #define IDM_FILTCHAN4           304
  36. #define IDM_FILTCHAN5           305
  37. #define IDM_FILTCHAN6           306
  38. #define IDM_FILTCHAN7           307
  39. #define IDM_FILTCHAN8           308
  40. #define IDM_FILTCHAN9           309
  41. #define IDM_FILTCHAN10          310
  42. #define IDM_FILTCHAN11          311
  43. #define IDM_FILTCHAN12          312
  44. #define IDM_FILTCHAN13          313
  45. #define IDM_FILTCHAN14          314
  46. #define IDM_FILTCHAN15          315
  47. #define IDM_NOTEOFF             316
  48. #define IDM_NOTEON              317
  49. #define IDM_POLYAFTERTOUCH      318
  50. #define IDM_CONTROLCHANGE       319
  51. #define IDM_PROGRAMCHANGE       320
  52. #define IDM_CHANNELAFTERTOUCH   321
  53. #define IDM_PITCHBEND           322
  54. #define IDM_CHANNELMODE         323
  55. #define IDM_SYSTEMEXCLUSIVE     324
  56. #define IDM_SYSTEMCOMMON        325
  57. #define IDM_SYSTEMREALTIME      326
  58. #define IDM_ACTIVESENSE         327
  59. #define IDM_STARTSTOP           400
  60. #define IDM_CLEAR               500
  61. #define IDM_ABOUT               600
  62.  
  63. /* String resource IDs 
  64.  */
  65. #define IDS_APPNAME             1
  66.  
  67. #define IDS_LABEL        16
  68. #define IDS_UNKNOWN_EVENT    17
  69. #define IDS_NOMIDIIN        18
  70. #define IDS_NOMEM_IBUF        19
  71. #define IDS_NOMEM_DBUF        20
  72. #define IDS_NOMEM        21
  73. #define IDS_START        22
  74. #define IDS_STOP        23
  75. #define IDS_WRITEERR        24
  76.  
  77. /* Custom messages sent by low-level callback to application 
  78.  */
  79. #define MM_MIDIINPUT    WM_USER + 0
  80.  
  81.  
  82. /* The label for the display window.
  83.  */
  84. // now defined as IDS_LABEL in midimon.rc stringtable
  85.  
  86.  
  87. /* Structure for translating virtual key messages to scroll messages.
  88.  */
  89. typedef struct keyToScroll_tag
  90. {
  91.      WORD wVirtKey;
  92.      int  iMessage;
  93.      WORD wRequest;
  94. } KEYTOSCROLL;
  95.  
  96. /* Structure to represent a single MIDI event.
  97.  */
  98.  
  99. #define EVNT_F_ERROR    0x00000001L
  100.  
  101. typedef struct event_tag
  102. {
  103.     DWORD fdwEvent;
  104.     DWORD dwDevice;
  105.     DWORD timestamp;
  106.     DWORD data;
  107. } EVENT;
  108. typedef EVENT FAR *LPEVENT;
  109.  
  110.  
  111. /* Function prototypes 
  112.  */
  113. LRESULT FAR PASCAL WndProc(HWND, UINT, WPARAM , LPARAM);
  114. VOID CommandMsg(HWND hWnd, WPARAM wParam, LPARAM lParam);
  115. void DoMenuItemCheck(HWND hWnd, WORD menuItem, BOOL newState);
  116. void SetupCustomChecks(HANDLE hInstance, HWND hWnd);
  117. BOOL InitFirstInstance(HANDLE);
  118. int Error(LPSTR msg);
  119.  
  120. LPTSTR GetStringRes (int id);