home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / C_C++ / BorlandCompiler / freecommandLinetools.exe / Include / mspstrm.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-27  |  3.8 KB  |  149 lines

  1. /*++
  2.  
  3. Copyright (c) 1997-1999 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     MSPStrm.h
  8.  
  9. Abstract:
  10.  
  11.     Definitions for CMSPStream class.
  12.  
  13. --*/
  14. #ifndef _MSPSTRM_H_
  15. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  16. #define _MSPSTRM_H_
  17.  
  18.  
  19. /*++
  20.  
  21. Class Description:
  22.  
  23.     Represents a stream in a call.
  24.  
  25. --*/
  26.  
  27. #define STRM_INITIAL            0x00000000
  28. #define STRM_TERMINALSELECTED   0x00000001
  29. #define STRM_CONFIGURED         0x00000002
  30. #define STRM_RUNNING            0x00000004
  31. #define STRM_PAUSED             0x00000008
  32. #define STRM_STOPPED            0x00000010
  33.  
  34. class ATL_NO_VTABLE CMSPStream : 
  35.     public CComObjectRootEx<CComMultiThreadModelNoCS>,
  36.     public IDispatchImpl<ITStream, &IID_ITStream, &LIBID_TAPI3Lib>
  37. {
  38. public:
  39.  
  40. BEGIN_COM_MAP(CMSPStream)
  41.     COM_INTERFACE_ENTRY(IDispatch)
  42.     COM_INTERFACE_ENTRY(ITStream)
  43.     COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pFTM)
  44. END_COM_MAP()
  45.  
  46. DECLARE_GET_CONTROLLING_UNKNOWN()
  47.  
  48.     CMSPStream(); 
  49.     ~CMSPStream();
  50.  
  51. // methods of the CComObject
  52.     virtual void FinalRelease();
  53.  
  54. // ITStream methods, called by the app.
  55.     STDMETHOD (get_MediaType) (
  56.         OUT     long *                  plMediaType
  57.         );
  58.  
  59.     STDMETHOD (get_Direction) (
  60.         OUT     TERMINAL_DIRECTION *    pTerminalDirection
  61.         );
  62.  
  63.     STDMETHOD (get_Name) (
  64.         OUT     BSTR *                  ppName
  65.         ) = 0;
  66.  
  67.     STDMETHOD (SelectTerminal) (
  68.         IN      ITTerminal *            pTerminal
  69.         );
  70.  
  71.     STDMETHOD (UnselectTerminal) (
  72.         IN     ITTerminal *             pTerminal
  73.         );
  74.  
  75.     STDMETHOD (EnumerateTerminals) (
  76.         OUT     IEnumTerminal **        ppEnumTerminal
  77.         );
  78.  
  79.     STDMETHOD (get_Terminals) (
  80.         OUT     VARIANT *               pTerminals
  81.         );
  82.  
  83.     STDMETHOD (StartStream) ();
  84.  
  85.     STDMETHOD (PauseStream) ();
  86.  
  87.     STDMETHOD (StopStream) ();
  88.  
  89. // methods called by the MSPCall object.
  90.     virtual HRESULT Init(
  91.         IN     HANDLE                   hAddress,
  92.         IN     CMSPCallBase *           pMSPCall,
  93.         IN     IMediaEvent *            pGraph,
  94.         IN     DWORD                    dwMediaType,
  95.         IN     TERMINAL_DIRECTION       Direction
  96.         );
  97.  
  98.     virtual HRESULT ShutDown();
  99.  
  100.     virtual HRESULT GetState(
  101.         OUT     DWORD *                  pdwStatus
  102.         ) { return E_NOTIMPL; } // BUGBUG not actually implemented here
  103.  
  104.     virtual HRESULT HandleTSPData(
  105.         IN     BYTE *                   pData,
  106.         IN     DWORD                    dwSize
  107.         );
  108.  
  109.     virtual HRESULT ProcessGraphEvent(
  110.         IN  long lEventCode,
  111.         IN  long lParam1,
  112.         IN  long lParam2
  113.         );
  114.  
  115. protected:
  116.     // Pointer to the free threaded marshaler.
  117.     IUnknown *                  m_pFTM;
  118.  
  119.     // The current state of the stream.
  120.     DWORD                       m_dwState;
  121.  
  122.     // The media type of this stream. Audio, video, or others.
  123.     DWORD                       m_dwMediaType;
  124.  
  125.     // The direction of this stream. Incoming or outgoing.
  126.     TERMINAL_DIRECTION          m_Direction;
  127.  
  128.     // The address on which this stream is being used.
  129.     HANDLE                      m_hAddress;
  130.  
  131.     // The reference to the call object.
  132.     CMSPCallBase *              m_pMSPCall;
  133.  
  134.     // The pointers to the graph object interfaces.
  135.     IGraphBuilder *             m_pIGraphBuilder;
  136.     IMediaControl *             m_pIMediaControl;
  137.  
  138.     // The list of stream objects in the call.
  139.     CMSPArray <ITTerminal *>    m_Terminals;
  140.  
  141.     // The lock that protects the stream object. The stream object 
  142.     // should never acquire the lock and then call a MSPCall method 
  143.     // that might lock.
  144.     CMSPCritSection             m_lock;
  145. };
  146.  
  147. #pragma option pop /*P_O_Pop*/
  148. #endif // __MSPSTRM_H_
  149.