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)
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
23 #include "IGraphBuilder2.h"
24 #include "..\..\DSUtil\DSMPropertyBag.h"
26 class CFilterTreeCtrl
: public CTreeCtrl
32 virtual INT_PTR
OnToolHitTest(CPoint point
, TOOLINFO
* pTI
) const;
33 virtual void PreSubclassWindow();
37 afx_msg BOOL
OnToolTipText(UINT nID
, NMHDR
* pNMHDR
, LRESULT
* pResult
);
42 class CConvertDlg
: public CResizableDialog
52 CTreeItem(CTreeCtrl
& tree
, HTREEITEM hTIParent
);
54 virtual void Update() {}
55 virtual bool ToolTip(CString
& str
) {return false;}
56 void SetLabel(LPCTSTR label
);
57 void SetImage(int nImage
, int nSelectedImage
);
58 operator HTREEITEM() {return m_hTI
;}
61 class CTreeItemFilter
: public CTreeItem
64 CComPtr
<IBaseFilter
> m_pBF
;
65 CTreeItemFilter(IBaseFilter
* pBF
, CTreeCtrl
& tree
, HTREEITEM hTIParent
);
69 class CTreeItemFile
: public CTreeItemFilter
73 CTreeItemFile(CString fn
, IBaseFilter
* pBF
, CTreeCtrl
& tree
, HTREEITEM hTIParent
);
75 bool ToolTip(CString
& str
);
78 class CTreeItemPin
: public CTreeItem
82 CTreeItemPin(IPin
* pPin
, CTreeCtrl
& tree
, HTREEITEM hTIParent
);
84 bool ToolTip(CString
& str
);
88 class CTreeItemResourceFolder
: public CTreeItem
91 CTreeItemResourceFolder(CTreeCtrl
& tree
, HTREEITEM hTIParent
);
93 bool ToolTip(CString
& str
);
96 class CTreeItemResource
: public CTreeItem
100 CTreeItemResource(const CDSMResource
& res
, CTreeCtrl
& tree
, HTREEITEM hTIParent
);
101 ~CTreeItemResource();
103 bool ToolTip(CString
& str
);
106 class CTreeItemChapterFolder
: public CTreeItem
109 CTreeItemChapterFolder(CTreeCtrl
& tree
, HTREEITEM hTIParent
);
113 class CTreeItemChapter
: public CTreeItem
117 CTreeItemChapter(const CDSMChapter
& chap
, CTreeCtrl
& tree
, HTREEITEM hTIParent
);
122 CComPtr
<IGraphBuilder2
> m_pGB
;
123 CComPtr
<IBaseFilter
> m_pMux
;
124 CComQIPtr
<IMediaControl
> m_pMC
;
125 CComQIPtr
<IMediaEventEx
> m_pME
;
126 CComQIPtr
<IMediaSeeking
> m_pMS
;
129 UINT m_nIDEventStatus
;
131 CBitmap m_streamtypesbm
;
132 CImageList m_streamtypes
;
134 CList
<CTreeItem
*> m_pTIs
;
136 void AddFile(CString fn
);
137 bool ConvertFile(LPCTSTR fn
, IPin
* pPin
= NULL
);
138 void AddFilter(HTREEITEM hTI
, IBaseFilter
* pBF
);
139 void DeleteFilter(IBaseFilter
* pBF
);
140 void DeleteItem(HTREEITEM hTI
);
141 void DeleteChildren(HTREEITEM hTI
);
143 HTREEITEM
HitTest(CPoint
& sp
, CPoint
& cp
);
145 void ShowPopup(CPoint p
);
146 void ShowFilePopup(HTREEITEM hTI
, CPoint p
);
147 void ShowPinPopup(HTREEITEM hTI
, CPoint p
);
148 void ShowResourceFolderPopup(HTREEITEM hTI
, CPoint p
);
149 void ShowResourcePopup(HTREEITEM hTI
, CPoint p
);
150 void ShowChapterFolderPopup(HTREEITEM hTI
, CPoint p
);
151 void ShowChapterPopup(HTREEITEM hTI
, CPoint p
);
153 bool EditProperties(IDSMPropertyBag
* pPB
);
154 bool EditResource(CTreeItemResource
* t
);
155 bool EditChapter(CTreeItemChapter
* t
);
158 CConvertDlg(CWnd
* pParent
= NULL
); // standard constructor
159 virtual ~CConvertDlg();
162 enum { IDD
= IDD_CONVERT_DLG
};
163 CFilterTreeCtrl m_tree
;
167 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
168 virtual BOOL
PreTranslateMessage(MSG
* pMsg
);
169 virtual BOOL
OnInitDialog();
172 DECLARE_MESSAGE_MAP()
175 afx_msg LRESULT
OnGraphNotify(WPARAM wParam
, LPARAM lParam
);
176 afx_msg
void OnDropFiles(HDROP hDropInfo
);
177 afx_msg
void OnClose();
178 afx_msg
void OnNMClickTree1(NMHDR
*pNMHDR
, LRESULT
*pResult
);
179 afx_msg
void OnNMRclickTree1(NMHDR
*pNMHDR
, LRESULT
*pResult
);
180 afx_msg
void OnNMDblclkTree1(NMHDR
*pNMHDR
, LRESULT
*pResult
);
181 afx_msg
void OnBnClickedButton1();
182 afx_msg
void OnUpdateButton1(CCmdUI
* pCmdUI
);
183 afx_msg
void OnTimer(UINT nIDEvent
);
184 afx_msg
void OnBnClickedButton2();
185 afx_msg
void OnBnClickedButton3();
186 afx_msg
void OnBnClickedButton4();
187 afx_msg
void OnUpdateButton2(CCmdUI
* pCmdUI
);
188 afx_msg
void OnUpdateButton3(CCmdUI
* pCmdUI
);
189 afx_msg
void OnUpdateButton4(CCmdUI
* pCmdUI
);