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 / display.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-05  |  2.3 KB  |  66 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.  *  display.h
  14.  */
  15.  
  16.  
  17. /* MIDI status byte definitions
  18.  */
  19. #define NOTEON          0x90
  20. #define NOTEOFF         0x80
  21. #define KEYAFTERTOUCH   0xa0
  22. #define CONTROLCHANGE   0xb0
  23. #define PROGRAMCHANGE   0xc0
  24. #define CHANAFTERTOUCH  0xd0
  25. #define PITCHBEND       0xe0
  26. #define SYSTEMMESSAGE   0xf0
  27. #define BEGINSYSEX      0xf0
  28. #define MTCQUARTERFRAME 0xf1
  29. #define SONGPOSPTR      0xf2
  30. #define SONGSELECT      0xf3
  31.  
  32. /* Format strings used by GetDisplayText()
  33.  */
  34. #define FORMAT3  " %08lX  %02X     %02X    %02X    %2d   %c   %-21s "
  35. #define FORMAT2  " %08lX  %02X     %02X    --    %2d   %c   %-21s "
  36. #define FORMAT3X " %08lX  %02X     %02X    %02X    --   %c   %-21s "
  37. #define FORMAT2X " %08lX  %02X     %02X    --    --   %c   %-21s "
  38. #define FORMAT1X " %08lX  %02X     --    --    --   %c   %-21s "
  39.  
  40.  
  41. /* Data structure to manage a display buffer.
  42.  */
  43. typedef struct displayBuffer_tag
  44. {
  45.     HANDLE  hSelf;          /* handle to this structure */
  46.     HANDLE  hBuffer;        /* buffer handle */
  47.     WORD    wError;         /* error flags */
  48.     DWORD   dwSize;         /* buffer size (in EVENTS) */
  49.     DWORD   dwCount;        /* byte count (in EVENTS) */
  50.     LPEVENT lpStart;        /* ptr to start of buffer */
  51.     LPEVENT lpEnd;          /* ptr to end of buffer (last byte + 1) */
  52.     LPEVENT lpHead;         /* ptr to head (next location to fill) */
  53.     LPEVENT lpTail;         /* ptr to tail (next location to empty) */
  54. } DISPLAYBUFFER;
  55. typedef DISPLAYBUFFER FAR *LPDISPLAYBUFFER;
  56.  
  57.  
  58. /* Function prototypes
  59.  */
  60. int GetDisplayText(NPSTR npText, LPEVENT lpEvent);
  61. void AddDisplayEvent(LPDISPLAYBUFFER lpBuf, LPEVENT lpEvent);
  62. void GetDisplayEvent(LPDISPLAYBUFFER lpBuf, LPEVENT lpEvent, DWORD wNum);
  63. LPDISPLAYBUFFER AllocDisplayBuffer(DWORD dwSize);
  64. void FreeDisplayBuffer(LPDISPLAYBUFFER lpBuf);
  65. void ResetDisplayBuffer(LPDISPLAYBUFFER lpBuf);
  66.