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.

169 lines
6.4 KiB

  1. /******************************************************************************
  2. Copyright (c) 1985-1998 Microsoft Corporation
  3. Title: mciseq.h - Multimedia Systems Media Control Interface streaming
  4. MIDI file data internal header file.
  5. Version: 1.00
  6. Date: 27-Apr-1990
  7. Author: Greg Simons
  8. ------------------------------------------------------------------------------
  9. Change log:
  10. DATE REV DESCRIPTION
  11. ----------- ----- -----------------------------------------------------------
  12. 27-APR-1990 GREGSI Original
  13. *****************************************************************************/
  14. //#define SEQDEBUG 1
  15. #define MSEQ_PRODUCTNAME 1
  16. #define IDS_MIDICAPTION 2
  17. #define IDS_MIDITAB 3
  18. #define IDDLGWARN 100
  19. #define IDCHECK 102
  20. /*************** Stream Stuff ***************************************/
  21. #define NUMHDRS 2
  22. #define BUFFSIZE 512
  23. #ifndef cchLENGTH
  24. #define cchLENGTH(_sz) (sizeof(_sz)/sizeof(_sz[0]))
  25. #endif
  26. typedef struct tag_HMSF
  27. {
  28. BYTE hours;
  29. BYTE minutes;
  30. BYTE seconds;
  31. BYTE frames;
  32. } HMSF;
  33. typedef struct
  34. {
  35. /* All stream data for a track of an open sequence goes here */
  36. DWORD beginning; // these are byte numbers within the open file
  37. DWORD end;
  38. DWORD current; // byte # to start reading from for next chunk
  39. DWORD bufferNum; // current buffer number
  40. LPMIDISEQHDR fileHeaders[NUMHDRS]; // pointers to midi file track data headers
  41. } TrackStreamType;
  42. typedef struct
  43. {
  44. /* All stream data for an open sequence goes here */
  45. WCHAR szFilename[128]; // file name here for stream thread
  46. HMIDISEQ hSeq; // handle to the sequence
  47. HMMIO hmmio; // MMIO handle to midi file or RMID file
  48. LPMMIOPROC pIOProc; // Optional MMIO proc
  49. HMIDIOUT hmidiOut; // handle to dest. midi port
  50. UINT wPortNum; // midi port number
  51. DWORD dwFileLength;
  52. ListHandle trackStreamListHandle;
  53. BOOL streaming; // to flag streaming process to exit or not
  54. DWORD streamTaskHandle; // handle to streaming task
  55. HANDLE streamThreadHandle; // OS handle to stream thread
  56. HWND hNotifyCB; // mci client's notify cb--NULL if none
  57. UINT wNotifyMsg; // mci message (command) that async notify's for
  58. DWORD dwNotifyOldTo; // x for last "play foo to x notify"
  59. // (critical for abort/supersede)
  60. MCIDEVICEID wDeviceID; // this stream's devID for Notify callback
  61. int fileDivType; // file division type
  62. DWORD userDisplayType; // song pointer, smpte x, or milliseconds
  63. BOOL bLastPaused; // if last stop action was result of "mci_pause"
  64. } SeqStreamType,
  65. NEAR * pSeqStreamType;
  66. extern ListHandle SeqStreamListHandle; // this is a global kept for the seq streamer
  67. extern HINSTANCE hInstance;
  68. // from mciseq.c
  69. PUBLIC DWORD FAR PASCAL mciDriverEntry (MCIDEVICEID wDeviceID, UINT wMessage,
  70. DWORD_PTR dwParam1, DWORD_PTR dwParam2);
  71. PRIVATE BOOL NEAR PASCAL bAsync(UINT wMsg);
  72. PRIVATE BOOL NEAR PASCAL bMutex(UINT wNewMsg, UINT wOldMsg, DWORD wNewFlags,
  73. DWORD dwNewTo, DWORD dwOldTo);
  74. PUBLIC VOID FAR PASCAL PrepareForNotify(pSeqStreamType pStream,
  75. UINT wMessage, LPMCI_GENERIC_PARMS lpParms, DWORD dwTo);
  76. PUBLIC VOID FAR PASCAL SetupMmseqCallback(pSeqStreamType pStream,
  77. DWORD_PTR dwInstance);
  78. PUBLIC VOID FAR PASCAL Notify(pSeqStreamType pStream, UINT wStatus);
  79. PUBLIC VOID NEAR PASCAL EndStreamCycle(pSeqStreamType pStream);
  80. PUBLIC DWORD NEAR PASCAL EndFileStream(pSeqStreamType pStream);
  81. PUBLIC DWORD NEAR PASCAL msOpenStream(pSeqStreamType FAR * lppStream,
  82. LPCWSTR szName, LPMMIOPROC pIOProc);
  83. PUBLIC VOID FAR PASCAL StreamTrackReset(pSeqStreamType pStream,
  84. UINT wTrackNum);
  85. PUBLIC VOID FAR _LOADDS PASCAL mciStreamCycle(DWORD_PTR dwInst);
  86. PUBLIC VOID FAR PASCAL _LOADDS mciSeqCallback(HANDLE h, UINT wMsg, DWORD_PTR dwInstance,
  87. DWORD_PTR dw1, DWORD_PTR dw2);
  88. // from mcicmds.c:
  89. PUBLIC DWORD NEAR PASCAL msOpen(pSeqStreamType FAR *lppStream, MCIDEVICEID wDeviceID,
  90. DWORD dwFlags, LPMCI_OPEN_PARMS lpOpen);
  91. PUBLIC DWORD NEAR PASCAL msClose(pSeqStreamType pStream, MCIDEVICEID wDeviceID,
  92. DWORD dwFlags);
  93. PUBLIC DWORD NEAR PASCAL msPlay(pSeqStreamType pStream, MCIDEVICEID wDeviceID,
  94. DWORD dwFlags, LPMCI_PLAY_PARMS lpPlay);
  95. PUBLIC DWORD NEAR PASCAL msSeek(pSeqStreamType pStream, MCIDEVICEID wDeviceID,
  96. DWORD dwParam1, LPMCI_SEEK_PARMS lpSeek);
  97. PUBLIC DWORD NEAR PASCAL msStatus(pSeqStreamType pStream, MCIDEVICEID wDeviceID,
  98. DWORD dwFlags, LPMCI_STATUS_PARMS lpStatus);
  99. PUBLIC DWORD NEAR PASCAL msGetDevCaps(pSeqStreamType pStream, MCIDEVICEID wDeviceID,
  100. DWORD dwParam1, LPMCI_GETDEVCAPS_PARMS lpCapParms);
  101. PUBLIC DWORD NEAR PASCAL msInfo(pSeqStreamType pStream, MCIDEVICEID wDeviceID,
  102. DWORD dwFlags, LPMCI_INFO_PARMS lpInfo);
  103. PUBLIC DWORD NEAR PASCAL msSet(pSeqStreamType pStream, MCIDEVICEID wDeviceID,
  104. DWORD dwFlags, LPMCI_SEQ_SET_PARMS lpSetParms);
  105. // from Formats.c
  106. PUBLIC BOOL NEAR PASCAL ColonizeOutput(pSeqStreamType pStream);
  107. PUBLIC BOOL NEAR PASCAL FormatsEqual(pSeqStreamType pStream);
  108. PUBLIC DWORD NEAR PASCAL CnvtTimeToSeq(pSeqStreamType pStream,
  109. DWORD dwCurrent, MIDISEQINFO FAR * pSeqInfo);
  110. PUBLIC DWORD NEAR PASCAL CnvtTimeFromSeq(pSeqStreamType pStream,
  111. DWORD dwTicks, MIDISEQINFO FAR * pSeqInfo);
  112. PUBLIC BOOL NEAR PASCAL RangeCheck(pSeqStreamType pStream, DWORD dwValue);
  113. /***************************************************************************
  114. DEBUGGING SUPPORT
  115. ***************************************************************************/
  116. #if DBG
  117. extern void mciseqDbgOut(LPSTR lpszFormat, ...);
  118. int mciseqDebugLevel;
  119. #define dprintf( _x_ ) mciseqDbgOut _x_
  120. #define dprintf1( _x_ ) if (mciseqDebugLevel >= 1) mciseqDbgOut _x_
  121. #define dprintf2( _x_ ) if (mciseqDebugLevel >= 2) mciseqDbgOut _x_
  122. #define dprintf3( _x_ ) if (mciseqDebugLevel >= 3) mciseqDbgOut _x_
  123. #define dprintf4( _x_ ) if (mciseqDebugLevel >= 4) mciseqDbgOut _x_
  124. #else
  125. #define dprintf(x)
  126. #define dprintf1(x)
  127. #define dprintf2(x)
  128. #define dprintf3(x)
  129. #define dprintf4(x)
  130. #endif