diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2010-04-09 18:12:59 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2010-04-09 18:12:59 +0400 |
commit | efbc9d9043ff8ff92716ddd00a5f61412d535593 (patch) | |
tree | 8f3e621f756cf1f5b4d64d97964c7e7abd8aaf08 /src/apps/vsrip | |
parent | df6b139a6d9027156f614b68687e039e3a5854db (diff) |
revert r1783
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1785 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/vsrip')
-rw-r--r-- | src/apps/vsrip/VSRip.cpp | 54 | ||||
-rw-r--r-- | src/apps/vsrip/VSRip.h | 10 | ||||
-rw-r--r-- | src/apps/vsrip/VSRipDlg.cpp | 388 | ||||
-rw-r--r-- | src/apps/vsrip/VSRipDlg.h | 52 | ||||
-rw-r--r-- | src/apps/vsrip/VSRipFileDlg.cpp | 90 | ||||
-rw-r--r-- | src/apps/vsrip/VSRipFileDlg.h | 48 | ||||
-rw-r--r-- | src/apps/vsrip/VSRipIndexingDlg.cpp | 174 | ||||
-rw-r--r-- | src/apps/vsrip/VSRipIndexingDlg.h | 74 | ||||
-rw-r--r-- | src/apps/vsrip/VSRipPGCDlg.cpp | 274 | ||||
-rw-r--r-- | src/apps/vsrip/VSRipPGCDlg.h | 67 | ||||
-rw-r--r-- | src/apps/vsrip/VSRipPage.cpp | 14 | ||||
-rw-r--r-- | src/apps/vsrip/VSRipPage.h | 60 | ||||
-rw-r--r-- | src/apps/vsrip/resource.h | 2 | ||||
-rw-r--r-- | src/apps/vsrip/stdafx.h | 2 |
14 files changed, 623 insertions, 686 deletions
diff --git a/src/apps/vsrip/VSRip.cpp b/src/apps/vsrip/VSRip.cpp index de44d4836..04ee79a9a 100644 --- a/src/apps/vsrip/VSRip.cpp +++ b/src/apps/vsrip/VSRip.cpp @@ -32,7 +32,7 @@ // CVSRipApp
BEGIN_MESSAGE_MAP(CVSRipApp, CWinApp)
- ON_COMMAND(ID_HELP, CWinApp::OnHelp)
+ ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
@@ -40,8 +40,8 @@ END_MESSAGE_MAP() CVSRipApp::CVSRipApp()
{
- // TODO: add construction code here,
- // Place all significant initialization in InitInstance
+ // TODO: add construction code here,
+ // Place all significant initialization in InitInstance
}
@@ -53,28 +53,28 @@ CVSRipApp theApp; BOOL CVSRipApp::InitInstance()
{
- // InitCommonControls() is required on Windows XP if an application
- // manifest specifies use of ComCtl32.dll version 6 or later to enable
- // visual styles. Otherwise, any window creation will fail.
- InitCommonControls();
-
- CWinApp::InitInstance();
-
- CVSRipDlg dlg;
- m_pMainWnd = &dlg;
- INT_PTR nResponse = dlg.DoModal();
- if(nResponse == IDOK)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with OK
- }
- else if(nResponse == IDCANCEL)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with Cancel
- }
-
- // Since the dialog has been closed, return FALSE so that we exit the
- // application, rather than start the application's message pump.
- return FALSE;
+ // InitCommonControls() is required on Windows XP if an application
+ // manifest specifies use of ComCtl32.dll version 6 or later to enable
+ // visual styles. Otherwise, any window creation will fail.
+ InitCommonControls();
+
+ CWinApp::InitInstance();
+
+ CVSRipDlg dlg;
+ m_pMainWnd = &dlg;
+ INT_PTR nResponse = dlg.DoModal();
+ if (nResponse == IDOK)
+ {
+ // TODO: Place code here to handle when the dialog is
+ // dismissed with OK
+ }
+ else if (nResponse == IDCANCEL)
+ {
+ // TODO: Place code here to handle when the dialog is
+ // dismissed with Cancel
+ }
+
+ // Since the dialog has been closed, return FALSE so that we exit the
+ // application, rather than start the application's message pump.
+ return FALSE;
}
diff --git a/src/apps/vsrip/VSRip.h b/src/apps/vsrip/VSRip.h index 8c2128bf9..4d2cd042d 100644 --- a/src/apps/vsrip/VSRip.h +++ b/src/apps/vsrip/VSRip.h @@ -23,7 +23,7 @@ #pragma once
#ifndef __AFXWIN_H__
-#error include 'stdafx.h' before including this file for PCH
+ #error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
@@ -36,15 +36,15 @@ class CVSRipApp : public CWinApp
{
public:
- CVSRipApp();
+ CVSRipApp();
// Overrides
-public:
- virtual BOOL InitInstance();
+ public:
+ virtual BOOL InitInstance();
// Implementation
- DECLARE_MESSAGE_MAP()
+ DECLARE_MESSAGE_MAP()
};
extern CVSRipApp theApp;
\ No newline at end of file diff --git a/src/apps/vsrip/VSRipDlg.cpp b/src/apps/vsrip/VSRipDlg.cpp index 24a569b39..1fe865bbb 100644 --- a/src/apps/vsrip/VSRipDlg.cpp +++ b/src/apps/vsrip/VSRipDlg.cpp @@ -33,278 +33,278 @@ // CVSRipDlg dialog
CVSRipDlg::CVSRipDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CVSRipDlg::IDD, pParent)
+ : CDialog(CVSRipDlg::IDD, pParent)
{
- m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
- m_dlgpos = NULL;
+ m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
+ m_dlgpos = NULL;
- m_pVSFRipper = new CVobSubFileRipper();
+ m_pVSFRipper = new CVobSubFileRipper();
}
CVSRipDlg::~CVSRipDlg()
{
- m_pVSFRipper->SetCallBack(NULL);
+ m_pVSFRipper->SetCallBack(NULL);
}
void CVSRipDlg::DoDataExchange(CDataExchange* pDX)
{
- CDialog::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_DLGRECT, m_dlgrect);
- DDX_Control(pDX, IDC_HEADERSEP, m_hdrline);
- DDX_Control(pDX, IDC_FOOTERSEP, m_ftrline);
+ CDialog::DoDataExchange(pDX);
+ DDX_Control(pDX, IDC_DLGRECT, m_dlgrect);
+ DDX_Control(pDX, IDC_HEADERSEP, m_hdrline);
+ DDX_Control(pDX, IDC_FOOTERSEP, m_ftrline);
}
void CVSRipDlg::ShowNext()
{
- POSITION prev = m_dlgpos;
- m_dlgpos = GetNext();
-
- if(prev && prev != m_dlgpos)
- {
- m_dlgs.GetAt(prev)->OnNext();
- m_dlgs.GetAt(prev)->ShowWindow(SW_HIDE);
- }
-
- if(m_dlgpos)
- {
- CVSRipPage* pDlg = m_dlgs.GetAt(m_dlgpos);
- CRect dr;
- m_dlgrect.GetClientRect(dr);
- m_dlgrect.MapWindowPoints(this, dr);
- pDlg->MoveWindow(dr);
- pDlg->ShowWindow(SW_SHOWNORMAL);
- Invalidate();
- }
+ POSITION prev = m_dlgpos;
+ m_dlgpos = GetNext();
+
+ if(prev && prev != m_dlgpos)
+ {
+ m_dlgs.GetAt(prev)->OnNext();
+ m_dlgs.GetAt(prev)->ShowWindow(SW_HIDE);
+ }
+
+ if(m_dlgpos)
+ {
+ CVSRipPage* pDlg = m_dlgs.GetAt(m_dlgpos);
+ CRect dr;
+ m_dlgrect.GetClientRect(dr);
+ m_dlgrect.MapWindowPoints(this, dr);
+ pDlg->MoveWindow(dr);
+ pDlg->ShowWindow(SW_SHOWNORMAL);
+ Invalidate();
+ }
}
void CVSRipDlg::ShowPrev()
{
- POSITION next = m_dlgpos;
- m_dlgpos = GetPrev();
-
- if(next && next != m_dlgpos)
- {
- m_dlgs.GetAt(next)->OnPrev();
- m_dlgs.GetAt(next)->ShowWindow(SW_HIDE);
- }
-
- if(m_dlgpos)
- {
- CVSRipPage* pDlg = m_dlgs.GetAt(m_dlgpos);
- CRect dr;
- m_dlgrect.GetClientRect(dr);
- m_dlgrect.MapWindowPoints(this, dr);
- pDlg->MoveWindow(dr);
- pDlg->ShowWindow(SW_SHOWNORMAL);
- Invalidate();
- }
+ POSITION next = m_dlgpos;
+ m_dlgpos = GetPrev();
+
+ if(next && next != m_dlgpos)
+ {
+ m_dlgs.GetAt(next)->OnPrev();
+ m_dlgs.GetAt(next)->ShowWindow(SW_HIDE);
+ }
+
+ if(m_dlgpos)
+ {
+ CVSRipPage* pDlg = m_dlgs.GetAt(m_dlgpos);
+ CRect dr;
+ m_dlgrect.GetClientRect(dr);
+ m_dlgrect.MapWindowPoints(this, dr);
+ pDlg->MoveWindow(dr);
+ pDlg->ShowWindow(SW_SHOWNORMAL);
+ Invalidate();
+ }
}
POSITION CVSRipDlg::GetNext()
{
- POSITION pos = m_dlgpos;
- if(pos && m_dlgs.GetAt(pos)->CanGoNext()) m_dlgs.GetNext(pos);
- else if(pos && !m_dlgs.GetAt(pos)->CanGoNext()) pos = NULL;
- else pos = m_dlgs.GetHeadPosition();
- return(pos);
+ POSITION pos = m_dlgpos;
+ if(pos && m_dlgs.GetAt(pos)->CanGoNext()) m_dlgs.GetNext(pos);
+ else if(pos && !m_dlgs.GetAt(pos)->CanGoNext()) pos = NULL;
+ else pos = m_dlgs.GetHeadPosition();
+ return(pos);
}
POSITION CVSRipDlg::GetPrev()
{
- POSITION pos = m_dlgpos;
- if(pos && m_dlgs.GetAt(pos)->CanGoPrev()) m_dlgs.GetPrev(pos);
- else if(pos && !m_dlgs.GetAt(pos)->CanGoPrev()) pos = NULL;
- else pos = m_dlgs.GetTailPosition();
- return(pos);
+ POSITION pos = m_dlgpos;
+ if(pos && m_dlgs.GetAt(pos)->CanGoPrev()) m_dlgs.GetPrev(pos);
+ else if(pos && !m_dlgs.GetAt(pos)->CanGoPrev()) pos = NULL;
+ else pos = m_dlgs.GetTailPosition();
+ return(pos);
}
BEGIN_MESSAGE_MAP(CVSRipDlg, CDialog)
- ON_WM_PAINT()
- ON_WM_QUERYDRAGICON()
- ON_MESSAGE_VOID(WM_KICKIDLE, OnKickIdle)
- ON_BN_CLICKED(IDC_BUTTON1, OnPrev)
- ON_UPDATE_COMMAND_UI(IDC_BUTTON1, OnUpdatePrev)
- ON_BN_CLICKED(IDC_BUTTON2, OnNext)
- ON_UPDATE_COMMAND_UI(IDC_BUTTON2, OnUpdateNext)
- ON_BN_CLICKED(IDCANCEL, OnClose)
- ON_UPDATE_COMMAND_UI(IDCANCEL, OnUpdateClose)
+ ON_WM_PAINT()
+ ON_WM_QUERYDRAGICON()
+ ON_MESSAGE_VOID(WM_KICKIDLE, OnKickIdle)
+ ON_BN_CLICKED(IDC_BUTTON1, OnPrev)
+ ON_UPDATE_COMMAND_UI(IDC_BUTTON1, OnUpdatePrev)
+ ON_BN_CLICKED(IDC_BUTTON2, OnNext)
+ ON_UPDATE_COMMAND_UI(IDC_BUTTON2, OnUpdateNext)
+ ON_BN_CLICKED(IDCANCEL, OnClose)
+ ON_UPDATE_COMMAND_UI(IDCANCEL, OnUpdateClose)
END_MESSAGE_MAP()
// CVSRipDlg message handlers
BOOL CVSRipDlg::OnInitDialog()
{
- CDialog::OnInitDialog();
-
- // Set the icon for this dialog. The framework does this automatically
- // when the application's main window is not a dialog
- SetIcon(m_hIcon, TRUE); // Set big icon
- SetIcon(m_hIcon, FALSE); // Set small icon
-
- if(CMenu* pSysMenu = GetSystemMenu(FALSE))
- {
- pSysMenu->RemoveMenu(SC_SIZE, MF_BYCOMMAND);
- pSysMenu->RemoveMenu(SC_MAXIMIZE, MF_BYCOMMAND);
- }
-
- CRect cr;
- GetClientRect(cr);
- CRect r;
- m_hdrline.GetClientRect(r);
- m_hdrline.MapWindowPoints(this, r);
- r.left = 0;
- r.right = cr.right;
- r.bottom += 2;
- m_hdrline.MoveWindow(r);
- m_ftrline.GetClientRect(r);
- m_ftrline.MapWindowPoints(this, r);
- r.left = 0;
- r.right = cr.right;
- r.bottom += 2;
- m_ftrline.MoveWindow(r);
-
- m_pVSFRipper = new CVobSubFileRipper();
-
- CAutoPtr<CVSRipPage> pPage;
-
- pPage.Attach(new CVSRipFileDlg(m_pVSFRipper));
- pPage->Create(CVSRipFileDlg::IDD, this);
- m_dlgs.AddTail(pPage);
-
- pPage.Attach(new CVSRipPGCDlg(m_pVSFRipper));
- pPage->Create(CVSRipPGCDlg::IDD, this);
- m_dlgs.AddTail(pPage);
-
- pPage.Attach(new CVSRipIndexingDlg(m_pVSFRipper));
- pPage->Create(CVSRipIndexingDlg::IDD, this);
- m_dlgs.AddTail(pPage);
-
- if(__argc > 1)
- {
- m_pVSFRipper->SetCallBack((IVSFRipperCallback*)m_dlgs.GetTail());
-
- if(S_OK != m_pVSFRipper->LoadParamFile(CString(__targv[1])))
- {
- AfxMessageBox(_T("Error parsing parameter file!"), MB_OK);
- EndDialog(IDCANCEL);
- return FALSE;
- }
-
- ShowPrev();
- }
- else
- {
+ CDialog::OnInitDialog();
+
+ // Set the icon for this dialog. The framework does this automatically
+ // when the application's main window is not a dialog
+ SetIcon(m_hIcon, TRUE); // Set big icon
+ SetIcon(m_hIcon, FALSE); // Set small icon
+
+ if(CMenu* pSysMenu = GetSystemMenu(FALSE))
+ {
+ pSysMenu->RemoveMenu(SC_SIZE, MF_BYCOMMAND);
+ pSysMenu->RemoveMenu(SC_MAXIMIZE, MF_BYCOMMAND);
+ }
+
+ CRect cr;
+ GetClientRect(cr);
+ CRect r;
+ m_hdrline.GetClientRect(r);
+ m_hdrline.MapWindowPoints(this, r);
+ r.left = 0;
+ r.right = cr.right;
+ r.bottom+=2;
+ m_hdrline.MoveWindow(r);
+ m_ftrline.GetClientRect(r);
+ m_ftrline.MapWindowPoints(this, r);
+ r.left = 0;
+ r.right = cr.right;
+ r.bottom+=2;
+ m_ftrline.MoveWindow(r);
+
+ m_pVSFRipper = new CVobSubFileRipper();
+
+ CAutoPtr<CVSRipPage> pPage;
+
+ pPage.Attach(new CVSRipFileDlg(m_pVSFRipper));
+ pPage->Create(CVSRipFileDlg::IDD, this);
+ m_dlgs.AddTail(pPage);
+
+ pPage.Attach(new CVSRipPGCDlg(m_pVSFRipper));
+ pPage->Create(CVSRipPGCDlg::IDD, this);
+ m_dlgs.AddTail(pPage);
+
+ pPage.Attach(new CVSRipIndexingDlg(m_pVSFRipper));
+ pPage->Create(CVSRipIndexingDlg::IDD, this);
+ m_dlgs.AddTail(pPage);
+
+ if(__argc > 1)
+ {
+ m_pVSFRipper->SetCallBack((IVSFRipperCallback*)m_dlgs.GetTail());
+
+ if(S_OK != m_pVSFRipper->LoadParamFile(CString(__targv[1])))
+ {
+ AfxMessageBox(_T("Error parsing parameter file!"), MB_OK);
+ EndDialog(IDCANCEL);
+ return FALSE;
+ }
+
+ ShowPrev();
+ }
+ else
+ {
ShowNext();
- }
+ }
- return TRUE; // return TRUE unless you set the focus to a control
+ return TRUE; // return TRUE unless you set the focus to a control
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
-void CVSRipDlg::OnPaint()
+void CVSRipDlg::OnPaint()
{
- if(IsIconic())
- {
- CPaintDC dc(this); // device context for painting
-
- SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
-
- // Center icon in client rectangle
- int cxIcon = GetSystemMetrics(SM_CXICON);
- int cyIcon = GetSystemMetrics(SM_CYICON);
- CRect rect;
- GetClientRect(&rect);
- int x = (rect.Width() - cxIcon + 1) / 2;
- int y = (rect.Height() - cyIcon + 1) / 2;
-
- // Draw the icon
- dc.DrawIcon(x, y, m_hIcon);
- }
- else
- {
- CPaintDC dc(this); // device context for painting
-
- CWnd* pHdrSep = GetDlgItem(IDC_HEADERSEP);
- CRect r;
- m_hdrline.GetClientRect(r);
- m_hdrline.MapWindowPoints(this, r);
- CRect cr;
- GetClientRect(cr);
- dc.FillSolidRect(CRect(0, 0, cr.right, r.top), 0xffffff);
-
- if(m_dlgpos)
- {
- CVSRipPage* pWnd = m_dlgs.GetAt(m_dlgpos);
- CFont hdrfont, descfont;
- hdrfont.CreateFont(16, 0, 0, 0, FW_BOLD, 0, 0, 0, DEFAULT_CHARSET,
- OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH,
- _T("Times New Roman"));
- descfont.CreateFont(14, 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET,
- OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH,
- _T("Arial"));
- CFont* pOld = dc.SelectObject(&hdrfont);
- dc.DrawText(pWnd->GetHeaderText(), CRect(10, 5, cr.right, r.top), DT_WORDBREAK);
- dc.SelectObject(&descfont);
- dc.DrawText(pWnd->GetDescText(), CRect(20, 22, cr.right, r.top), DT_WORDBREAK);
- dc.SelectObject(pOld);
- }
-
- CDialog::OnPaint();
- }
+ if (IsIconic())
+ {
+ CPaintDC dc(this); // device context for painting
+
+ SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
+
+ // Center icon in client rectangle
+ int cxIcon = GetSystemMetrics(SM_CXICON);
+ int cyIcon = GetSystemMetrics(SM_CYICON);
+ CRect rect;
+ GetClientRect(&rect);
+ int x = (rect.Width() - cxIcon + 1) / 2;
+ int y = (rect.Height() - cyIcon + 1) / 2;
+
+ // Draw the icon
+ dc.DrawIcon(x, y, m_hIcon);
+ }
+ else
+ {
+ CPaintDC dc(this); // device context for painting
+
+ CWnd* pHdrSep = GetDlgItem(IDC_HEADERSEP);
+ CRect r;
+ m_hdrline.GetClientRect(r);
+ m_hdrline.MapWindowPoints(this, r);
+ CRect cr;
+ GetClientRect(cr);
+ dc.FillSolidRect(CRect(0,0,cr.right,r.top), 0xffffff);
+
+ if(m_dlgpos)
+ {
+ CVSRipPage* pWnd = m_dlgs.GetAt(m_dlgpos);
+ CFont hdrfont, descfont;
+ hdrfont.CreateFont(16,0,0,0,FW_BOLD,0,0,0,DEFAULT_CHARSET,
+ OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,ANTIALIASED_QUALITY,DEFAULT_PITCH,
+ _T("Times New Roman"));
+ descfont.CreateFont(14,0,0,0,FW_NORMAL,0,0,0,DEFAULT_CHARSET,
+ OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,ANTIALIASED_QUALITY,DEFAULT_PITCH,
+ _T("Arial"));
+ CFont* pOld = dc.SelectObject(&hdrfont);
+ dc.DrawText(pWnd->GetHeaderText(), CRect(10,5,cr.right,r.top), DT_WORDBREAK);
+ dc.SelectObject(&descfont);
+ dc.DrawText(pWnd->GetDescText(), CRect(20,22,cr.right,r.top), DT_WORDBREAK);
+ dc.SelectObject(pOld);
+ }
+
+ CDialog::OnPaint();
+ }
}
void CVSRipDlg::OnKickIdle()
{
- UpdateDialogControls(this, false);
+ UpdateDialogControls(this, false);
- for(CWnd* pChild = GetWindow(GW_CHILD); pChild; pChild = pChild->GetNextWindow())
- {
- if(pChild->IsKindOf(RUNTIME_CLASS(CVSRipPage)))
- pChild->UpdateDialogControls(pChild, false);
- }
+ for(CWnd* pChild = GetWindow(GW_CHILD); pChild; pChild = pChild->GetNextWindow())
+ {
+ if(pChild->IsKindOf(RUNTIME_CLASS(CVSRipPage)))
+ pChild->UpdateDialogControls(pChild, false);
+ }
}
// The system calls this function to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CVSRipDlg::OnQueryDragIcon()
{
- return static_cast<HCURSOR>(m_hIcon);
+ return static_cast<HCURSOR>(m_hIcon);
}
void CVSRipDlg::OnPrev()
{
- ShowPrev();
+ ShowPrev();
}
void CVSRipDlg::OnUpdatePrev(CCmdUI* pCmdUI)
{
- if(m_dlgpos) pCmdUI->SetText(m_dlgs.GetAt(m_dlgpos)->GetPrevText());
- pCmdUI->Enable(!!GetPrev());
+ if(m_dlgpos) pCmdUI->SetText(m_dlgs.GetAt(m_dlgpos)->GetPrevText());
+ pCmdUI->Enable(!!GetPrev());
}
void CVSRipDlg::OnNext()
{
- ShowNext();
+ ShowNext();
}
void CVSRipDlg::OnUpdateNext(CCmdUI* pCmdUI)
{
- if(m_dlgpos) pCmdUI->SetText(m_dlgs.GetAt(m_dlgpos)->GetNextText());
- pCmdUI->Enable(!!GetNext());
+ if(m_dlgpos) pCmdUI->SetText(m_dlgs.GetAt(m_dlgpos)->GetNextText());
+ pCmdUI->Enable(!!GetNext());
}
void CVSRipDlg::OnClose()
{
- if(m_dlgpos) m_dlgs.GetAt(m_dlgpos)->OnClose();
+ if(m_dlgpos) m_dlgs.GetAt(m_dlgpos)->OnClose();
- OnCancel();
+ OnCancel();
}
void CVSRipDlg::OnUpdateClose(CCmdUI* pCmdUI)
{
- if(m_dlgpos) pCmdUI->SetText(m_dlgs.GetAt(m_dlgpos)->GetCloseText());
- pCmdUI->Enable(!m_dlgpos || m_dlgs.GetAt(m_dlgpos)->CanClose());
+ if(m_dlgpos) pCmdUI->SetText(m_dlgs.GetAt(m_dlgpos)->GetCloseText());
+ pCmdUI->Enable(!m_dlgpos || m_dlgs.GetAt(m_dlgpos)->CanClose());
}
diff --git a/src/apps/vsrip/VSRipDlg.h b/src/apps/vsrip/VSRipDlg.h index f43f421b6..473b245ec 100644 --- a/src/apps/vsrip/VSRipDlg.h +++ b/src/apps/vsrip/VSRipDlg.h @@ -31,42 +31,42 @@ class CVSRipDlg : public CDialog {
// Construction
public:
- CVSRipDlg(CWnd* pParent = NULL); // standard constructor
- virtual ~CVSRipDlg();
+ CVSRipDlg(CWnd* pParent = NULL); // standard constructor
+ virtual ~CVSRipDlg();
// Dialog Data
- enum { IDD = IDD_VSRIP_DIALOG };
+ enum { IDD = IDD_VSRIP_DIALOG };
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- virtual BOOL OnInitDialog();
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ virtual BOOL OnInitDialog();
// Implementation
protected:
- HICON m_hIcon;
+ HICON m_hIcon;
- CStatic m_dlgrect;
- CStatic m_hdrline;
+ CStatic m_dlgrect;
+ CStatic m_hdrline;
- CAutoPtrList<CVSRipPage> m_dlgs;
- POSITION m_dlgpos;
- void ShowNext(), ShowPrev();
- POSITION GetNext(), GetPrev();
+ CAutoPtrList<CVSRipPage> m_dlgs;
+ POSITION m_dlgpos;
+ void ShowNext(), ShowPrev();
+ POSITION GetNext(), GetPrev();
- CComPtr<IVSFRipper> m_pVSFRipper;
+ CComPtr<IVSFRipper> m_pVSFRipper;
- // Generated message map functions
- DECLARE_MESSAGE_MAP()
+ // Generated message map functions
+ DECLARE_MESSAGE_MAP()
public:
- afx_msg void OnPaint();
- afx_msg void OnKickIdle();
- afx_msg HCURSOR OnQueryDragIcon();
- afx_msg void OnPrev();
- afx_msg void OnUpdatePrev(CCmdUI* pCmdUI);
- afx_msg void OnNext();
- afx_msg void OnUpdateNext(CCmdUI* pCmdUI);
- afx_msg void OnClose();
- afx_msg void OnUpdateClose(CCmdUI* pCmdUI);
- CStatic m_ftrline;
+ afx_msg void OnPaint();
+ afx_msg void OnKickIdle();
+ afx_msg HCURSOR OnQueryDragIcon();
+ afx_msg void OnPrev();
+ afx_msg void OnUpdatePrev(CCmdUI* pCmdUI);
+ afx_msg void OnNext();
+ afx_msg void OnUpdateNext(CCmdUI* pCmdUI);
+ afx_msg void OnClose();
+ afx_msg void OnUpdateClose(CCmdUI* pCmdUI);
+ CStatic m_ftrline;
};
diff --git a/src/apps/vsrip/VSRipFileDlg.cpp b/src/apps/vsrip/VSRipFileDlg.cpp index f18a711d0..36b8903a4 100644 --- a/src/apps/vsrip/VSRipFileDlg.cpp +++ b/src/apps/vsrip/VSRipFileDlg.cpp @@ -32,7 +32,7 @@ IMPLEMENT_DYNAMIC(CVSRipFileDlg, CVSRipPage)
CVSRipFileDlg::CVSRipFileDlg(IVSFRipper* pVSFRipper, CWnd* pParent /*=NULL*/)
- : CVSRipPage(pVSFRipper, CVSRipFileDlg::IDD, pParent)
+ : CVSRipPage(pVSFRipper, CVSRipFileDlg::IDD, pParent)
{
}
@@ -42,69 +42,69 @@ CVSRipFileDlg::~CVSRipFileDlg() void CVSRipFileDlg::DoDataExchange(CDataExchange* pDX)
{
- CVSRipPage::DoDataExchange(pDX);
- DDX_Text(pDX, IDC_EDIT1, m_infn);
- DDX_Text(pDX, IDC_EDIT2, m_outfn);
- DDX_Control(pDX, IDC_EDIT3, m_log);
+ CVSRipPage::DoDataExchange(pDX);
+ DDX_Text(pDX, IDC_EDIT1, m_infn);
+ DDX_Text(pDX, IDC_EDIT2, m_outfn);
+ DDX_Control(pDX, IDC_EDIT3, m_log);
}
BEGIN_MESSAGE_MAP(CVSRipFileDlg, CVSRipPage)
- ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
- ON_BN_CLICKED(IDC_BUTTON2, OnBnClickedButton2)
+ ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
+ ON_BN_CLICKED(IDC_BUTTON2, OnBnClickedButton2)
END_MESSAGE_MAP()
STDMETHODIMP CVSRipFileDlg::OnMessage(LPCTSTR msg)
{
- if(CEdit* pLog = (CEdit*)CEdit::FromHandle(m_log.m_hWnd))
- {
- CString str = msg;
- str += _T("\r\n");
- int len = pLog->GetWindowTextLength();
- pLog->SetSel(len, len);
- pLog->ReplaceSel(str);
- }
-
- return S_OK;
+ if(CEdit* pLog = (CEdit*)CEdit::FromHandle(m_log.m_hWnd))
+ {
+ CString str = msg;
+ str += _T("\r\n");
+ int len = pLog->GetWindowTextLength();
+ pLog->SetSel(len, len);
+ pLog->ReplaceSel(str);
+ }
+
+ return S_OK;
}
// CVSRipFileDlg message handlers
void CVSRipFileDlg::OnBnClickedButton1()
{
- CFileDialog fd(TRUE, NULL, NULL,
- OFN_EXPLORER | OFN_ENABLESIZING | OFN_PATHMUSTEXIST,
- _T("Video Title Set IFO file (*.ifo)|*.ifo|"), this, 0);
+ CFileDialog fd(TRUE, NULL, NULL,
+ OFN_EXPLORER|OFN_ENABLESIZING|OFN_PATHMUSTEXIST,
+ _T("Video Title Set IFO file (*.ifo)|*.ifo|"), this, 0);
- if(fd.DoModal() == IDOK)
- {
- m_log.SetWindowText(_T(""));
- m_log.SetMargins(0, 0);
+ if(fd.DoModal() == IDOK)
+ {
+ m_log.SetWindowText(_T(""));
+ m_log.SetMargins(0, 0);
- CString fn = fd.GetPathName();
- if(FAILED(m_pVSFRipper->SetInput(fn))) fn.Empty();
- m_infn = fn;
+ CString fn = fd.GetPathName();
+ if(FAILED(m_pVSFRipper->SetInput(fn))) fn.Empty();
+ m_infn = fn;
- UpdateData(FALSE);
- }
+ UpdateData(FALSE);
+ }
}
void CVSRipFileDlg::OnBnClickedButton2()
{
- CString fn = m_infn.Mid(m_infn.ReverseFind('\\') + 1);
- int i = fn.ReverseFind('.');
- if(i > 0) fn = fn.Left(i);
-
- CFileDialog fd(FALSE, NULL, fn,
- OFN_EXPLORER | OFN_ENABLESIZING | OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST,
- _T("VobSub index file (*.idx)|*.idx|"), this, 0);
-
- if(fd.DoModal() == IDOK)
- {
- CString fn = fd.GetPathName();
- if(FAILED(m_pVSFRipper->SetOutput(fn))) fn.Empty();
- m_outfn = fn;
-
- UpdateData(FALSE);
- }
+ CString fn = m_infn.Mid(m_infn.ReverseFind('\\')+1);
+ int i = fn.ReverseFind('.');
+ if(i > 0) fn = fn.Left(i);
+
+ CFileDialog fd(FALSE, NULL, fn,
+ OFN_EXPLORER|OFN_ENABLESIZING|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST,
+ _T("VobSub index file (*.idx)|*.idx|"), this, 0);
+
+ if(fd.DoModal() == IDOK)
+ {
+ CString fn = fd.GetPathName();
+ if(FAILED(m_pVSFRipper->SetOutput(fn))) fn.Empty();
+ m_outfn = fn;
+
+ UpdateData(FALSE);
+ }
}
diff --git a/src/apps/vsrip/VSRipFileDlg.h b/src/apps/vsrip/VSRipFileDlg.h index ab21a7c64..6acbbc229 100644 --- a/src/apps/vsrip/VSRipFileDlg.h +++ b/src/apps/vsrip/VSRipFileDlg.h @@ -29,46 +29,34 @@ class CVSRipFileDlg : public CVSRipPage
{
- DECLARE_DYNAMIC(CVSRipFileDlg)
+ DECLARE_DYNAMIC(CVSRipFileDlg)
protected:
- // IVSFRipperCallback
- STDMETHODIMP OnMessage(LPCTSTR msg);
+ // IVSFRipperCallback
+ STDMETHODIMP OnMessage(LPCTSTR msg);
public:
- CVSRipFileDlg(IVSFRipper* pVSFRipper, CWnd* pParent = NULL); // standard constructor
- virtual ~CVSRipFileDlg();
+ CVSRipFileDlg(IVSFRipper* pVSFRipper, CWnd* pParent = NULL); // standard constructor
+ virtual ~CVSRipFileDlg();
- virtual bool CanGoPrev()
- {
- return(false);
- }
- virtual bool CanGoNext()
- {
- return(!m_infn.IsEmpty() && !m_outfn.IsEmpty());
- }
- virtual CString GetHeaderText()
- {
- return(_T("Select input and output"));
- }
- virtual CString GetDescText()
- {
- return(_T("First choose a video title set ifo, then select an ")
- _T("output path for the idx/sub files. Make sure the vob files ")
- _T("have some standard naming, this util can't read your mind."));
- }
+ virtual bool CanGoPrev() {return(false);}
+ virtual bool CanGoNext() {return(!m_infn.IsEmpty() && !m_outfn.IsEmpty());}
+ virtual CString GetHeaderText() {return(_T("Select input and output"));}
+ virtual CString GetDescText() {return(_T("First choose a video title set ifo, then select an ")
+ _T("output path for the idx/sub files. Make sure the vob files ")
+ _T("have some standard naming, this util can't read your mind."));}
// Dialog Data
- enum { IDD = IDD_DIALOG_FILE };
- CEdit m_log;
- CString m_infn, m_outfn;
+ enum { IDD = IDD_DIALOG_FILE };
+ CEdit m_log;
+ CString m_infn, m_outfn;
protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- DECLARE_MESSAGE_MAP()
+ DECLARE_MESSAGE_MAP()
public:
- afx_msg void OnBnClickedButton1();
- afx_msg void OnBnClickedButton2();
+ afx_msg void OnBnClickedButton1();
+ afx_msg void OnBnClickedButton2();
};
diff --git a/src/apps/vsrip/VSRipIndexingDlg.cpp b/src/apps/vsrip/VSRipIndexingDlg.cpp index 420a90457..c91e1898e 100644 --- a/src/apps/vsrip/VSRipIndexingDlg.cpp +++ b/src/apps/vsrip/VSRipIndexingDlg.cpp @@ -29,10 +29,10 @@ IMPLEMENT_DYNAMIC(CVSRipIndexingDlg, CVSRipPage)
CVSRipIndexingDlg::CVSRipIndexingDlg(IVSFRipper* pVSFRipper, CWnd* pParent /*=NULL*/)
- : CVSRipPage(pVSFRipper, CVSRipIndexingDlg::IDD, pParent)
- , m_bBeep(FALSE), m_bExit(FALSE)
- , m_fFinished(false)
- , m_fAuto(false)
+ : CVSRipPage(pVSFRipper, CVSRipIndexingDlg::IDD, pParent)
+ , m_bBeep(FALSE), m_bExit(FALSE)
+ , m_fFinished(false)
+ , m_fAuto(false)
{
}
@@ -42,62 +42,62 @@ CVSRipIndexingDlg::~CVSRipIndexingDlg() void CVSRipIndexingDlg::DoDataExchange(CDataExchange* pDX)
{
- CVSRipPage::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_PROGRESS1, m_progress);
- DDX_Control(pDX, IDC_EDIT1, m_log);
- DDX_Check(pDX, IDC_CHECK1, m_bExit);
- DDX_Check(pDX, IDC_CHECK2, m_bBeep);
+ CVSRipPage::DoDataExchange(pDX);
+ DDX_Control(pDX, IDC_PROGRESS1, m_progress);
+ DDX_Control(pDX, IDC_EDIT1, m_log);
+ DDX_Check(pDX, IDC_CHECK1, m_bExit);
+ DDX_Check(pDX, IDC_CHECK2, m_bBeep);
}
STDMETHODIMP CVSRipIndexingDlg::OnMessage(LPCTSTR msg)
{
- if(CEdit* pLog = (CEdit*)CEdit::FromHandle(m_log.m_hWnd))
- {
- CString str = msg;
- str += _T("\r\n");
- int len = pLog->GetWindowTextLength();
- pLog->SetSel(len, len);
- pLog->ReplaceSel(str);
- }
-
- return S_OK;
+ if(CEdit* pLog = (CEdit*)CEdit::FromHandle(m_log.m_hWnd))
+ {
+ CString str = msg;
+ str += _T("\r\n");
+ int len = pLog->GetWindowTextLength();
+ pLog->SetSel(len, len);
+ pLog->ReplaceSel(str);
+ }
+
+ return S_OK;
}
STDMETHODIMP CVSRipIndexingDlg::OnProgress(double progress)
{
- if(CProgressCtrl* pProgress = (CProgressCtrl*)CProgressCtrl::FromHandle(m_progress.m_hWnd))
- {
- pProgress->SetPos((int)(progress * 100));
- }
+ if(CProgressCtrl* pProgress = (CProgressCtrl*)CProgressCtrl::FromHandle(m_progress.m_hWnd))
+ {
+ pProgress->SetPos((int)(progress * 100));
+ }
- return S_OK;
+ return S_OK;
}
STDMETHODIMP CVSRipIndexingDlg::OnFinished(bool fSucceeded)
{
- m_fFinished = fSucceeded;
+ m_fFinished = fSucceeded;
- GetParent()->PostMessage(WM_KICKIDLE); // and kick it hard :)
+ GetParent()->PostMessage(WM_KICKIDLE); // and kick it hard :)
- if(m_fFinished && m_bBeep) MessageBeep(-1);
- if(m_fFinished && m_bExit) GetParent()->PostMessage(WM_COMMAND, IDCANCEL);
+ if(m_fFinished && m_bBeep) MessageBeep(-1);
+ if(m_fFinished && m_bExit) GetParent()->PostMessage(WM_COMMAND, IDCANCEL);
- if(!fSucceeded)
- {
+ if(!fSucceeded)
+ {
VSFRipperData rd;
- m_pVSFRipper->GetRipperData(rd);
- if(rd.fCloseIgnoreError) GetParent()->PostMessage(WM_COMMAND, IDCANCEL);
- }
+ m_pVSFRipper->GetRipperData(rd);
+ if(rd.fCloseIgnoreError) GetParent()->PostMessage(WM_COMMAND, IDCANCEL);
+ }
- return S_OK;
+ return S_OK;
}
BEGIN_MESSAGE_MAP(CVSRipIndexingDlg, CVSRipPage)
- ON_BN_CLICKED(IDC_BUTTON1, OnIndex)
- ON_UPDATE_COMMAND_UI(IDC_BUTTON1, OnUpdateIndex)
- ON_WM_SHOWWINDOW()
- ON_BN_CLICKED(IDC_CHECK2, OnBnClickedCheck2)
- ON_BN_CLICKED(IDC_CHECK1, OnBnClickedCheck1)
+ ON_BN_CLICKED(IDC_BUTTON1, OnIndex)
+ ON_UPDATE_COMMAND_UI(IDC_BUTTON1, OnUpdateIndex)
+ ON_WM_SHOWWINDOW()
+ ON_BN_CLICKED(IDC_CHECK2, OnBnClickedCheck2)
+ ON_BN_CLICKED(IDC_CHECK1, OnBnClickedCheck1)
END_MESSAGE_MAP()
@@ -105,73 +105,73 @@ END_MESSAGE_MAP() void CVSRipIndexingDlg::OnIndex()
{
- if(S_OK == m_pVSFRipper->IsIndexing())
- {
- m_pVSFRipper->Abort(false);
- }
- else
- {
- m_progress.SetRange(0, 100);
- m_progress.SetPos(0);
- m_log.SetWindowText(_T(""));
- m_log.SetMargins(0, 0);
-
- m_pVSFRipper->Index();
- }
-
- GetParent()->PostMessage(WM_KICKIDLE); // and kick it hard :)
+ if(S_OK == m_pVSFRipper->IsIndexing())
+ {
+ m_pVSFRipper->Abort(false);
+ }
+ else
+ {
+ m_progress.SetRange(0, 100);
+ m_progress.SetPos(0);
+ m_log.SetWindowText(_T(""));
+ m_log.SetMargins(0, 0);
+
+ m_pVSFRipper->Index();
+ }
+
+ GetParent()->PostMessage(WM_KICKIDLE); // and kick it hard :)
}
void CVSRipIndexingDlg::OnUpdateIndex(CCmdUI* pCmdUI)
{
- pCmdUI->SetText(S_OK == m_pVSFRipper->IsIndexing() ? _T("&Stop") : _T("Re&start"));
+ pCmdUI->SetText(S_OK == m_pVSFRipper->IsIndexing() ? _T("&Stop") : _T("Re&start"));
}
void CVSRipIndexingDlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
- __super::OnShowWindow(bShow, nStatus);
+ __super::OnShowWindow(bShow, nStatus);
- m_fFinished = false;
+ m_fFinished = false;
- if(bShow)
- {
+ if(bShow)
+ {
VSFRipperData rd;
- m_pVSFRipper->GetRipperData(rd);
- m_bBeep = rd.fBeep;
- m_bExit = rd.fClose;
- m_fAuto = rd.fAuto;
- UpdateData(FALSE);
-
- if(S_OK != m_pVSFRipper->IsIndexing())
- {
- if(!m_fAuto)
- {
- m_progress.SetRange(0, 100);
+ m_pVSFRipper->GetRipperData(rd);
+ m_bBeep = rd.fBeep;
+ m_bExit = rd.fClose;
+ m_fAuto = rd.fAuto;
+ UpdateData(FALSE);
+
+ if(S_OK != m_pVSFRipper->IsIndexing())
+ {
+ if(!m_fAuto)
+ {
+ m_progress.SetRange(0, 100);
m_progress.SetPos(0);
- m_log.SetWindowText(_T(""));
- m_log.SetMargins(0, 0);
- }
-
- m_pVSFRipper->Index();
- }
- }
- else
- {
+ m_log.SetWindowText(_T(""));
+ m_log.SetMargins(0, 0);
+ }
+
+ m_pVSFRipper->Index();
+ }
+ }
+ else
+ {
VSFRipperData rd;
- m_pVSFRipper->GetRipperData(rd);
- UpdateData();
- rd.fBeep = !m_bBeep;
- rd.fClose = !!m_bExit;
- m_pVSFRipper->UpdateRipperData(rd);
- }
+ m_pVSFRipper->GetRipperData(rd);
+ UpdateData();
+ rd.fBeep = !m_bBeep;
+ rd.fClose = !!m_bExit;
+ m_pVSFRipper->UpdateRipperData(rd);
+ }
}
void CVSRipIndexingDlg::OnBnClickedCheck2()
{
- UpdateData();
+ UpdateData();
}
void CVSRipIndexingDlg::OnBnClickedCheck1()
{
- UpdateData();
+ UpdateData();
}
diff --git a/src/apps/vsrip/VSRipIndexingDlg.h b/src/apps/vsrip/VSRipIndexingDlg.h index 5295d6e23..9715ed83f 100644 --- a/src/apps/vsrip/VSRipIndexingDlg.h +++ b/src/apps/vsrip/VSRipIndexingDlg.h @@ -27,66 +27,48 @@ class CVSRipIndexingDlg : public CVSRipPage
{
- DECLARE_DYNAMIC(CVSRipIndexingDlg)
+ DECLARE_DYNAMIC(CVSRipIndexingDlg)
private:
- BOOL m_bBeep, m_bExit;
- bool m_fAuto;
+ BOOL m_bBeep, m_bExit;
+ bool m_fAuto;
protected:
- // IVSFRipperCallback
- STDMETHODIMP OnMessage(LPCTSTR msg);
- STDMETHODIMP OnProgress(double progress /*0->1*/);
- STDMETHODIMP OnFinished(bool fSucceeded);
+ // IVSFRipperCallback
+ STDMETHODIMP OnMessage(LPCTSTR msg);
+ STDMETHODIMP OnProgress(double progress /*0->1*/);
+ STDMETHODIMP OnFinished(bool fSucceeded);
public:
- CVSRipIndexingDlg(IVSFRipper* pVSFRipper, CWnd* pParent = NULL); // standard constructor
- virtual ~CVSRipIndexingDlg();
+ CVSRipIndexingDlg(IVSFRipper* pVSFRipper, CWnd* pParent = NULL); // standard constructor
+ virtual ~CVSRipIndexingDlg();
- virtual bool CanGoPrev()
- {
- return(S_OK != m_pVSFRipper->IsIndexing() && !m_fAuto);
- }
- virtual bool CanGoNext()
- {
- return(false);
- }
- virtual bool CanClose()
- {
- return(S_OK != m_pVSFRipper->IsIndexing());
- }
- virtual CString GetCloseText()
- {
- return(m_fFinished ? _T("&Close") : _T("&Cancel"));
- }
- virtual CString GetHeaderText()
- {
- return(_T("Extracting subtitles"));
- }
- virtual CString GetDescText()
- {
- return(_T("This may take a while, please sit back and relax... ")
- _T("If you wish you can abort the process and go back to ")
- _T("adjust the settings again."));
- }
+ virtual bool CanGoPrev() {return(S_OK != m_pVSFRipper->IsIndexing() && !m_fAuto);}
+ virtual bool CanGoNext() {return(false);}
+ virtual bool CanClose() {return(S_OK != m_pVSFRipper->IsIndexing());}
+ virtual CString GetCloseText() {return(m_fFinished ? _T("&Close") : _T("&Cancel"));}
+ virtual CString GetHeaderText() {return(_T("Extracting subtitles"));}
+ virtual CString GetDescText() {return(_T("This may take a while, please sit back and relax... ")
+ _T("If you wish you can abort the process and go back to ")
+ _T("adjust the settings again."));}
- bool m_fFinished;
+ bool m_fFinished;
// Dialog Data
- enum { IDD = IDD_DIALOG_INDEXING };
+ enum { IDD = IDD_DIALOG_INDEXING };
- CEdit m_log;
- CProgressCtrl m_progress;
+ CEdit m_log;
+ CProgressCtrl m_progress;
protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- DECLARE_MESSAGE_MAP()
+ DECLARE_MESSAGE_MAP()
public:
- afx_msg void OnIndex();
- afx_msg void OnUpdateIndex(CCmdUI* pCmdUI);
- afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
- afx_msg void OnBnClickedCheck2();
- afx_msg void OnBnClickedCheck1();
+ afx_msg void OnIndex();
+ afx_msg void OnUpdateIndex(CCmdUI* pCmdUI);
+ afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
+ afx_msg void OnBnClickedCheck2();
+ afx_msg void OnBnClickedCheck1();
};
diff --git a/src/apps/vsrip/VSRipPGCDlg.cpp b/src/apps/vsrip/VSRipPGCDlg.cpp index 15ba20485..c4126725e 100644 --- a/src/apps/vsrip/VSRipPGCDlg.cpp +++ b/src/apps/vsrip/VSRipPGCDlg.cpp @@ -31,12 +31,12 @@ IMPLEMENT_DYNAMIC(CVSRipPGCDlg, CVSRipPage)
CVSRipPGCDlg::CVSRipPGCDlg(IVSFRipper* pVSFRipper, CWnd* pParent /*=NULL*/)
- : CVSRipPage(pVSFRipper, CVSRipPGCDlg::IDD, pParent)
- , m_bResetTime(TRUE)
- , m_bClosedCaption(FALSE)
- , m_bForcedOnly(FALSE)
+ : CVSRipPage(pVSFRipper, CVSRipPGCDlg::IDD, pParent)
+ , m_bResetTime(TRUE)
+ , m_bClosedCaption(FALSE)
+ , m_bForcedOnly(FALSE)
{
- m_rd.Reset();
+ m_rd.Reset();
}
CVSRipPGCDlg::~CVSRipPGCDlg()
@@ -45,168 +45,168 @@ CVSRipPGCDlg::~CVSRipPGCDlg() void CVSRipPGCDlg::DoDataExchange(CDataExchange* pDX)
{
- CVSRipPage::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_LIST1, m_pgclist);
- DDX_Control(pDX, IDC_LIST2, m_anglelist);
- DDX_Control(pDX, IDC_LIST3, m_vclist);
- DDX_Control(pDX, IDC_LIST4, m_langlist);
- DDX_Check(pDX, IDC_CHECK1, m_bResetTime);
- DDX_Check(pDX, IDC_CHECK2, m_bClosedCaption);
- DDX_Check(pDX, IDC_CHECK3, m_bForcedOnly);
+ CVSRipPage::DoDataExchange(pDX);
+ DDX_Control(pDX, IDC_LIST1, m_pgclist);
+ DDX_Control(pDX, IDC_LIST2, m_anglelist);
+ DDX_Control(pDX, IDC_LIST3, m_vclist);
+ DDX_Control(pDX, IDC_LIST4, m_langlist);
+ DDX_Check(pDX, IDC_CHECK1, m_bResetTime);
+ DDX_Check(pDX, IDC_CHECK2, m_bClosedCaption);
+ DDX_Check(pDX, IDC_CHECK3, m_bForcedOnly);
}
void CVSRipPGCDlg::OnPrev()
{
- OnNext();
+ OnNext();
}
void CVSRipPGCDlg::OnNext()
{
- CAutoVectorPtr<int> items;
-
- m_rd.iSelPGC = m_pgclist.GetCurSel();
-
- m_rd.selids.RemoveAll();
- if(items.Allocate(m_langlist.GetSelCount()))
- {
- int j = m_langlist.GetSelItems(m_langlist.GetSelCount(), items);
- for(int i = 0; i < j; i++)
- m_rd.selids[(BYTE)m_langlist.GetItemData(items[i])] = true;
- items.Free();
- }
-
- m_rd.pgcs[m_rd.iSelPGC].iSelAngle = m_anglelist.GetCurSel();
-
- m_rd.selvcs.RemoveAll();
- if(items.Allocate(m_vclist.GetSelCount()))
- {
- int j = m_vclist.GetSelItems(m_vclist.GetSelCount(), items);
- for(int i = 0; i < j; i++)
- m_rd.selvcs.Add((DWORD)m_vclist.GetItemData(items[i]));
- items.Free();
- }
-
- m_rd.fClosedCaption = !!m_bClosedCaption;
- m_rd.fResetTime = !!m_bResetTime;
- m_rd.fForcedOnly = !!m_bForcedOnly;
-
- m_pVSFRipper->UpdateRipperData(m_rd);
+ CAutoVectorPtr<int> items;
+
+ m_rd.iSelPGC = m_pgclist.GetCurSel();
+
+ m_rd.selids.RemoveAll();
+ if(items.Allocate(m_langlist.GetSelCount()))
+ {
+ int j = m_langlist.GetSelItems(m_langlist.GetSelCount(), items);
+ for(int i = 0; i < j; i++)
+ m_rd.selids[(BYTE)m_langlist.GetItemData(items[i])] = true;
+ items.Free();
+ }
+
+ m_rd.pgcs[m_rd.iSelPGC].iSelAngle = m_anglelist.GetCurSel();
+
+ m_rd.selvcs.RemoveAll();
+ if(items.Allocate(m_vclist.GetSelCount()))
+ {
+ int j = m_vclist.GetSelItems(m_vclist.GetSelCount(), items);
+ for(int i = 0; i < j; i++)
+ m_rd.selvcs.Add((DWORD)m_vclist.GetItemData(items[i]));
+ items.Free();
+ }
+
+ m_rd.fClosedCaption = !!m_bClosedCaption;
+ m_rd.fResetTime = !!m_bResetTime;
+ m_rd.fForcedOnly = !!m_bForcedOnly;
+
+ m_pVSFRipper->UpdateRipperData(m_rd);
}
bool CVSRipPGCDlg::CanGoNext()
{
- UpdateData();
+ UpdateData();
- return(m_pgclist.GetCurSel() >= 0
- && m_anglelist.GetCurSel() >= 0
- && m_vclist.GetSelCount() > 0
- && (m_langlist.GetSelCount() > 0 || m_bClosedCaption));
+ return(m_pgclist.GetCurSel() >= 0
+ && m_anglelist.GetCurSel() >= 0
+ && m_vclist.GetSelCount() > 0
+ && (m_langlist.GetSelCount() > 0 || m_bClosedCaption));
}
void CVSRipPGCDlg::SetupPGCList()
{
- ASSERT(m_rd.iSelPGC >= 0);
+ ASSERT(m_rd.iSelPGC >= 0);
- m_pgclist.ResetContent();
+ m_pgclist.ResetContent();
- for(int i = 0; i < m_rd.pgcs.GetCount(); i++)
- {
- CString str;
- str.Format(_T("PGC %d"), i + 1);
- m_pgclist.AddString(str);
- }
+ for(int i = 0; i < m_rd.pgcs.GetCount(); i++)
+ {
+ CString str;
+ str.Format(_T("PGC %d"), i+1);
+ m_pgclist.AddString(str);
+ }
- m_pgclist.SetCurSel(m_rd.iSelPGC);
+ m_pgclist.SetCurSel(m_rd.iSelPGC);
- SetupLangList();
- SetupAngleList();
+ SetupLangList();
+ SetupAngleList();
}
void CVSRipPGCDlg::SetupLangList()
{
- m_langlist.ResetContent();
-
- for(BYTE i = 0; i < 32; i++)
- {
- WORD id = m_rd.pgcs[m_rd.iSelPGC].ids[i];
-
- CString str;
-
- if(id == 0)
- {
- str.Format(_T("%02d (empty)"), (int)i);
- }
- else if(!isalpha(id >> 8) || !isalpha(id & 0xff))
- {
- str.Format(_T("%02d (unknown)"), (int)i);
- }
- else
- {
- str.Format(_T("%02d %s (%c%c)"), (int)i, FindLangFromId(id), TCHAR(id >> 8), TCHAR(id & 0xff));
- }
-
- int j = m_langlist.AddString(str);
- m_langlist.SetSel(j, !!id);
- m_langlist.SetItemData(j, (DWORD_PTR)i);
- }
-
- m_langlist.SetTopIndex(0);
+ m_langlist.ResetContent();
+
+ for(BYTE i = 0; i < 32; i++)
+ {
+ WORD id = m_rd.pgcs[m_rd.iSelPGC].ids[i];
+
+ CString str;
+
+ if(id == 0)
+ {
+ str.Format(_T("%02d (empty)"), (int)i);
+ }
+ else if(!isalpha(id>>8) || !isalpha(id&0xff))
+ {
+ str.Format(_T("%02d (unknown)"), (int)i);
+ }
+ else
+ {
+ str.Format(_T("%02d %s (%c%c)"), (int)i, FindLangFromId(id), TCHAR(id>>8), TCHAR(id&0xff));
+ }
+
+ int j = m_langlist.AddString(str);
+ m_langlist.SetSel(j, !!id);
+ m_langlist.SetItemData(j, (DWORD_PTR)i);
+ }
+
+ m_langlist.SetTopIndex(0);
}
void CVSRipPGCDlg::SetupAngleList()
{
- m_anglelist.ResetContent();
+ m_anglelist.ResetContent();
- m_rd.pgcs[m_rd.iSelPGC].iSelAngle = m_rd.pgcs[m_rd.iSelPGC].nAngles > 0 ? 1 : 0;
+ m_rd.pgcs[m_rd.iSelPGC].iSelAngle = m_rd.pgcs[m_rd.iSelPGC].nAngles > 0 ? 1 : 0;
- for(int i = 0; i < 10; i++)
- {
- CString str;
+ for(int i = 0; i < 10; i++)
+ {
+ CString str;
- if(i == 0)
- {
- str = _T("Everything");
- }
- else
- {
- str.Format(_T("Angle %d"), i);
- if(i > m_rd.pgcs[m_rd.iSelPGC].nAngles)
- str += _T(" (empty)");
- }
+ if(i == 0)
+ {
+ str = _T("Everything");
+ }
+ else
+ {
+ str.Format(_T("Angle %d"), i);
+ if(i > m_rd.pgcs[m_rd.iSelPGC].nAngles)
+ str += _T(" (empty)");
+ }
- m_anglelist.AddString(str);
- }
+ m_anglelist.AddString(str);
+ }
- m_anglelist.SetCurSel(m_rd.pgcs[m_rd.iSelPGC].iSelAngle);
+ m_anglelist.SetCurSel(m_rd.pgcs[m_rd.iSelPGC].iSelAngle);
- SetupVCList();
+ SetupVCList();
}
void CVSRipPGCDlg::SetupVCList()
{
- m_vclist.ResetContent();
+ m_vclist.ResetContent();
- CArray<vc_t>& vca = m_rd.pgcs[m_rd.iSelPGC].angles[m_rd.pgcs[m_rd.iSelPGC].iSelAngle];
+ CArray<vc_t>& vca = m_rd.pgcs[m_rd.iSelPGC].angles[m_rd.pgcs[m_rd.iSelPGC].iSelAngle];
- for(int i = 0; i < vca.GetCount(); i++)
- {
- CString str;
- str.Format(_T("V%02d C%02d"), vca[i].vob, vca[i].cell);
+ for(int i = 0; i < vca.GetCount(); i++)
+ {
+ CString str;
+ str.Format(_T("V%02d C%02d"), vca[i].vob, vca[i].cell);
- DWORD vc = (vca[i].vob << 16) | vca[i].cell;
+ DWORD vc = (vca[i].vob<<16)|vca[i].cell;
- int j = m_vclist.AddString(str);
- m_vclist.SetSel(j, TRUE);
- m_vclist.SetItemData(j, (DWORD_PTR)vc);
- }
+ int j = m_vclist.AddString(str);
+ m_vclist.SetSel(j, TRUE);
+ m_vclist.SetItemData(j, (DWORD_PTR)vc);
+ }
- m_vclist.SetTopIndex(0);
+ m_vclist.SetTopIndex(0);
}
BEGIN_MESSAGE_MAP(CVSRipPGCDlg, CVSRipPage)
- ON_LBN_SELCHANGE(IDC_LIST1, OnLbnSelchangeList1)
- ON_LBN_SELCHANGE(IDC_LIST2, OnLbnSelchangeList2)
- ON_WM_SHOWWINDOW()
+ ON_LBN_SELCHANGE(IDC_LIST1, OnLbnSelchangeList1)
+ ON_LBN_SELCHANGE(IDC_LIST2, OnLbnSelchangeList2)
+ ON_WM_SHOWWINDOW()
END_MESSAGE_MAP()
@@ -214,32 +214,32 @@ END_MESSAGE_MAP() void CVSRipPGCDlg::OnLbnSelchangeList1()
{
- if(m_rd.iSelPGC == m_pgclist.GetCurSel()) return;
- m_rd.iSelPGC = m_pgclist.GetCurSel();
- SetupAngleList();
+ if(m_rd.iSelPGC == m_pgclist.GetCurSel()) return;
+ m_rd.iSelPGC = m_pgclist.GetCurSel();
+ SetupAngleList();
}
void CVSRipPGCDlg::OnLbnSelchangeList2()
{
- if(m_rd.pgcs[m_rd.iSelPGC].iSelAngle == m_anglelist.GetCurSel()) return;
- m_rd.pgcs[m_rd.iSelPGC].iSelAngle = m_anglelist.GetCurSel();
- SetupVCList();
+ if(m_rd.pgcs[m_rd.iSelPGC].iSelAngle == m_anglelist.GetCurSel()) return;
+ m_rd.pgcs[m_rd.iSelPGC].iSelAngle = m_anglelist.GetCurSel();
+ SetupVCList();
}
void CVSRipPGCDlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
- CVSRipPage::OnShowWindow(bShow, nStatus);
+ CVSRipPage::OnShowWindow(bShow, nStatus);
- if(!bShow) return;
+ if(!bShow) return;
- m_pVSFRipper->GetRipperData(m_rd);
+ m_pVSFRipper->GetRipperData(m_rd);
+
+ if(m_rd.iSelPGC == -1)
+ {
+ m_rd.iSelPGC = 0;
+ SetupPGCList();
- if(m_rd.iSelPGC == -1)
- {
- m_rd.iSelPGC = 0;
- SetupPGCList();
-
- m_bClosedCaption = m_rd.vidinfo.line21_1 || m_rd.vidinfo.line21_2;
- UpdateData(FALSE);
- }
+ m_bClosedCaption = m_rd.vidinfo.line21_1 || m_rd.vidinfo.line21_2;
+ UpdateData(FALSE);
+ }
}
diff --git a/src/apps/vsrip/VSRipPGCDlg.h b/src/apps/vsrip/VSRipPGCDlg.h index 19a9aeb98..434ca1f94 100644 --- a/src/apps/vsrip/VSRipPGCDlg.h +++ b/src/apps/vsrip/VSRipPGCDlg.h @@ -29,53 +29,44 @@ class CVSRipPGCDlg : public CVSRipPage
{
- DECLARE_DYNAMIC(CVSRipPGCDlg)
+ DECLARE_DYNAMIC(CVSRipPGCDlg)
private:
- VSFRipperData m_rd;
- void SetupPGCList();
- void SetupAngleList();
- void SetupVCList();
- void SetupLangList();
+ VSFRipperData m_rd;
+ void SetupPGCList();
+ void SetupAngleList();
+ void SetupVCList();
+ void SetupLangList();
public:
- CVSRipPGCDlg(IVSFRipper* pVSFRipper, CWnd* pParent = NULL); // standard constructor
- virtual ~CVSRipPGCDlg();
+ CVSRipPGCDlg(IVSFRipper* pVSFRipper, CWnd* pParent = NULL); // standard constructor
+ virtual ~CVSRipPGCDlg();
- virtual void OnPrev();
- virtual void OnNext();
- virtual bool CanGoPrev()
- {
- return(true);
- }
- virtual bool CanGoNext();
- virtual CString GetHeaderText()
- {
- return(_T("Extraction settings"));
- }
- virtual CString GetDescText()
- {
- return(_T("Select the program chain and angle you did or ")
- _T("will do in the dvd ripper. Optionally, remove any not ")
- _T("needed language streams and vob/cell ids."));
- }
+ virtual void OnPrev();
+ virtual void OnNext();
+ virtual bool CanGoPrev() {return(true);}
+ virtual bool CanGoNext();
+ virtual CString GetHeaderText() {return(_T("Extraction settings"));}
+ virtual CString GetDescText() {return(_T("Select the program chain and angle you did or ")
+ _T("will do in the dvd ripper. Optionally, remove any not ")
+ _T("needed language streams and vob/cell ids."));}
// Dialog Data
- enum { IDD = IDD_DIALOG_PGC };
- CListBox m_pgclist;
- CListBox m_anglelist;
- CListBox m_vclist;
- CListBox m_langlist;
- BOOL m_bResetTime;
- BOOL m_bClosedCaption;
- BOOL m_bForcedOnly;
+ enum { IDD = IDD_DIALOG_PGC };
+ CListBox m_pgclist;
+ CListBox m_anglelist;
+ CListBox m_vclist;
+ CListBox m_langlist;
+ BOOL m_bResetTime;
+ BOOL m_bClosedCaption;
+ BOOL m_bForcedOnly;
protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- DECLARE_MESSAGE_MAP()
+ DECLARE_MESSAGE_MAP()
public:
- afx_msg void OnLbnSelchangeList1();
- afx_msg void OnLbnSelchangeList2();
- afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
+ afx_msg void OnLbnSelchangeList1();
+ afx_msg void OnLbnSelchangeList2();
+ afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
};
diff --git a/src/apps/vsrip/VSRipPage.cpp b/src/apps/vsrip/VSRipPage.cpp index 0c578e0d4..273395ee3 100644 --- a/src/apps/vsrip/VSRipPage.cpp +++ b/src/apps/vsrip/VSRipPage.cpp @@ -29,10 +29,10 @@ IMPLEMENT_DYNAMIC(CVSRipPage, CDialog)
CVSRipPage::CVSRipPage(IVSFRipper* pVSFRipper, UINT nIDTemplate, CWnd* pParent /*=NULL*/)
- : CDialog(nIDTemplate, pParent)
- , m_pVSFRipper(pVSFRipper)
+ : CDialog(nIDTemplate, pParent)
+ , m_pVSFRipper(pVSFRipper)
{
- m_cRef = 1;
+ m_cRef = 1;
}
CVSRipPage::~CVSRipPage()
@@ -41,11 +41,11 @@ CVSRipPage::~CVSRipPage() void CVSRipPage::DoDataExchange(CDataExchange* pDX)
{
- CDialog::DoDataExchange(pDX);
+ CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CVSRipPage, CDialog)
- ON_WM_SHOWWINDOW()
+ ON_WM_SHOWWINDOW()
END_MESSAGE_MAP()
@@ -53,8 +53,8 @@ END_MESSAGE_MAP() void CVSRipPage::OnShowWindow(BOOL bShow, UINT nStatus)
{
- __super::OnShowWindow(bShow, nStatus);
+ __super::OnShowWindow(bShow, nStatus);
- m_pVSFRipper->SetCallBack(bShow ? (IVSFRipperCallback*)this : NULL);
+ m_pVSFRipper->SetCallBack(bShow ? (IVSFRipperCallback*)this : NULL);
}
diff --git a/src/apps/vsrip/VSRipPage.h b/src/apps/vsrip/VSRipPage.h index 361025171..a97b5e3a3 100644 --- a/src/apps/vsrip/VSRipPage.h +++ b/src/apps/vsrip/VSRipPage.h @@ -29,57 +29,33 @@ class CVSRipPage : public CDialog, public IVSFRipperCallbackImpl
{
- DECLARE_DYNAMIC(CVSRipPage)
+ DECLARE_DYNAMIC(CVSRipPage)
protected:
- CComPtr<IVSFRipper> m_pVSFRipper;
+ CComPtr<IVSFRipper> m_pVSFRipper;
public:
- CVSRipPage(IVSFRipper* pVSFRipper, UINT nIDTemplate, CWnd* pParent = NULL); // standard constructor
- virtual ~CVSRipPage();
+ CVSRipPage(IVSFRipper* pVSFRipper, UINT nIDTemplate, CWnd* pParent = NULL); // standard constructor
+ virtual ~CVSRipPage();
// static bool ParseParamFile(CString fn);
- virtual void OnPrev() {}
- virtual void OnNext() {}
- virtual void OnClose() {}
- virtual bool CanGoPrev()
- {
- return(false);
- }
- virtual bool CanGoNext()
- {
- return(false);
- }
- virtual bool CanClose()
- {
- return(true);
- }
- virtual CString GetPrevText()
- {
- return(_T("< &Back"));
- }
- virtual CString GetNextText()
- {
- return(_T("&Next >"));
- }
- virtual CString GetCloseText()
- {
- return(_T("&Cancel"));
- }
- virtual CString GetHeaderText()
- {
- return(_T("Header Text"));
- }
- virtual CString GetDescText()
- {
- return(_T("Hello World"));
- }
+ virtual void OnPrev() {}
+ virtual void OnNext() {}
+ virtual void OnClose() {}
+ virtual bool CanGoPrev() {return(false);}
+ virtual bool CanGoNext() {return(false);}
+ virtual bool CanClose() {return(true);}
+ virtual CString GetPrevText() {return(_T("< &Back"));}
+ virtual CString GetNextText() {return(_T("&Next >"));}
+ virtual CString GetCloseText() {return(_T("&Cancel"));}
+ virtual CString GetHeaderText() {return(_T("Header Text"));}
+ virtual CString GetDescText() {return(_T("Hello World"));}
protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- DECLARE_MESSAGE_MAP()
+ DECLARE_MESSAGE_MAP()
public:
- afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
+ afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
};
diff --git a/src/apps/vsrip/resource.h b/src/apps/vsrip/resource.h index 0f56b9cc9..96a8a3219 100644 --- a/src/apps/vsrip/resource.h +++ b/src/apps/vsrip/resource.h @@ -26,7 +26,7 @@ #define IDC_EDIT3 1017
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 132
diff --git a/src/apps/vsrip/stdafx.h b/src/apps/vsrip/stdafx.h index 01cde7793..bc30d03c1 100644 --- a/src/apps/vsrip/stdafx.h +++ b/src/apps/vsrip/stdafx.h @@ -37,7 +37,7 @@ #ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
-#endif
+#endif
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
|