X64 transport [Part 5] (Update plugins.cpp)
[xy_vsfilter.git] / src / apps / mplayerc / ConvertDlg.h
blob72bf7a271ae4b29c177b7e94df40ad1874eac549
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
23 #include "IGraphBuilder2.h"
24 #include "..\..\DSUtil\DSMPropertyBag.h"
26 class CFilterTreeCtrl : public CTreeCtrl
28 public:
29 CFilterTreeCtrl();
31 protected:
32 virtual INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
33 virtual void PreSubclassWindow();
35 public:
36 DECLARE_MESSAGE_MAP()
37 afx_msg BOOL OnToolTipText(UINT nID, NMHDR* pNMHDR, LRESULT* pResult);
40 // CConvertDlg dialog
42 class CConvertDlg : public CResizableDialog
44 public:
45 class CTreeItem
47 protected:
48 CTreeCtrl& m_tree;
49 HTREEITEM m_hTI;
51 public:
52 CTreeItem(CTreeCtrl& tree, HTREEITEM hTIParent);
53 virtual ~CTreeItem();
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
63 public:
64 CComPtr<IBaseFilter> m_pBF;
65 CTreeItemFilter(IBaseFilter* pBF, CTreeCtrl& tree, HTREEITEM hTIParent);
66 void Update();
69 class CTreeItemFile : public CTreeItemFilter
71 public:
72 CString m_fn;
73 CTreeItemFile(CString fn, IBaseFilter* pBF, CTreeCtrl& tree, HTREEITEM hTIParent);
74 void Update();
75 bool ToolTip(CString& str);
78 class CTreeItemPin : public CTreeItem
80 public:
81 CComPtr<IPin> m_pPin;
82 CTreeItemPin(IPin* pPin, CTreeCtrl& tree, HTREEITEM hTIParent);
83 void Update();
84 bool ToolTip(CString& str);
85 bool IsConnected();
88 class CTreeItemResourceFolder : public CTreeItem
90 public:
91 CTreeItemResourceFolder(CTreeCtrl& tree, HTREEITEM hTIParent);
92 void Update();
93 bool ToolTip(CString& str);
96 class CTreeItemResource : public CTreeItem
98 public:
99 CDSMResource m_res;
100 CTreeItemResource(const CDSMResource& res, CTreeCtrl& tree, HTREEITEM hTIParent);
101 ~CTreeItemResource();
102 void Update();
103 bool ToolTip(CString& str);
106 class CTreeItemChapterFolder : public CTreeItem
108 public:
109 CTreeItemChapterFolder(CTreeCtrl& tree, HTREEITEM hTIParent);
110 void Update();
113 class CTreeItemChapter : public CTreeItem
115 public:
116 CDSMChapter m_chap;
117 CTreeItemChapter(const CDSMChapter& chap, CTreeCtrl& tree, HTREEITEM hTIParent);
118 void Update();
121 private:
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;
128 CString m_title;
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);
157 public:
158 CConvertDlg(CWnd* pParent = NULL); // standard constructor
159 virtual ~CConvertDlg();
161 // Dialog Data
162 enum { IDD = IDD_CONVERT_DLG };
163 CFilterTreeCtrl m_tree;
164 CString m_fn;
166 protected:
167 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
168 virtual BOOL PreTranslateMessage(MSG* pMsg);
169 virtual BOOL OnInitDialog();
170 virtual void OnOK();
172 DECLARE_MESSAGE_MAP()
174 public:
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);