[matroska] r1024 - trunk/DvdMenuXtractor
[email protected] Sun, 9 Jan 2005 18:54:52 +0300 (MSK)
Newsgroups
gmane.comp.multimedia.matroska.cvs
Message-ID
<[email protected] >
Author: robux4
Date: 2005-01-09 18:54:51 +0300 (Sun, 09 Jan 2005)
New Revision: 1024
Modified:
trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
trunk/DvdMenuXtractor/MyWizard.cpp
trunk/DvdMenuXtractor/MyWizard.h
trunk/DvdMenuXtractor/README.txt
Log:
DMX: improvements and cleaning
Modified: trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
===================================================================
--- trunk/DvdMenuXtractor/DvdMenuXtractor.cpp 2005-01-09 15:15:21 UTC (rev 1023)
+++ trunk/DvdMenuXtractor/DvdMenuXtractor.cpp 2005-01-09 15:54:51 UTC (rev 1024)
@@ -759,7 +759,7 @@
m_gaDemuxProgress->SetValue(0);
m_gaDemuxProgress->SetRange(aVobParser->GetPacketCount() >> 8);
- while(aVobParser->ParseNextPacket(*CellsList))
+ while(aVobParser->ParseNextPacket(*CellsList) && !m_StopOperation)
{
m_gaDemuxProgress->SetValue(aVobParser->GetPacketIndex() >> 8);
wxYield();
@@ -1375,6 +1375,7 @@
wxString StepString, StepStringFormat = "Step %d/%d : %s...";
m_OperationInProgress = TRUE;
+ m_StopOperation = false;
m_txtDemuxLog->AppendText("Creating output directories\n");
@@ -1408,7 +1409,7 @@
if (aVobParser != NULL)
delete aVobParser;
language = !language;
- } while (!language);
+ } while (!language && !m_StopOperation);
}
m_txtDemuxLog->AppendText("I'm done\n");
@@ -1417,15 +1418,35 @@
m_OperationInProgress = FALSE;
}
- virtual bool PageChanging(bool goingForward)
+ virtual bool StopCurrent()
+ {
+ if (m_OperationInProgress)
+ {
+ m_StopOperation = true;
+ return FALSE;
+ }
+ else
+ {
+ return TRUE;
+ }
+ }
+
+ virtual bool PageChanging(bool goingForward)
{
if(m_OperationInProgress)
{
- wxMessageBox("The operation is not finished do you really want to cancel it ?",
+ int result = wxMessageBox("The operation is not finished do you really want to cancel it ?",
"Cancelling operation",
wxICON_QUESTION | wxYES | wxNO, this);
- // TODO : If yes Wait for operation to finish and return TRUE
- return FALSE;
+ if (result == wxYES)
+ {
+ m_StopOperation = true;
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
}
return TRUE;
}
@@ -1435,6 +1456,7 @@
wxGauge* m_gaDemuxProgress;
wxTextCtrl* m_txtDemuxLog;
bool m_OperationInProgress;
+ bool m_StopOperation;
};
// ----------------------------------------------------------------------------
Modified: trunk/DvdMenuXtractor/MyWizard.cpp
===================================================================
--- trunk/DvdMenuXtractor/MyWizard.cpp 2005-01-09 15:15:21 UTC (rev 1023)
+++ trunk/DvdMenuXtractor/MyWizard.cpp 2005-01-09 15:54:51 UTC (rev 1024)
@@ -15,7 +15,6 @@
EVT_BUTTON(wxID_BACKWARD, wxMyWizard::OnBackOrNext)
EVT_BUTTON(wxID_FORWARD, wxMyWizard::OnBackOrNext)
EVT_BUTTON(wxID_CUSTOM_BTT1, wxMyWizard::OnCustomButton1)
- EVT_BUTTON(wxID_CUSTOM_BTT1, wxMyWizard::OnCustomButton2)
END_EVENT_TABLE()
// ----------------------------------------------------------------------------
@@ -71,7 +70,7 @@
m_posWizard = wxDefaultPosition;
m_page = (wxMyWizardPage *)NULL;
m_statbmp = NULL;
- m_btnCustom1 = m_btnCustom2 = m_btnBack = m_btnNext = NULL;
+ m_btnCustom1 = m_btnBack = m_btnNext = NULL;
}
// ----------------------------------------------------------------------------
@@ -147,11 +146,6 @@
m_btnCustom1->Hide();
fgsizer->Add(m_btnCustom1);
- m_btnCustom2 = new wxButton( this, wxID_CUSTOM_BTT2, "Custom2",
- wxDefaultPosition, wxDefaultSize, DEFAULT_COMMON_STYLE);
- m_btnCustom2->Hide();
- fgsizer->Add(m_btnCustom2);
-
fgsizer->Add(50,1);
m_btnBack = new wxButton( this, wxID_BACKWARD, "< &Back",
@@ -225,18 +219,6 @@
// ----------------------------------------------------------------------------
-void wxMyWizard::ShowCustomButton2(bool show)
-{
- m_btnCustom2->Show(show);
-}
-
-void wxMyWizard::SetCustomButton2Text(const wxString& newName)
-{
- m_btnCustom2->SetLabel(newName);
-}
-
-// ----------------------------------------------------------------------------
-
bool wxMyWizard::ShowPage(wxMyWizardPage *page, bool goingForward)
{
wxSizer* sizer = m_plMain->GetSizer();
@@ -271,6 +253,8 @@
if (m_page->GetNext() == (wxMyWizardPage *)NULL)
{
m_btnNext->SetLabel("&Finish");
+ m_btnCancel->SetLabel("&Cancel");
+ m_btnNext->Enable(false);
}
else
{
@@ -292,6 +276,8 @@
m_page->SetFocus();
m_page->AfterShow();
+ m_btnNext->Enable(true);
+ m_btnCancel->SetLabel("&Quit");
return TRUE;
}
@@ -313,7 +299,10 @@
}
else
{
- Destroy();
+ if (m_page->StopCurrent())
+ {
+ Destroy();
+ }
}
}
Modified: trunk/DvdMenuXtractor/MyWizard.h
===================================================================
--- trunk/DvdMenuXtractor/MyWizard.h 2005-01-09 15:15:21 UTC (rev 1023)
+++ trunk/DvdMenuXtractor/MyWizard.h 2005-01-09 15:54:51 UTC (rev 1024)
@@ -31,6 +31,11 @@
return TRUE;
}
+ virtual bool StopCurrent()
+ {
+ return TRUE;
+ }
+
virtual void BeforeShow() {};
virtual void AfterShow() {};
virtual void BeforeHide() {};
@@ -144,16 +149,13 @@
wxPanel* GetMainPanel();
void ShowCustomButton1(bool show = TRUE);
- void ShowCustomButton2(bool show = TRUE);
void SetCustomButton1Text(const wxString& newName);
- void SetCustomButton2Text(const wxString& newName);
protected:
// event handlers
void OnBackOrNext(wxCommandEvent& event);
virtual void OnCancel(wxCommandEvent& event);
virtual void OnCustomButton1(wxCommandEvent& WXUNUSED(event)) {};
- virtual void OnCustomButton2(wxCommandEvent& WXUNUSED(event)) {};
private:
bool ShowPage(wxMyWizardPage *page, bool goingForward);
@@ -165,7 +167,6 @@
wxStaticText* m_lbPageDesc;
wxButton* m_btnCustom1;
- wxButton* m_btnCustom2;
wxButton* m_btnBack; // the "<Back" button
wxButton* m_btnNext; // the "Next>" or "Finish" button
wxButton* m_btnCancel;
Modified: trunk/DvdMenuXtractor/README.txt
===================================================================
--- trunk/DvdMenuXtractor/README.txt 2005-01-09 15:15:21 UTC (rev 1023)
+++ trunk/DvdMenuXtractor/README.txt 2005-01-09 15:54:51 UTC (rev 1024)
@@ -1,5 +1,4 @@
TODO :
-* make use of the cancel buttons
* verify (and fix) the frame and cluster timecodes from mkvmerge
* generate the d2v file ?
* allow skipping DVD parts when extracting (VMG, VTSM, VTS)