home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectShow / Capture / AMCap / crossbar.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-08  |  2.6 KB  |  86 lines

  1. //------------------------------------------------------------------------------
  2. // File: Crossbar.h
  3. //
  4. // Desc: DirectShow sample code - definition of class for controlling
  5. //       video crossbars.
  6. //
  7. // Copyright (c) 1993-2001 Microsoft Corporation.  All rights reserved.
  8. //------------------------------------------------------------------------------
  9.  
  10.  
  11. #ifndef __Crossbar_h__
  12. #define __Crossbar_h__
  13.  
  14.  
  15. //------------------------------------------------------------------------------
  16. // Name: class CClass
  17. // Desc: This class contains routing information for the capture data
  18. //------------------------------------------------------------------------------
  19. class CRouting {
  20. public:
  21.     class CRouting       *pLeftRouting;
  22.     class CRouting       *pRightRouting;
  23.     LONG                 VideoInputIndex;
  24.     LONG                 VideoOutputIndex;
  25.     LONG                 AudioInputIndex;
  26.     LONG                 AudioOutputIndex;
  27.     IAMCrossbar         *pXbar;
  28.     LONG                 InputPhysicalType;
  29.     LONG                 OutputPhysicalType;
  30.     LONG                 Depth;
  31.  
  32.     CRouting () {};
  33.     ~CRouting () {};
  34. };
  35.  
  36. typedef CGenericList<CRouting> CRoutingList;
  37.  
  38.  
  39.  
  40.  
  41. //------------------------------------------------------------------------------
  42. // Name: class CCrossbar
  43. // Desc: The actual helper class for Crossbars
  44. //------------------------------------------------------------------------------
  45. class CCrossbar
  46. {
  47. private:
  48.     IPin                    *m_pStartingPin;
  49.     CRouting                 m_RoutingRoot;
  50.     CRoutingList            *m_RoutingList;
  51.     int                      m_CurrentRoutingIndex;
  52.  
  53.     HRESULT BuildRoutingList (
  54.                 IPin     *pStartingInputPin,
  55.                 CRouting *pCRouting,
  56.                 int       Depth);
  57.     HRESULT SaveRouting (CRouting *pRoutingNew);
  58.     HRESULT DestroyRoutingList();
  59.     BOOL    StringFromPinType (TCHAR *pc, int nSize, long lType);
  60.     
  61.     HRESULT GetCrossbarIPinAtIndex(
  62.                 IAMCrossbar *pXbar,
  63.                 LONG PinIndex,
  64.                 BOOL IsInputPin,
  65.                 IPin ** ppPin);
  66.     HRESULT GetCrossbarIndexFromIPin (
  67.                 IAMCrossbar * pXbar,
  68.                 LONG * PinIndex,
  69.                 BOOL IsInputPin,
  70.                 IPin * pPin);
  71.  
  72. public:
  73.  
  74.     CCrossbar (IPin *pPin);             
  75.     ~CCrossbar();
  76.  
  77.     HRESULT GetInputCount (LONG *pCount);
  78.     HRESULT GetInputType  (LONG Index, LONG * PhysicalType);
  79.     HRESULT GetInputName  (LONG Index, TCHAR * pName, LONG NameSize);
  80.     HRESULT SetInputIndex (LONG Index);
  81.     HRESULT GetInputIndex (LONG *Index);
  82.  
  83. };
  84.  
  85. #endif  // __Crossbar_h__
  86.