home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / cutlist.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  6KB  |  200 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) 1992 - 1997  Microsoft Corporation.  All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11.  
  12. // CutList related definitions and interfaces for ActiveMovie
  13.  
  14. #ifndef __CUTLIST__
  15. #define __CUTLIST__
  16.  
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif // __cplusplus
  20.  
  21. #define CL_DEFAULT_TIME            (-1L)
  22.  
  23. enum CL_ELEM_STATUS {
  24.     CL_NOT_PLAYED = 0,
  25.     CL_PLAYING = 1,
  26.     CL_FINISHED = 2,
  27.     CL_STATE_INVALID = 3,
  28.     CL_STATE_MASK = CL_STATE_INVALID,
  29.     CL_WAIT_FOR_STATE = 0xF0000000
  30. };
  31.  
  32. enum CL_ELEM_FLAGS{
  33.     CL_ELEM_FIRST = 1,
  34.     CL_ELEM_LAST = 2,
  35.     CL_ELEM_NULL = 4,
  36.     CL_ELEM_ALL  = 0xFFFFFFFF,
  37.     CL_ELEM_NONE = 0x0L
  38. };
  39.  
  40.  
  41. #ifndef __IAMCutListElement_INTERFACE_DEFINED__
  42. #define __IAMCutListElement_INTERFACE_DEFINED__
  43. #define __IAMFileCutListElement_INTERFACE_DEFINED__
  44. #define __IAMVideoCutListElement_INTERFACE_DEFINED__
  45. #define __IAMAudioCutListElement_INTERFACE_DEFINED__
  46.  
  47. interface IAMCutListElement : public IUnknown
  48. {
  49. public:
  50.         virtual HRESULT __stdcall GetElementStartPosition( 
  51.             /* [out] */ REFERENCE_TIME *pmtStart) = 0;
  52.         
  53.         virtual HRESULT __stdcall GetElementDuration( 
  54.             /* [out] */ REFERENCE_TIME *pmtDuration) = 0;
  55.         
  56.         virtual HRESULT __stdcall IsFirstElement( void ) = 0;
  57.         
  58.         virtual HRESULT __stdcall IsLastElement( void ) = 0; 
  59.         
  60.         virtual HRESULT __stdcall IsNull( void ) = 0;
  61.         
  62.         virtual HRESULT __stdcall ElementStatus( 
  63.             DWORD *pdwStatus,
  64.             DWORD dwTimeoutMs) = 0;
  65.         
  66. };
  67.  
  68.  
  69. interface IAMFileCutListElement : public IUnknown
  70. {
  71. public:
  72.         virtual HRESULT __stdcall GetFileName( 
  73.             /* [out] */ LPWSTR *ppwstrFileName) = 0;
  74.         
  75.         virtual HRESULT __stdcall GetTrimInPosition( 
  76.             /* [out] */ REFERENCE_TIME *pmtTrimIn) = 0;
  77.         
  78.         virtual HRESULT __stdcall GetTrimOutPosition( 
  79.             /* [out] */ REFERENCE_TIME *pmtTrimOut) = 0;
  80.         
  81.         virtual HRESULT __stdcall GetOriginPosition( 
  82.             /* [out] */ REFERENCE_TIME *pmtOrigin) = 0;
  83.         
  84.         virtual HRESULT __stdcall GetTrimLength( 
  85.             /* [out] */ REFERENCE_TIME *pmtLength) = 0;
  86.         
  87.         virtual HRESULT __stdcall GetElementSplitOffset( 
  88.             /* [out] */ REFERENCE_TIME *pmtOffset) = 0;
  89.         
  90. };
  91.  
  92.  
  93. interface IAMVideoCutListElement : public IUnknown
  94. {
  95. public:
  96.         virtual HRESULT __stdcall IsSingleFrame( void) = 0;
  97.         
  98.         virtual HRESULT __stdcall GetStreamIndex( 
  99.             /* [out] */ DWORD *piStream) = 0;
  100.         
  101. };
  102.     
  103.  
  104. interface IAMAudioCutListElement : public IUnknown
  105. {
  106. public:
  107.         virtual HRESULT __stdcall GetStreamIndex( 
  108.             /* [out] */ DWORD *piStream) = 0;
  109.         
  110.         virtual HRESULT __stdcall HasFadeIn( void) = 0;
  111.         
  112.         virtual HRESULT __stdcall HasFadeOut( void) = 0;
  113.         
  114. };
  115.  
  116. #endif        // #ifndef IAMCutListElement
  117.  
  118.  
  119. interface IStandardCutList : public IUnknown
  120. {
  121.     public:
  122.         virtual HRESULT __stdcall AddElement(
  123.             /* [in] */        IAMCutListElement    *pElement,
  124.             /* [in] */        REFERENCE_TIME    mtStart,
  125.             /* [in] */        REFERENCE_TIME    mtDuration)=0;
  126.  
  127.         virtual HRESULT __stdcall RemoveElement(
  128.             /* [in] */        IAMCutListElement    *pElement) = 0;
  129.  
  130.         virtual HRESULT __stdcall GetFirstElement(
  131.             /* [out] */        IAMCutListElement    **ppElement)=0;
  132.         virtual HRESULT __stdcall GetLastElement(
  133.             /* [out] */        IAMCutListElement    **ppElement)=0;
  134.         virtual HRESULT __stdcall GetNextElement(
  135.             /* [out] */        IAMCutListElement    **ppElement)=0;
  136.         virtual HRESULT __stdcall GetPreviousElement(
  137.             /* [out] */        IAMCutListElement    **ppElement)=0;
  138.         
  139.         virtual HRESULT __stdcall GetMediaType(
  140.             /* [out] */        AM_MEDIA_TYPE *pmt)=0;
  141.         virtual HRESULT __stdcall SetMediaType(
  142.             /* [in] */        AM_MEDIA_TYPE *pmt)=0;
  143. };
  144.  
  145.  
  146. interface IFileClip : public IUnknown
  147. {
  148.     public:
  149.         virtual HRESULT __stdcall SetFileAndStream(
  150.             /* [in] */        LPWSTR    wstrFileName,
  151.             /* [in] */        DWORD    streamNum) = 0;
  152.         
  153.         virtual HRESULT __stdcall CreateCut(
  154.             /* [out] */        IAMCutListElement    **ppElement,
  155.             /* [in] */        REFERENCE_TIME    mtTrimIn,
  156.             /* [in] */        REFERENCE_TIME    mtTrimOut,
  157.             /* [in] */        REFERENCE_TIME    mtOrigin,
  158.             /* [in] */        REFERENCE_TIME    mtLength,
  159.             /* [in] */        REFERENCE_TIME    mtOffset) = 0;
  160.  
  161.         virtual HRESULT __stdcall GetMediaType(
  162.             /* [out] */        AM_MEDIA_TYPE    *pmt) = 0;
  163. };
  164.  
  165. interface ICutListGraphBuilder : public IUnknown
  166. {
  167. public:
  168.         virtual HRESULT __stdcall SetFilterGraph(
  169.             /*[in]*/    IGraphBuilder    *pFilterGraph)=0;
  170.  
  171.         virtual HRESULT __stdcall GetFilterGraph(
  172.             /*[out]*/    IGraphBuilder    **ppFilterGraph)=0;
  173.         
  174.         virtual HRESULT __stdcall AddCutList(
  175.             /*[in]*/    IStandardCutList     *pCutList,
  176.             /*[out]*/    IPin            **ppPin)=0;
  177.         
  178.         virtual HRESULT __stdcall RemoveCutList(
  179.             /*[in]*/    IStandardCutList     *pCutList)=0;
  180.         
  181.         virtual HRESULT __stdcall SetOutputFileName(
  182.             /*[in]*/    const GUID    *pType,
  183.             /*[in]*/    LPCOLESTR    lpwstrFile,
  184.             /*[in]*/    IBaseFilter    **ppf,
  185.             /*[in]*/    IFileSinkFilter    **pSink) = 0;
  186.         
  187.         virtual HRESULT __stdcall Render(void) = 0;
  188.  
  189.         virtual HRESULT __stdcall GetElementFlags(
  190.             /*[in]*/    IAMCutListElement *pElement,
  191.             /*[out]*/    LPDWORD lpdwFlags) = 0;
  192.         
  193. };
  194.  
  195.  
  196. #ifdef __cplusplus
  197. }
  198. #endif // __cplusplus
  199. #endif // __CUTLIST__
  200.