[matroska] r802 - trunk/DvdMenuXtractor

[email protected]
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: robux4
Date: 2004-09-14 16:29:32 +0400 (Tue, 14 Sep 2004)
New Revision: 802

Modified:
   trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
Log:
only handle the top directory containing the DVD files

Modified: trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
===================================================================
--- trunk/DvdMenuXtractor/DvdMenuXtractor.cpp	2004-09-14 11:04:22 UTC (rev 801)
+++ trunk/DvdMenuXtractor/DvdMenuXtractor.cpp	2004-09-14 12:29:32 UTC (rev 802)
@@ -86,9 +86,7 @@
 // ids for button
 enum
 {
-    wxID_P1_BROWSE_MENU_IFO = 100,
-    wxID_P1_BROWSE_MENU_VOB,
-    wxID_P1_BROWSE_MOVIE_IFO,
+    wxID_P1_BROWSE_IN_DIR = 100,
     wxID_P1_BROWSE_OUT_DIR,
 
     wxID_P2_CELL_LIST
@@ -109,41 +107,18 @@
         fgs->AddGrowableCol(1);
 
         pConfig->SetPath("/Input");
-        // Menu IFO
-        m_lbMenuIFO = new wxStaticText(this,-1,"Menu IFO file :",
+        // Input directory
+        m_lbInDir = new wxStaticText(this,-1,"Input directory :",
 			wxDefaultPosition,wxDefaultSize, DEFAULT_COMMON_STYLE);
-        m_edMenuIFOFilename = new wxTextCtrl(this,-1,
-			pConfig->Read("MenuIFOFilename",""), wxDefaultPosition,
+        m_edInDir = new wxTextCtrl(this,-1,
+			pConfig->Read("InDirectory",""), wxDefaultPosition,
 			wxDefaultSize, DEFAULT_COMMON_STYLE);
-        m_bttBrowseMenuIFO = new wxButton(this, wxID_P1_BROWSE_MENU_IFO, "...",
-            wxDefaultPosition, wxSize(24,24), DEFAULT_COMMON_STYLE);
-        fgs->Add(m_lbMenuIFO,0,wxALL|wxALIGN_CENTRE_VERTICAL,5);
-        fgs->Add(m_edMenuIFOFilename,0,wxALL|wxEXPAND,5);
-        fgs->Add(m_bttBrowseMenuIFO,0,wxALL,5);
+        m_bttBrowseInDir = new wxButton(this, wxID_P1_BROWSE_IN_DIR, "...",
+            wxDefaultPosition, wxSize(24,24),DEFAULT_COMMON_STYLE);
+        fgs->Add(m_lbInDir,0,wxALL|wxALIGN_CENTRE_VERTICAL,5);
+        fgs->Add(m_edInDir,0,wxALL|wxEXPAND,5);
+        fgs->Add(m_bttBrowseInDir,0,wxALL,5);
 
-        // Menu VOB
-        m_lbMenuVOB = new wxStaticText(this,-1,"Menu VOB file :");
-        m_edMenuVOBFilename = new wxTextCtrl(this,-1,
-			pConfig->Read("MenuVOBFilename",""), wxDefaultPosition);
-        m_bttBrowseMenuVOB = new wxButton(this, wxID_P1_BROWSE_MENU_VOB, "...",
-            wxDefaultPosition, wxSize(24,24));
-        fgs->Add(m_lbMenuVOB,0,wxALL|wxALIGN_CENTRE_VERTICAL,5);
-        fgs->Add(m_edMenuVOBFilename,0,wxALL|wxEXPAND,5);
-        fgs->Add(m_bttBrowseMenuVOB,0,wxALL,5);
-
-        // Movie IFO
-        m_lbMovieIFO = new wxStaticText(this,-1,"Movie IFO file :",
-			wxDefaultPosition,wxDefaultSize, DEFAULT_COMMON_STYLE);
-        m_edMovieIFOFilename = new wxTextCtrl(this,-1,
-			pConfig->Read("MovieIFOFilename",""), wxDefaultPosition,
-			wxDefaultSize, DEFAULT_COMMON_STYLE);
-        m_edMovieIFOFilename->SetToolTip("If different from menu ifo file.");
-        m_bttBrowseMovieIFO = new wxButton(this, wxID_P1_BROWSE_MOVIE_IFO, "...",
-            wxDefaultPosition, wxSize(24,24), DEFAULT_COMMON_STYLE);
-        fgs->Add(m_lbMovieIFO,0,wxALL|wxALIGN_CENTRE_VERTICAL,5);
-        fgs->Add(m_edMovieIFOFilename,0,wxALL|wxEXPAND,5);
-        fgs->Add(m_bttBrowseMovieIFO,0,wxALL,5);
-
         // Output directory
         m_lbOutDir = new wxStaticText(this,-1,"Output directory :",
 			wxDefaultPosition,wxDefaultSize, DEFAULT_COMMON_STYLE);
@@ -169,59 +144,44 @@
     {
         SaveSettings();
     }
-
-    void OnBrowseMenuIFO(wxCommandEvent& WXUNUSED(event))
+
+    void OnBrowseOutputDirectory(wxCommandEvent& WXUNUSED(event))
     {
-        wxFileDialog dialog(this, "Select the menu ifo file :","","",
-            "IFO files (*.ifo)|*.ifo|All files (*.*)|*.*");
+        wxString defaultDir = m_edOutDir->GetValue();
+		if (defaultDir.IsEmpty())
+		{
+			defaultDir = m_edInDir->GetValue();
+		}
+        wxDirDialog dialog(this, "Select the output directory :", defaultDir,
+            wxDD_NEW_DIR_BUTTON);
         if (dialog.ShowModal() == wxID_OK)
         {
-            m_edMenuIFOFilename->SetValue(dialog.GetPath());
+            if(wxEndsWithPathSeparator(dialog.GetPath()))
+            {
+                m_edOutDir->SetValue(dialog.GetPath());
+            }
+            else
+            {
+                m_edOutDir->SetValue(dialog.GetPath()+wxFILE_SEP_PATH);
+            }
             pageHasChanged = TRUE;
         }
     }
 
-    void OnBrowseMenuVOB(wxCommandEvent& WXUNUSED(event))
+    void OnBrowseInputDirectory(wxCommandEvent& WXUNUSED(event))
     {
-        wxFileDialog dialog(this, "Select the menu vob file :","","",
-            "VOB files (*.vob)|*.vob|All files (*.*)|*.*");
-        if (dialog.ShowModal() == wxID_OK)
-        {
-            m_edMenuVOBFilename->SetValue(dialog.GetPath());
-            pageHasChanged = TRUE;
-        }
-    }
-
-    void OnBrowseMovieIFO(wxCommandEvent& WXUNUSED(event))
-    {
-        wxFileDialog dialog(this, "Select the movie ifo file :","","",
-            "IFO files (*.ifo)|*.ifo|All files (*.*)|*.*");
-        if (dialog.ShowModal() == wxID_OK)
-        {
-            m_edMovieIFOFilename->SetValue(dialog.GetPath());
-            pageHasChanged = TRUE;
-        }
-    }
-
-    void OnBrowseOutputDirectory(wxCommandEvent& WXUNUSED(event))
-    {
-        wxString defaultDir = wxEmptyString;
-        if(!m_edMenuIFOFilename->GetValue().IsEmpty())
-        {
-            wxFileName fileName(m_edMenuIFOFilename->GetValue());
-            defaultDir = fileName.GetPath(wxPATH_GET_VOLUME);
-        }
-        wxDirDialog dialog(this, "Select the output directory :", defaultDir,
+        wxString defaultDir = m_edInDir->GetValue();
+        wxDirDialog dialog(this, "Select the DVD input directory :", defaultDir,
             wxDD_NEW_DIR_BUTTON);
         if (dialog.ShowModal() == wxID_OK)
         {
             if(wxEndsWithPathSeparator(dialog.GetPath()))
             {
-                m_edOutDir->SetValue(dialog.GetPath());
+                m_edInDir->SetValue(dialog.GetPath());
             }
             else
             {
-                m_edOutDir->SetValue(dialog.GetPath()+wxFILE_SEP_PATH);
+                m_edInDir->SetValue(dialog.GetPath()+wxFILE_SEP_PATH);
             }
             pageHasChanged = TRUE;
         }
@@ -280,7 +240,7 @@
 
         try
         {
-            IfoFile = new IFOFile(m_edMenuIFOFilename->GetValue());
+            IfoFile = new IFOFile(m_edInDir->GetValue());
         }
         catch(IFOException&)
         {
@@ -295,32 +255,22 @@
         wxFileConfig *pConfig = (wxFileConfig *)wxConfigBase::Get();
         pConfig->SetPath("/Input");
 
-        pConfig->Write("MenuIFOFilename",m_edMenuIFOFilename->GetValue());
-        pConfig->Write("MenuVOBFilename",m_edMenuVOBFilename->GetValue());
-        pConfig->Write("MovieIFOFilename",m_edMovieIFOFilename->GetValue());
+        pConfig->Write("InDirectory",    m_edInDir->GetValue());	
         pConfig->Write("OutputDirectory",m_edOutDir->GetValue());	
     }
 private:
-    wxStaticText* m_lbMenuIFO;
-    wxStaticText* m_lbMenuVOB;
-    wxStaticText* m_lbMovieIFO;
+    wxStaticText* m_lbInDir;
     wxStaticText* m_lbOutDir;
-    wxButton* m_bttBrowseMenuIFO;
-    wxButton* m_bttBrowseMenuVOB;
-    wxButton* m_bttBrowseMovieIFO;
+    wxButton* m_bttBrowseInDir;
     wxButton* m_bttBrowseOutDir;
-    wxTextCtrl* m_edMenuIFOFilename;
-    wxTextCtrl* m_edMenuVOBFilename;
-    wxTextCtrl* m_edMovieIFOFilename;
+    wxTextCtrl* m_edInDir;
     wxTextCtrl* m_edOutDir;
 
     DECLARE_EVENT_TABLE()
 };
 
 BEGIN_EVENT_TABLE(wxMyWizardPage1, wxMyWizardPageSimple)
-EVT_BUTTON(wxID_P1_BROWSE_MENU_IFO, wxMyWizardPage1::OnBrowseMenuIFO)
-EVT_BUTTON(wxID_P1_BROWSE_MENU_VOB, wxMyWizardPage1::OnBrowseMenuVOB)
-EVT_BUTTON(wxID_P1_BROWSE_MOVIE_IFO, wxMyWizardPage1::OnBrowseMovieIFO)
+EVT_BUTTON(wxID_P1_BROWSE_IN_DIR, wxMyWizardPage1::OnBrowseInputDirectory)
 EVT_BUTTON(wxID_P1_BROWSE_OUT_DIR, wxMyWizardPage1::OnBrowseOutputDirectory)
 END_EVENT_TABLE()
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.