[matroska] r1056 - trunk/DvdMenuXtractor

[email protected]
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: robux4
Date: 2005-01-28 23:07:13 +0300 (Fri, 28 Jan 2005)
New Revision: 1056

Modified:
   trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
Log:
DMX: hide some chapter atoms, prompt before overwriting

Modified: trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
===================================================================
--- trunk/DvdMenuXtractor/DvdMenuXtractor.cpp	2005-01-28 19:34:51 UTC (rev 1055)
+++ trunk/DvdMenuXtractor/DvdMenuXtractor.cpp	2005-01-28 20:07:13 UTC (rev 1056)
@@ -73,7 +73,7 @@
 wxString outputDirectory;
 wxString mtxDirectory;
 const wxString APPLICATION_NAME = "DVDMenuXtractor: DMX - a fair-use tool";
-const wxString APPLICATION_VERSION = "0.9.0";
+const wxString APPLICATION_VERSION = "0.9.1";
 
 // ----------------------------------------------------------------------------
 
@@ -607,6 +607,7 @@
 		wxString cellName;
 		wxString MtxCommandString;
 		const CellsListType *CellsList = IfoFile->GetCellsList(title, language);
+		int fOverWrite =  wxID_YES;
 
 		if (!CellsList)
 			return;
@@ -619,6 +620,18 @@
 				newFilename = wxString::Format("VTS%s%02d", language?"M":"", title);
 
 			wxString MtxFilename = outputDirectory + newFilename + ".bat";
+
+			// check for an overwrite message
+			wxFile MtxCommandFileTest;
+			if (MtxCommandFileTest.Open(MtxFilename))
+			{
+				wxMessageDialog OverWrite(this, wxString::Format("Overwrite '%s' files ?", newFilename.c_str()), APPLICATION_NAME, wxYES_NO|wxICON_EXCLAMATION );
+				fOverWrite = OverWrite.ShowModal();
+			}
+
+			if (fOverWrite !=  wxID_YES)
+				return;
+
 			wxFile MtxCommandFile;
 			MtxCommandFile.Create(MtxFilename, true, wxS_DEFAULT | wxS_IXUSR | wxS_IXGRP | wxS_IXOTH);
 #if !defined(WIN32)
@@ -925,6 +938,7 @@
 		lvl++;
 		wxString _myUID = CreateUID();
 		XmlFile.AddLine(IndentString(lvl)+"<ChapterUID>"+_myUID+"</ChapterUID>");
+		XmlFile.AddLine(IndentString(lvl)+"<ChapterFlagHidden>1</ChapterFlagHidden>");
 		_PrivatePG[1] = (program_number+1) >> 8;
 		_PrivatePG[2] = (program_number+1) & 0xFF;
 		OutputCodecPrivate(lvl, XmlFile, _PrivatePG, 3);
@@ -985,6 +999,7 @@
 				lvl++;
 				wxString _myUID = CreateUID();
 				XmlFile.AddLine(IndentString(lvl)+"<ChapterUID>"+_myUID+"</ChapterUID>");
+				XmlFile.AddLine(IndentString(lvl)+"<ChapterFlagHidden>1</ChapterFlagHidden>");
 			
 				_PrivateCN[1] = (position.vob_id_nr) >> 8;
 				_PrivateCN[2] = (position.vob_id_nr) & 0xFF;
@@ -1041,11 +1056,18 @@
 		wxString _myUID = CreateUID();
 		XmlFile.AddLine(IndentString(lvl)+"<ChapterUID>"+_myUID+"</ChapterUID>");
 		// display the UID for the lazy rippers
-		XmlFile.AddLine(IndentString(lvl)+"<ChapterDisplay>");
-			lvl++;
-			XmlFile.AddLine(IndentString(lvl)+"<ChapterString>PGC type "+GetPGCType(pgc_type)+"</ChapterString>");
-			lvl--;
-		XmlFile.AddLine(IndentString(lvl)+"</ChapterDisplay>");
+		if (ptts == NULL)
+		{
+			XmlFile.AddLine(IndentString(lvl)+"<ChapterDisplay>");
+				lvl++;
+				XmlFile.AddLine(IndentString(lvl)+"<ChapterString>PGC type "+GetPGCType(pgc_type)+"</ChapterString>");
+				lvl--;
+			XmlFile.AddLine(IndentString(lvl)+"</ChapterDisplay>");
+		}
+		else
+		{
+			XmlFile.AddLine(IndentString(lvl)+"<ChapterFlagHidden>1</ChapterFlagHidden>");
+		}
 		
 		// PGC commands
 		XmlFile.AddLine(IndentString(lvl)+"<ChapterProcess>");
@@ -1296,6 +1318,7 @@
 					lvl++;
 					wxString _myUIDa = CreateUID();
 					XmlFile.AddLine(IndentString(lvl)+"<ChapterUID>"+_myUIDa+"</ChapterUID>");
+					XmlFile.AddLine(IndentString(lvl)+"<ChapterFlagHidden>1</ChapterFlagHidden>");
 					_PrivateVTS[2] = title >> 8;
 					_PrivateVTS[3] = title & 0xFF;
 					OutputCodecPrivate(lvl, XmlFile, _PrivateVTS, 4);
@@ -1350,6 +1373,7 @@
 				lvl++;
 				wxString _myUIDa = CreateUID();
 				XmlFile.AddLine(IndentString(lvl)+"<ChapterUID>"+_myUIDa+"</ChapterUID>");
+				XmlFile.AddLine(IndentString(lvl)+"<ChapterFlagHidden>1</ChapterFlagHidden>");
 				_PrivateVTS[2] = title >> 8;
 				_PrivateVTS[3] = title & 0xFF;
 				OutputCodecPrivate(lvl, XmlFile, _PrivateVTS, 4);
@@ -1364,6 +1388,7 @@
 							lvl++;
 							wxString _myUIDa = CreateUID();
 							XmlFile.AddLine(IndentString(lvl)+"<ChapterUID>"+_myUIDa+"</ChapterUID>");
+							XmlFile.AddLine(IndentString(lvl)+"<ChapterFlagHidden>1</ChapterFlagHidden>");
 
 							_PrivateTT[1] = (i+1) >> 8;
 							_PrivateTT[2] = (i+1) & 0xFF;
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.