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 "VSRip.h"
00027 #include <atlcoll.h>
00028 #include "..\..\..\include\winddk\devioctl.h"
00029 #include "..\..\..\include\winddk\ntddcdrm.h"
00030 #include "VSRipFileDlg.h"
00031
00032
00033
00034
00035 IMPLEMENT_DYNAMIC(CVSRipFileDlg, CVSRipPage)
00036 CVSRipFileDlg::CVSRipFileDlg(IVSFRipper* pVSFRipper, CWnd* pParent )
00037 : CVSRipPage(pVSFRipper, CVSRipFileDlg::IDD, pParent)
00038 {
00039 }
00040
00041 CVSRipFileDlg::~CVSRipFileDlg()
00042 {
00043 }
00044
00045 void CVSRipFileDlg::DoDataExchange(CDataExchange* pDX)
00046 {
00047 CVSRipPage::DoDataExchange(pDX);
00048 DDX_Text(pDX, IDC_EDIT1, m_infn);
00049 DDX_Text(pDX, IDC_EDIT2, m_outfn);
00050 DDX_Control(pDX, IDC_EDIT3, m_log);
00051 }
00052
00053 BEGIN_MESSAGE_MAP(CVSRipFileDlg, CVSRipPage)
00054 ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
00055 ON_BN_CLICKED(IDC_BUTTON2, OnBnClickedButton2)
00056 END_MESSAGE_MAP()
00057
00058 STDMETHODIMP CVSRipFileDlg::OnMessage(LPCTSTR msg)
00059 {
00060 if(CEdit* pLog = (CEdit*)CEdit::FromHandle(m_log.m_hWnd))
00061 {
00062 CString str = msg;
00063 str += _T("\r\n");
00064 int len = pLog->GetWindowTextLength();
00065 pLog->SetSel(len, len);
00066 pLog->ReplaceSel(str);
00067 }
00068
00069 return S_OK;
00070 }
00071
00072
00073
00074 void CVSRipFileDlg::OnBnClickedButton1()
00075 {
00076 CFileDialog fd(TRUE, NULL, NULL,
00077 OFN_EXPLORER|OFN_ENABLESIZING|OFN_PATHMUSTEXIST,
00078 _T("Video Title Set IFO file (*.ifo)|*.ifo|"), this, 0);
00079
00080 if(fd.DoModal() == IDOK)
00081 {
00082 m_log.SetWindowText(_T(""));
00083 m_log.SetMargins(0, 0);
00084
00085 CString fn = fd.GetPathName();
00086 if(FAILED(m_pVSFRipper->SetInput(fn))) fn.Empty();
00087 m_infn = fn;
00088
00089 UpdateData(FALSE);
00090 }
00091
00092 }
00093
00094 void CVSRipFileDlg::OnBnClickedButton2()
00095 {
00096 CString fn = m_infn.Mid(m_infn.ReverseFind('\\')+1);
00097 int i = fn.ReverseFind('.');
00098 if(i > 0) fn = fn.Left(i);
00099
00100 CFileDialog fd(FALSE, NULL, fn,
00101 OFN_EXPLORER|OFN_ENABLESIZING|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST,
00102 _T("VobSub index file (*.idx)|*.idx|"), this, 0);
00103
00104 if(fd.DoModal() == IDOK)
00105 {
00106 CString fn = fd.GetPathName();
00107 if(FAILED(m_pVSFRipper->SetOutput(fn))) fn.Empty();
00108 m_outfn = fn;
00109
00110 UpdateData(FALSE);
00111 }
00112 }