home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectShow / Misc / SysEnum / SysEnumDlg.h < prev   
Encoding:
C/C++ Source or Header  |  2001-10-08  |  3.5 KB  |  114 lines

  1. //------------------------------------------------------------------------------
  2. // File: SysEnumDlg.h
  3. //
  4. // Desc: DirectShow sample code - header file for device enumeration dialog.
  5. //
  6. // Copyright (c) 2000-2001 Microsoft Corporation.  All rights reserved.
  7. //------------------------------------------------------------------------------
  8.  
  9.  
  10. #include <dshow.h>
  11.  
  12.  
  13. #if !defined(AFX_SYSENUMDLG_H__A96832BF_0309_4844_9B33_5E72285C3F3E__INCLUDED_)
  14. #define AFX_SYSENUMDLG_H__A96832BF_0309_4844_9B33_5E72285C3F3E__INCLUDED_
  15.  
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif // _MSC_VER > 1000
  19.  
  20. //
  21. // Macros
  22. //
  23. #define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
  24.  
  25. //
  26. //  Global data structure for storing CLSIDs and friendly strings
  27. //
  28. typedef struct _category_info
  29. {
  30.     const CLSID *pclsid;
  31.     TCHAR szName[128];
  32.  
  33. } CATEGORY_INFO_DS;
  34.  
  35. // The DirectShow reference documentation lists a set of filter categories
  36. // for which you can enumerate corresponding filters.  See 'Filter Categories'
  37. // under 'DirectShow->Reference->Constants and GUIDS' in the DirectX docs.
  38. const CATEGORY_INFO_DS categories[] = {
  39.     
  40.     &CLSID_AudioInputDeviceCategory, TEXT("Audio Capture Devices"),
  41.     &CLSID_AudioCompressorCategory,  TEXT("Audio Compressors"),
  42.     &CLSID_AudioRendererCategory,    TEXT("Audio Renderers"),
  43.     &CLSID_LegacyAmFilterCategory,   TEXT("DirectShow Filters"),
  44.     &CLSID_MidiRendererCategory,     TEXT("Midi Renderers"),
  45.     &CLSID_VideoInputDeviceCategory, TEXT("Video Capture Devices"),
  46.     &CLSID_VideoCompressorCategory,  TEXT("Video Compressors"),
  47. };
  48.  
  49. #define NUM_CATEGORIES  (sizeof(categories) / sizeof(CATEGORY_INFO_DS))
  50.  
  51. #define STR_CLASSES     TEXT("System Device Classes")
  52. #define STR_FILTERS     TEXT("Registered Filters")
  53.  
  54.  
  55. /////////////////////////////////////////////////////////////////////////////
  56. // CSysEnumDlg dialog
  57.  
  58. class CSysEnumDlg : public CDialog
  59. {
  60. // Construction
  61. public:
  62.     ICreateDevEnum * m_pSysDevEnum;
  63.     CSysEnumDlg(CWnd* pParent = NULL);    // standard constructor
  64.     HRESULT EnumFilters(IEnumMoniker *pEnumCat);
  65.     void FillCategoryList(void);
  66.     void DisplayFullCategorySet(void);
  67.     void AddFilterCategory(const TCHAR *szCatDesc, const GUID *pCatGuid);
  68.     void AddFilter(const TCHAR *szFilterName, const GUID *pCatGuid);
  69.     void ClearDeviceList(void);
  70.     void ClearFilterList(void);
  71.     void SetNumClasses(int nClasses);
  72.     void SetNumFilters(int nFilters);
  73.     void ShowFilenameByCLSID(REFCLSID clsid);
  74.  
  75. // Dialog Data
  76.     //{{AFX_DATA(CSysEnumDlg)
  77.     enum { IDD = IDD_SYSENUM_DIALOG };
  78.     CStatic    m_StrFilename;
  79.     CStatic    m_StrFilters;
  80.     CStatic    m_StrClasses;
  81.     CListBox    m_FilterList;
  82.     CListBox    m_DeviceList;
  83.     BOOL    m_bShowAllCategories;
  84.     //}}AFX_DATA
  85.  
  86.     // ClassWizard generated virtual function overrides
  87.     //{{AFX_VIRTUAL(CSysEnumDlg)
  88.     protected:
  89.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  90.     //}}AFX_VIRTUAL
  91.  
  92. // Implementation
  93. protected:
  94.     HICON m_hIcon;
  95.  
  96.     // Generated message map functions
  97.     //{{AFX_MSG(CSysEnumDlg)
  98.     virtual BOOL OnInitDialog();
  99.     afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  100.     afx_msg void OnPaint();
  101.     afx_msg HCURSOR OnQueryDragIcon();
  102.     afx_msg void OnSelchangeListDevices();
  103.     afx_msg void OnClose();
  104.     afx_msg void OnCheckShowall();
  105.     afx_msg void OnSelchangeListFilters();
  106.     //}}AFX_MSG
  107.     DECLARE_MESSAGE_MAP()
  108. };
  109.  
  110. //{{AFX_INSERT_LOCATION}}
  111. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  112.  
  113. #endif // !defined(AFX_SYSENUMDLG_H__A96832BF_0309_4844_9B33_5E72285C3F3E__INCLUDED_)
  114.