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

  1. //------------------------------------------------------------------------------
  2. // File: MapperDlg.h
  3. //
  4. // Desc: DirectShow sample code - an MFC based C++ filter mapper application.
  5. //
  6. // Copyright (c) 2000-2001 Microsoft Corporation.  All rights reserved.
  7. //------------------------------------------------------------------------------
  8.  
  9. #if !defined(AFX_MAPPERDLG_H__B56EF95A_58D3_498A_B0FD_11BD1B1CADF3__INCLUDED_)
  10. #define AFX_MAPPERDLG_H__B56EF95A_58D3_498A_B0FD_11BD1B1CADF3__INCLUDED_
  11.  
  12. #if _MSC_VER > 1000
  13. #pragma once
  14. #endif // _MSC_VER > 1000
  15.  
  16.  
  17. #include <dshow.h>
  18.  
  19. //
  20. // Macros
  21. //
  22. #define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
  23.  
  24. //
  25. // Tooltip strings
  26. //
  27. #define TTSTR_EXACT_MATCH TEXT("If the value of the bExactMatch parameter is TRUE, this method ")\
  28.         TEXT("looks for filters that exactly match the values you specify for media type, pin category, ")\
  29.         TEXT("and pin medium. If the value is FALSE, filters that register a value of NULL for any ")\
  30.         TEXT("of these items are considered a match. (In effect, a NULL value in the registry acts as a ")\
  31.         TEXT("wildcard.)")
  32.  
  33. #define TTSTR_ALOIP       TEXT("Boolean value indicating whether the filter must have an input pin. ")\
  34.         TEXT("If the value is TRUE, the filter must have at least one input pin.")
  35.  
  36. #define TTSTR_ALOOP       TEXT("Boolean value specifying whether the filter must have an output pin. ")\
  37.         TEXT("If TRUE, the filter must have at least one output pin.")
  38.  
  39. #define TTSTR_IS_RENDERER TEXT("Boolean value that specifies whether the filter must render its ")\
  40.         TEXT("input. If TRUE, the specified filter must render input.")
  41.  
  42. #define TTSTR_CLEAR       TEXT("Clear all selections and return them to default values.")
  43.  
  44. #define TTSTR_SEARCH      TEXT("Search the registry for filters that match the current selections, ")\
  45.         TEXT("using the IFilterMapper2::EnumMatchingFilters() method.")
  46.  
  47. #define TTSTR_FILTERS     TEXT("This area displays the names and filenames of filters that match ")\
  48.         TEXT("your query.")
  49.  
  50. #define TTSTR_MERIT       TEXT("Minimum merit value.  Each filter is registered with a merit value. ")\
  51.         TEXT("When the filter graph manager builds a graph, it enumerates all the filters registered ")\
  52.         TEXT("with the correct media type. Then it tries them in order of merit, from highest to lowest. ")\
  53.         TEXT("(It uses additional criteria to choose between filters with equal merit.) It never tries ")\
  54.         TEXT("filters with a merit value less than or equal to MERIT_DO_NOT_USE.")
  55.  
  56. #define TTSTR_PIN_CAT     TEXT("The pin property set enables you to retrieve the category to which ")\
  57.         TEXT("a pin belongs, if any. The category is set by the filter when it creates the pin; the ")\
  58.         TEXT("category indicates what type of data the pin is streaming. The most commonly used ")\
  59.         TEXT("categories are for the capture and preview pins on a capture filter.  Leave as <Don't Care> ")\
  60.         TEXT("if not needed.")
  61.  
  62. #define TTSTR_TYPE        TEXT("Select a media type, if desired.  If you specify <Don't care> for ")\
  63.         TEXT("media type or pin category, any filter is considered a match for that parameter.  ")\
  64.         TEXT("If a pin did not register any media types, this method will not consider it a match for ")\
  65.         TEXT("the media type.")
  66.  
  67. #define TTSTR_SUBTYPE     TEXT("Select a corresponding media subtype, if desired.  If you specify ")\
  68.         TEXT("<Don't care> for the subtype, then the subtype is ignored (set to GUID_NULL) so that all ")\
  69.         TEXT("subtypes are considered a match within the related type.")
  70.  
  71. /////////////////////////////////////////////////////////////////////////////
  72. // CMapperDlg dialog
  73.  
  74. class CMapperDlg : public CDialog
  75. {
  76. // Construction
  77. public:
  78.     CMapperDlg(CWnd* pParent = NULL);    // standard constructor
  79.  
  80.     void FillMajorTypes(CListBox& m_List);
  81.     void FillSubType(CListBox& m_List, CListBox& m_ListMinor);
  82.     void EnableSecondTypePair(CListBox& m_ListMajor, 
  83.                               CListBox& m_ListMajor2, CListBox& m_ListMinor2);
  84.     void SetDefaults();
  85.  
  86.     BOOL InitializeTooltips(void);
  87.  
  88.     IEnumMoniker *GetFilterEnumerator(void);
  89.  
  90.     int GetFilenameByCLSID(REFCLSID clsid, TCHAR *szFile);
  91.  
  92.     void AddFilter(const TCHAR *szFilterName, const GUID *pCatGuid, DWORD dwMerit);
  93.     void AddMerit(TCHAR *szInfo, DWORD dwMerit);
  94.     HRESULT GetMerit(IPropertyBag *pPropBag, DWORD *pdwMerit);
  95.  
  96.  
  97. // Dialog Data
  98.     //{{AFX_DATA(CMapperDlg)
  99.     enum { IDD = IDD_MAPPER_DIALOG };
  100.     CButton    m_bSearch;
  101.     CButton    m_bClear;
  102.     CStatic    m_StrNumFilters;
  103.     CButton    m_bIsRenderer;
  104.     CButton    m_bAtLeastOneOutputPin;
  105.     CButton    m_bAtLeastOneInputPin;
  106.     CButton    m_bExactMatch;
  107.     CListBox    m_ListOutputMinor2;
  108.     CListBox    m_ListOutputMinor;
  109.     CListBox    m_ListOutputMajor2;
  110.     CListBox    m_ListOutputMajor;
  111.     CListBox    m_ListInputMinor2;
  112.     CListBox    m_ListInputMinor;
  113.     CListBox    m_ListInputMajor2;
  114.     CListBox    m_ListInputMajor;
  115.     CComboBox    m_ComboMerit;
  116.     CComboBox    m_ComboOutputCat;
  117.     CComboBox    m_ComboInputCat;
  118.     CListBox    m_ListFilters;
  119.     //}}AFX_DATA
  120.  
  121.     // ClassWizard generated virtual function overrides
  122.     //{{AFX_VIRTUAL(CMapperDlg)
  123.     public:
  124.     virtual BOOL PreTranslateMessage(MSG* pMsg);
  125.     protected:
  126.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  127.     //}}AFX_VIRTUAL
  128.  
  129. // Implementation
  130. protected:
  131.     HICON m_hIcon;
  132.  
  133.     IFilterMapper2 *m_pMapper;
  134.     CToolTipCtrl   *m_pToolTip;
  135.  
  136.     // Generated message map functions
  137.     //{{AFX_MSG(CMapperDlg)
  138.     virtual BOOL OnInitDialog();
  139.     afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  140.     afx_msg void OnPaint();
  141.     afx_msg HCURSOR OnQueryDragIcon();
  142.     afx_msg void OnClose();
  143.     afx_msg void OnDestroy();
  144.     afx_msg void OnButtonSearch();
  145.     afx_msg void OnSelchangeListInputMajor();
  146.     afx_msg void OnSelchangeListOutputMajor();
  147.     afx_msg void OnSelchangeListInputMajor2();
  148.     afx_msg void OnSelchangeListOutputMajor2();
  149.     afx_msg void OnButtonClear();
  150.     //}}AFX_MSG
  151.     DECLARE_MESSAGE_MAP()
  152. };
  153.  
  154. //{{AFX_INSERT_LOCATION}}
  155. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  156.  
  157. #endif // !defined(AFX_MAPPERDLG_H__B56EF95A_58D3_498A_B0FD_11BD1B1CADF3__INCLUDED_)
  158.