00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023 #include "afxcmn.h"
00024 #include "..\..\DSUtil\DSMPropertyBag.h"
00025
00026 class CFilterTreeCtrl : public CTreeCtrl
00027 {
00028 public:
00029 CFilterTreeCtrl();
00030
00031 protected:
00032 virtual INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
00033 virtual void PreSubclassWindow();
00034
00035 public:
00036 DECLARE_MESSAGE_MAP()
00037 afx_msg BOOL OnToolTipText(UINT nID, NMHDR* pNMHDR, LRESULT* pResult);
00038 };
00039
00040
00041
00042 class CConvertDlg : public CResizableDialog
00043 {
00044 public:
00045 class CTreeItem
00046 {
00047 protected:
00048 CTreeCtrl& m_tree;
00049 HTREEITEM m_hTI;
00050
00051 public:
00052 CTreeItem(CTreeCtrl& tree, HTREEITEM hTIParent);
00053 virtual ~CTreeItem();
00054 virtual void Update() {}
00055 virtual bool ToolTip(CString& str) {return false;}
00056 void SetLabel(LPCTSTR label);
00057 void SetImage(int nImage, int nSelectedImage);
00058 operator HTREEITEM() {return m_hTI;}
00059 };
00060
00061 class CTreeItemFilter : public CTreeItem
00062 {
00063 public:
00064 CComPtr<IBaseFilter> m_pBF;
00065 CTreeItemFilter(IBaseFilter* pBF, CTreeCtrl& tree, HTREEITEM hTIParent);
00066 void Update();
00067 };
00068
00069 class CTreeItemFile : public CTreeItemFilter
00070 {
00071 public:
00072 CString m_fn;
00073 CTreeItemFile(CString fn, IBaseFilter* pBF, CTreeCtrl& tree, HTREEITEM hTIParent);
00074 void Update();
00075 bool ToolTip(CString& str);
00076 };
00077
00078 class CTreeItemPin : public CTreeItem
00079 {
00080 public:
00081 CComPtr<IPin> m_pPin;
00082 CTreeItemPin(IPin* pPin, CTreeCtrl& tree, HTREEITEM hTIParent);
00083 void Update();
00084 bool ToolTip(CString& str);
00085 bool IsConnected();
00086 };
00087
00088 class CTreeItemResourceFolder : public CTreeItem
00089 {
00090 public:
00091 CTreeItemResourceFolder(CTreeCtrl& tree, HTREEITEM hTIParent);
00092 void Update();
00093 bool ToolTip(CString& str);
00094 };
00095
00096 class CTreeItemResource : public CTreeItem
00097 {
00098 public:
00099 CDSMResource m_res;
00100 CTreeItemResource(const CDSMResource& res, CTreeCtrl& tree, HTREEITEM hTIParent);
00101 ~CTreeItemResource();
00102 void Update();
00103 bool ToolTip(CString& str);
00104 };
00105
00106 class CTreeItemChapterFolder : public CTreeItem
00107 {
00108 public:
00109 CTreeItemChapterFolder(CTreeCtrl& tree, HTREEITEM hTIParent);
00110 void Update();
00111 };
00112
00113 class CTreeItemChapter : public CTreeItem
00114 {
00115 public:
00116 CDSMChapter m_chap;
00117 CTreeItemChapter(const CDSMChapter& chap, CTreeCtrl& tree, HTREEITEM hTIParent);
00118 void Update();
00119 };
00120
00121 private:
00122 DWORD m_dwRegister;
00123 CComPtr<ICaptureGraphBuilder2> m_pCGB;
00124 CComPtr<IGraphBuilder> m_pGB;
00125 CComPtr<IBaseFilter> m_pMux;
00126 CComQIPtr<IMediaControl> m_pMC;
00127 CComQIPtr<IMediaEventEx> m_pME;
00128 CComQIPtr<IMediaSeeking> m_pMS;
00129
00130 CString m_title;
00131 UINT m_nIDEventStatus;
00132
00133 CBitmap m_streamtypesbm;
00134 CImageList m_streamtypes;
00135
00136 CList<CTreeItem*> m_pTIs;
00137
00138 void AddFile(CString fn);
00139 bool SetOutputFile(LPCTSTR fn);
00140 void AddFilter(HTREEITEM hTI, IBaseFilter* pBF);
00141 void DeleteFilter(IBaseFilter* pBF);
00142 void DeleteItem(HTREEITEM hTI);
00143 void DeleteChildren(HTREEITEM hTI);
00144
00145 HTREEITEM HitTest(CPoint& sp, CPoint& cp);
00146
00147 void ShowPopup(CPoint p);
00148 void ShowFilePopup(HTREEITEM hTI, CPoint p);
00149 void ShowPinPopup(HTREEITEM hTI, CPoint p);
00150 void ShowResourceFolderPopup(HTREEITEM hTI, CPoint p);
00151 void ShowResourcePopup(HTREEITEM hTI, CPoint p);
00152 void ShowChapterFolderPopup(HTREEITEM hTI, CPoint p);
00153 void ShowChapterPopup(HTREEITEM hTI, CPoint p);
00154
00155 bool EditProperties(IDSMPropertyBag* pPB);
00156 bool EditResource(CTreeItemResource* t);
00157 bool EditChapter(CTreeItemChapter* t);
00158
00159 public:
00160 CConvertDlg(CWnd* pParent = NULL);
00161 virtual ~CConvertDlg();
00162
00163
00164 enum { IDD = IDD_CONVERTDIALOG };
00165 CFilterTreeCtrl m_tree;
00166 CString m_fn;
00167
00168 protected:
00169 virtual void DoDataExchange(CDataExchange* pDX);
00170 virtual BOOL PreTranslateMessage(MSG* pMsg);
00171 virtual BOOL OnInitDialog();
00172 virtual void OnOK();
00173
00174 DECLARE_MESSAGE_MAP()
00175
00176 public:
00177 afx_msg LRESULT OnGraphNotify(WPARAM wParam, LPARAM lParam);
00178 afx_msg void OnDropFiles(HDROP hDropInfo);
00179 afx_msg void OnClose();
00180 afx_msg void OnNMClickTree1(NMHDR *pNMHDR, LRESULT *pResult);
00181 afx_msg void OnNMRclickTree1(NMHDR *pNMHDR, LRESULT *pResult);
00182 afx_msg void OnNMDblclkTree1(NMHDR *pNMHDR, LRESULT *pResult);
00183 afx_msg void OnBnClickedButton1();
00184 afx_msg void OnUpdateButton1(CCmdUI* pCmdUI);
00185 afx_msg void OnTimer(UINT nIDEvent);
00186 afx_msg void OnBnClickedButton2();
00187 afx_msg void OnBnClickedButton3();
00188 afx_msg void OnBnClickedButton4();
00189 afx_msg void OnUpdateButton2(CCmdUI* pCmdUI);
00190 afx_msg void OnUpdateButton3(CCmdUI* pCmdUI);
00191 afx_msg void OnUpdateButton4(CCmdUI* pCmdUI);
00192 };