diff options
Diffstat (limited to 'src/apps/mplayerc/RegFilterChooserDlg.cpp')
-rw-r--r-- | src/apps/mplayerc/RegFilterChooserDlg.cpp | 182 |
1 files changed, 91 insertions, 91 deletions
diff --git a/src/apps/mplayerc/RegFilterChooserDlg.cpp b/src/apps/mplayerc/RegFilterChooserDlg.cpp index c16c7c753..28cf69f22 100644 --- a/src/apps/mplayerc/RegFilterChooserDlg.cpp +++ b/src/apps/mplayerc/RegFilterChooserDlg.cpp @@ -33,45 +33,45 @@ //IMPLEMENT_DYNAMIC(CRegFilterChooserDlg, CResizableDialog)
CRegFilterChooserDlg::CRegFilterChooserDlg(CWnd* pParent /*=NULL*/)
- : CResizableDialog(CRegFilterChooserDlg::IDD, pParent)
+ : CResizableDialog(CRegFilterChooserDlg::IDD, pParent)
{
}
CRegFilterChooserDlg::~CRegFilterChooserDlg()
{
- POSITION pos = m_filters.GetHeadPosition();
- while(pos) delete m_filters.GetNext(pos);
+ POSITION pos = m_filters.GetHeadPosition();
+ while(pos) delete m_filters.GetNext(pos);
}
void CRegFilterChooserDlg::DoDataExchange(CDataExchange* pDX)
{
- __super::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_LIST2, m_list);
+ __super::DoDataExchange(pDX);
+ DDX_Control(pDX, IDC_LIST2, m_list);
}
void CRegFilterChooserDlg::AddToList(IMoniker* pMoniker)
{
- CComPtr<IPropertyBag> pPB;
- if(SUCCEEDED(pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)&pPB)))
- {
- CComVariant var;
- if(SUCCEEDED(pPB->Read(CComBSTR(_T("FriendlyName")), &var, NULL)))
- {
- m_list.SetItemData(
- m_list.InsertItem(-1, CString(CStringW(var.bstrVal))),
- (DWORD_PTR)m_monikers.AddTail(pMoniker));
- }
- }
+ CComPtr<IPropertyBag> pPB;
+ if(SUCCEEDED(pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void**)&pPB)))
+ {
+ CComVariant var;
+ if(SUCCEEDED(pPB->Read(CComBSTR(_T("FriendlyName")), &var, NULL)))
+ {
+ m_list.SetItemData(
+ m_list.InsertItem(-1, CString(CStringW(var.bstrVal))),
+ (DWORD_PTR)m_monikers.AddTail(pMoniker));
+ }
+ }
}
BEGIN_MESSAGE_MAP(CRegFilterChooserDlg, CResizableDialog)
- ON_LBN_DBLCLK(IDC_LIST1, OnLbnDblclkList1)
- ON_UPDATE_COMMAND_UI(IDOK, OnUpdateOK)
- ON_BN_CLICKED(IDOK, OnBnClickedOk)
- ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
- ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnNMDblclkList2)
+ ON_LBN_DBLCLK(IDC_LIST1, OnLbnDblclkList1)
+ ON_UPDATE_COMMAND_UI(IDOK, OnUpdateOK)
+ ON_BN_CLICKED(IDOK, OnBnClickedOk)
+ ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
+ ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnNMDblclkList2)
END_MESSAGE_MAP()
@@ -79,95 +79,95 @@ END_MESSAGE_MAP() BOOL CRegFilterChooserDlg::OnInitDialog()
{
- __super::OnInitDialog();
-
- BeginEnumSysDev(CLSID_LegacyAmFilterCategory, pMoniker)
- {
- AddToList(pMoniker);
- }
- EndEnumSysDev
-
- BeginEnumSysDev(DMOCATEGORY_VIDEO_EFFECT, pMoniker)
- {
- AddToList(pMoniker);
- }
- EndEnumSysDev
-
- BeginEnumSysDev(DMOCATEGORY_AUDIO_EFFECT, pMoniker)
- {
- AddToList(pMoniker);
- }
- EndEnumSysDev
-
- AddAnchor(IDC_LIST2, TOP_LEFT, BOTTOM_RIGHT);
- AddAnchor(IDC_BUTTON1, BOTTOM_LEFT);
- AddAnchor(IDOK, BOTTOM_RIGHT);
- AddAnchor(IDCANCEL, BOTTOM_RIGHT);
-
- SetMinTrackSize(CSize(300,100));
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
+ __super::OnInitDialog();
+
+ BeginEnumSysDev(CLSID_LegacyAmFilterCategory, pMoniker)
+ {
+ AddToList(pMoniker);
+ }
+ EndEnumSysDev
+
+ BeginEnumSysDev(DMOCATEGORY_VIDEO_EFFECT, pMoniker)
+ {
+ AddToList(pMoniker);
+ }
+ EndEnumSysDev
+
+ BeginEnumSysDev(DMOCATEGORY_AUDIO_EFFECT, pMoniker)
+ {
+ AddToList(pMoniker);
+ }
+ EndEnumSysDev
+
+ AddAnchor(IDC_LIST2, TOP_LEFT, BOTTOM_RIGHT);
+ AddAnchor(IDC_BUTTON1, BOTTOM_LEFT);
+ AddAnchor(IDOK, BOTTOM_RIGHT);
+ AddAnchor(IDCANCEL, BOTTOM_RIGHT);
+
+ SetMinTrackSize(CSize(300,100));
+
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
}
void CRegFilterChooserDlg::OnLbnDblclkList1()
{
- SendMessage(WM_COMMAND, IDOK);
+ SendMessage(WM_COMMAND, IDOK);
}
void CRegFilterChooserDlg::OnUpdateOK(CCmdUI* pCmdUI)
{
- pCmdUI->Enable(!!m_list.GetFirstSelectedItemPosition());
+ pCmdUI->Enable(!!m_list.GetFirstSelectedItemPosition());
}
void CRegFilterChooserDlg::OnBnClickedOk()
{
- CComPtr<IMoniker> pMoniker;
-
- POSITION pos = m_list.GetFirstSelectedItemPosition();
- if(pos) pos = (POSITION)m_list.GetItemData(m_list.GetNextSelectedItem(pos));
- if(pos) pMoniker = m_monikers.GetAt(pos);
- if(pMoniker)
- {
- CFGFilterRegistry fgf(pMoniker);
- FilterOverride* f = DNew FilterOverride;
- f->fDisabled = false;
- f->type = FilterOverride::REGISTERED;
- f->name = fgf.GetName();
- f->dispname = fgf.GetDisplayName();
- f->guids.AddTailList(&fgf.GetTypes());
- f->backup.AddTailList(&fgf.GetTypes());
- f->dwMerit = fgf.GetMeritForDirectShow();
- f->iLoadType = FilterOverride::MERIT;
- m_filters.AddTail(f);
- }
-
- __super::OnOK();
+ CComPtr<IMoniker> pMoniker;
+
+ POSITION pos = m_list.GetFirstSelectedItemPosition();
+ if(pos) pos = (POSITION)m_list.GetItemData(m_list.GetNextSelectedItem(pos));
+ if(pos) pMoniker = m_monikers.GetAt(pos);
+ if(pMoniker)
+ {
+ CFGFilterRegistry fgf(pMoniker);
+ FilterOverride* f = DNew FilterOverride;
+ f->fDisabled = false;
+ f->type = FilterOverride::REGISTERED;
+ f->name = fgf.GetName();
+ f->dispname = fgf.GetDisplayName();
+ f->guids.AddTailList(&fgf.GetTypes());
+ f->backup.AddTailList(&fgf.GetTypes());
+ f->dwMerit = fgf.GetMeritForDirectShow();
+ f->iLoadType = FilterOverride::MERIT;
+ m_filters.AddTail(f);
+ }
+
+ __super::OnOK();
}
void CRegFilterChooserDlg::OnBnClickedButton1()
{
- CFileDialog dlg(TRUE, NULL, NULL,
- OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY,
- _T("DirectShow Filters (*.dll,*.ax)|*.dll;*.ax|"), this, 0);
-
- if(dlg.DoModal() == IDOK)
- {
- CFilterMapper2 fm2(false);
- fm2.Register(dlg.GetPathName());
- m_filters.AddTail(&fm2.m_filters);
- fm2.m_filters.RemoveAll();
-
- __super::OnOK();
- }
+ CFileDialog dlg(TRUE, NULL, NULL,
+ OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY,
+ _T("DirectShow Filters (*.dll,*.ax)|*.dll;*.ax|"), this, 0);
+
+ if(dlg.DoModal() == IDOK)
+ {
+ CFilterMapper2 fm2(false);
+ fm2.Register(dlg.GetPathName());
+ m_filters.AddTail(&fm2.m_filters);
+ fm2.m_filters.RemoveAll();
+
+ __super::OnOK();
+ }
}
void CRegFilterChooserDlg::OnNMDblclkList2(NMHDR *pNMHDR, LRESULT *pResult)
{
- if(m_list.GetFirstSelectedItemPosition())
- {
- OnBnClickedOk();
- }
+ if(m_list.GetFirstSelectedItemPosition())
+ {
+ OnBnClickedOk();
+ }
- *pResult = 0;
+ *pResult = 0;
}
|