SEQ.H
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:5k
源码类别:

Windows编程

开发平台:

Visual C++

  1. /*****************************************************************************
  2. *
  3. *  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  4. *  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
  5. *  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR
  6. *  A PARTICULAR PURPOSE.
  7. *
  8. *  Copyright (C) 1993 - 1997 Microsoft Corporation. All Rights Reserved.
  9. *
  10. ******************************************************************************
  11. *
  12. * Seq.H
  13. *
  14. * Public include file for sequencer interface.
  15. *
  16. *****************************************************************************/
  17. #ifndef _SEQ_
  18. #define _SEQ_
  19. #include "global.h"
  20. #include "smf.h"   
  21. #define  VERSION_MINOR              0x00
  22. #define  VERSION_MAJOR              0x04
  23. #define  SEQ_VERSION                ((DWORD)(WORD)((BYTE)VERSION_MINOR | (((WORD)(BYTE)VERSION_MAJOR) << 8)))
  24. #define SEQ_F_EOF           0x00000001L
  25. #define SEQ_F_COLONIZED     0x00000002L
  26. #define SEQ_F_WAITING       0x00000004L   
  27.                                           
  28. #define SEQ_S_NOFILE        0
  29. #define SEQ_S_OPENED        1
  30. #define SEQ_S_PREROLLING    2
  31. #define SEQ_S_PREROLLED     3
  32. #define SEQ_S_PLAYING       4
  33. #define SEQ_S_PAUSED        5
  34. #define SEQ_S_STOPPING      6
  35. #define SEQ_S_RESET         7
  36. #define MMSG_DONE                   (WM_USER+20)
  37. typedef struct tag_preroll
  38. {
  39.     TICKS       tkBase;
  40.     TICKS       tkEnd;
  41. }   PREROLL,
  42.     FAR *LPPREROLL;
  43. typedef struct tag_seq NEAR* PSEQ;
  44. typedef struct tag_seq
  45. {
  46.     DWORD       cBuffer;            /* Number of streaming buffers to alloc         */
  47.     DWORD       cbBuffer;           /* Size of each streaming buffer                */
  48.     LPSTR       pstrFile;           /* Pointer to filename to open                  */
  49.     UINT        uDeviceID;          /* Requested MIDI device ID for MMSYSTEM        */
  50.     UINT        uMCIDeviceID;       /* Our MCI device ID given to us                */
  51.     UINT        uMCITimeFormat;     /* Current time format                          */
  52.     UINT        uMCITimeDiv;        /* MCI_SEQ_DIV_xxx for current file             */
  53. HWND hWnd; /* Where to post MMSG_DONE when done playing */
  54.     UINT        uState;             /* Sequencer state (SEQ_S_xxx)                  */
  55.     TICKS       tkLength;           /* Length of longest track                      */
  56.     DWORD       cTrk;               /* Number of tracks                             */
  57.     MMRESULT    mmrcLastErr;        /* Error return from last sequencer operation   */
  58.     PSEQ        pNext;              /* Link to next PSEQ                            */
  59.     HSMF        hSmf;               /* Handle to open file                          */
  60.     HMIDIOUT    hmidi;              /* Handle to open MIDI device                   */
  61.     DWORD       dwTimeDivision;     /* File time division                           */
  62.     LPBYTE      lpbAlloc;           /* Streaming buffers -- initial allocation      */ 
  63.     LPMIDIHDR   lpmhFree;           /* Streaming buffers -- free list               */
  64.     LPMIDIHDR   lpmhPreroll;        /* Streaming buffers -- preroll buffer          */
  65.     DWORD       cbPreroll;          /* Streaming buffers -- size of lpmhPreroll     */
  66.     UINT        uBuffersInMMSYSTEM; /* Streaming buffers -- in use                  */
  67.     
  68.     TICKS       tkBase;             /* Where playback started from in stream        */
  69.     TICKS       tkEnd;              /* Where playback should end                    */
  70.     
  71.     DWORD       fdwSeq;             /* Various sequencer flags                      */
  72. }   SEQ,
  73.     NEAR *PSEQ;
  74. /* sequence.c
  75. */
  76. MMRESULT FNLOCAL seqAllocBuffers(    
  77.     PSEQ                pseq);
  78. VOID FNLOCAL seqFreeBuffers(         
  79.     PSEQ                pseq);
  80. MMRESULT FNLOCAL seqOpenFile(        
  81.     PSEQ                pseq);
  82. MMRESULT FNLOCAL seqCloseFile(       
  83.     PSEQ                pseq);
  84. MMRESULT FNLOCAL seqPreroll(         
  85.     PSEQ                pseq,
  86.     LPPREROLL           lppreroll);
  87. MMRESULT FNLOCAL seqStart(           
  88.     PSEQ                pseq);
  89. MMRESULT FNLOCAL seqPause(           
  90.     PSEQ                pseq);
  91. MMRESULT FNLOCAL seqRestart(         
  92.     PSEQ                pseq);
  93. MMRESULT FNLOCAL seqStop(            
  94.     PSEQ                pseq);
  95. MMRESULT FNLOCAL seqTime(            
  96.     PSEQ                pseq,
  97.     PTICKS              pTicks);
  98. TICKS FNLOCAL seqMillisecsToTicks(   
  99.     PSEQ                pseq,
  100.     DWORD               msOffset);
  101. DWORD FNLOCAL seqTicksToMillisecs(   
  102.     PSEQ                pseq,
  103.     TICKS               tkOffset);
  104. #endif