00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "stdafx.h"
00026 #include "mplayerc.h"
00027 #include "PPageFileInfoClip.h"
00028 #include <atlbase.h>
00029 #include <qnetwork.h>
00030 #include "..\..\DSUtil\DSUtil.h"
00031
00032
00033
00034 IMPLEMENT_DYNAMIC(CPPageFileInfoClip, CPropertyPage)
00035 CPPageFileInfoClip::CPPageFileInfoClip(CString fn, IFilterGraph* pFG)
00036 : CPropertyPage(CPPageFileInfoClip::IDD, CPPageFileInfoClip::IDD)
00037 , m_fn(fn)
00038 , m_pFG(pFG)
00039 , m_clip(_T("None"))
00040 , m_author(_T("None"))
00041 , m_copyright(_T("None"))
00042 , m_rating(_T("None"))
00043 , m_location(_T("None"))
00044 , m_hIcon(NULL)
00045 {
00046 }
00047
00048 CPPageFileInfoClip::~CPPageFileInfoClip()
00049 {
00050 if(m_hIcon) DestroyIcon(m_hIcon);
00051 }
00052
00053 void CPPageFileInfoClip::DoDataExchange(CDataExchange* pDX)
00054 {
00055 __super::DoDataExchange(pDX);
00056 DDX_Control(pDX, IDC_DEFAULTICON, m_icon);
00057 DDX_Text(pDX, IDC_EDIT1, m_fn);
00058 DDX_Text(pDX, IDC_EDIT4, m_clip);
00059 DDX_Text(pDX, IDC_EDIT3, m_author);
00060 DDX_Text(pDX, IDC_EDIT2, m_copyright);
00061 DDX_Text(pDX, IDC_EDIT5, m_rating);
00062 DDX_Text(pDX, IDC_EDIT6, m_location);
00063 DDX_Control(pDX, IDC_EDIT7, m_desc);
00064 }
00065
00066 BEGIN_MESSAGE_MAP(CPPageFileInfoClip, CPropertyPage)
00067 END_MESSAGE_MAP()
00068
00069
00070
00071
00072 BOOL CPPageFileInfoClip::OnInitDialog()
00073 {
00074 __super::OnInitDialog();
00075
00076 if(m_hIcon = LoadIcon(m_fn, false))
00077 m_icon.SetIcon(m_hIcon);
00078
00079 m_fn.TrimRight('/');
00080 int i = max(m_fn.ReverseFind('\\'), m_fn.ReverseFind('/'));
00081 if(i >= 0 && i < m_fn.GetLength()-1)
00082 {
00083 m_location = m_fn.Left(i);
00084 m_fn = m_fn.Mid(i+1);
00085
00086 if(m_location.GetLength() == 2 && m_location[1] == ':')
00087 m_location += '\\';
00088 }
00089
00090 bool fEmpty = true;
00091 BeginEnumFilters(m_pFG, pEF, pBF)
00092 {
00093 if(CComQIPtr<IAMMediaContent, &IID_IAMMediaContent> pAMMC = pBF)
00094 {
00095 CComBSTR bstr;
00096 if(SUCCEEDED(pAMMC->get_Title(&bstr)) && wcslen(bstr.m_str) > 0) {m_clip = bstr.m_str; fEmpty = false;}
00097 if(SUCCEEDED(pAMMC->get_AuthorName(&bstr)) && wcslen(bstr.m_str) > 0) {m_author = bstr.m_str; fEmpty = false;}
00098 if(SUCCEEDED(pAMMC->get_Copyright(&bstr)) && wcslen(bstr.m_str) > 0) {m_copyright = bstr.m_str; fEmpty = false;}
00099 if(SUCCEEDED(pAMMC->get_Rating(&bstr)) && wcslen(bstr.m_str) > 0) {m_rating = bstr.m_str; fEmpty = false;}
00100 if(SUCCEEDED(pAMMC->get_Description(&bstr)) && wcslen(bstr.m_str) > 0) {m_desc.SetWindowText(CString(bstr.m_str)); fEmpty = false;}
00101 if(!fEmpty) break;
00102 }
00103 }
00104 EndEnumFilters
00105
00106 UpdateData(FALSE);
00107
00108 return TRUE;
00109
00110 }