Support unrar64.dll
[xy_vsfilter.git] / src / apps / mplayerc / FakeFilterMapper2.h
blob88f071cb3526ed0e8d9467530420971033a8d9e1
1 /*
2 * Copyright (C) 2003-2006 Gabest
3 * http://www.gabest.org
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
8 * any later version.
9 *
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GNU Make; see the file COPYING. If not, write to
17 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 * http://www.gnu.org/copyleft/gpl.html
22 #pragma once
24 #include <atlbase.h>
26 class FilterOverride
28 public:
29 bool fDisabled, fTemporary;
30 enum {REGISTERED, EXTERNAL} type;
31 // REGISTERED
32 CStringW dispname;
33 // EXTERNAL
34 CString path, name;
35 CLSID clsid;
36 // props
37 CAtlList<GUID> guids, backup;
38 enum {PREFERRED, BLOCK, MERIT};
39 int iLoadType;
40 DWORD dwMerit;
42 FilterOverride() {fTemporary = false;}
43 FilterOverride(FilterOverride* f)
45 fDisabled = f->fDisabled;
46 fTemporary = f->fTemporary;
47 type = f->type;
48 dispname = f->dispname;
49 path = f->path;
50 name = f->name;
51 clsid = f->clsid;
52 guids.AddTailList(&f->guids);
53 backup.AddTailList(&f->backup);
54 iLoadType = f->iLoadType;
55 dwMerit = f->dwMerit;
59 class CFilterMapper2 : protected CUnknown, protected IFilterMapper2
61 static bool fInitialized;
63 CComPtr<IFilterMapper2> m_pFM2;
64 CString m_path;
66 protected:
67 DECLARE_IUNKNOWN;
68 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
70 // IFilterMapper2
72 STDMETHODIMP CreateCategory(REFCLSID clsidCategory, DWORD dwCategoryMerit, LPCWSTR Description);
73 STDMETHODIMP UnregisterFilter(const CLSID* pclsidCategory, const OLECHAR* szInstance, REFCLSID Filter);
74 STDMETHODIMP RegisterFilter(REFCLSID clsidFilter, LPCWSTR Name, IMoniker** ppMoniker, const CLSID* pclsidCategory, const OLECHAR* szInstance, const REGFILTER2* prf2);
75 STDMETHODIMP EnumMatchingFilters(IEnumMoniker** ppEnum, DWORD dwFlags, BOOL bExactMatch, DWORD dwMerit,
76 BOOL bInputNeeded, DWORD cInputTypes, const GUID* pInputTypes, const REGPINMEDIUM* pMedIn, const CLSID* pPinCategoryIn, BOOL bRender,
77 BOOL bOutputNeeded, DWORD cOutputTypes, const GUID* pOutputTypes, const REGPINMEDIUM* pMedOut, const CLSID* pPinCategoryOut);
79 public:
80 CFilterMapper2();
81 virtual ~CFilterMapper2();
83 static void Init();
85 static IFilterMapper2* m_pFilterMapper2;
86 CList<Filter*> m_filters;
87 void Register(CString path);
91 class CFilterMapper2 : protected CUnknown, public IFilterMapper2
93 static bool fInitialized;
95 CComPtr<IUnknown> m_pFM2;
96 CString m_path;
98 bool m_fRefCounted, m_fAllowUnreg;
100 protected:
101 DECLARE_IUNKNOWN;
102 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
104 // IFilterMapper2
106 STDMETHODIMP CreateCategory(REFCLSID clsidCategory, DWORD dwCategoryMerit, LPCWSTR Description);
107 STDMETHODIMP UnregisterFilter(const CLSID* pclsidCategory, const OLECHAR* szInstance, REFCLSID Filter);
108 STDMETHODIMP RegisterFilter(REFCLSID clsidFilter, LPCWSTR Name, IMoniker** ppMoniker, const CLSID* pclsidCategory, const OLECHAR* szInstance, const REGFILTER2* prf2);
109 STDMETHODIMP EnumMatchingFilters(IEnumMoniker** ppEnum, DWORD dwFlags, BOOL bExactMatch, DWORD dwMerit,
110 BOOL bInputNeeded, DWORD cInputTypes, const GUID* pInputTypes, const REGPINMEDIUM* pMedIn, const CLSID* pPinCategoryIn, BOOL bRender,
111 BOOL bOutputNeeded, DWORD cOutputTypes, const GUID* pOutputTypes, const REGPINMEDIUM* pMedOut, const CLSID* pPinCategoryOut);
113 public:
114 CFilterMapper2(bool fRefCounted, bool fAllowUnreg = false, LPUNKNOWN pUnkOuter = NULL);
115 virtual ~CFilterMapper2();
117 void SetInner(IUnknown* pUnk) {m_pFM2 = pUnk;}
119 static void Init();
121 static IFilterMapper2* m_pFilterMapper2;
122 CList<FilterOverride*> m_filters;
123 void Register(CString path);