[matroska] r972 - trunk/DvdMenuXtractor

[email protected]
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: robux4
Date: 2004-12-13 17:35:08 +0300 (Mon, 13 Dec 2004)
New Revision: 972

Modified:
   trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
Log:
rework the XML chapters output: names changed & the Menu part of VTS is now separate

Modified: trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
===================================================================
--- trunk/DvdMenuXtractor/DvdMenuXtractor.cpp	2004-12-13 14:01:25 UTC (rev 971)
+++ trunk/DvdMenuXtractor/DvdMenuXtractor.cpp	2004-12-13 14:35:08 UTC (rev 972)
@@ -1125,7 +1125,7 @@
 		wxString line, editionUID = CreateUID();
 		wxFileConfig *pConfig = (wxFileConfig *)wxConfigBase::Get();
         // Get sub directory
-        wxString Filename = pConfig->Read("OutputDirectory","") + "menuVMG.xml";
+        wxString Filename = pConfig->Read("OutputDirectory","") + "VMG_menu.xml";
 		wxTextFile XmlFile(Filename);
 		XmlFile.Create();
 		XmlFile.AddLine("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>");
@@ -1194,8 +1194,50 @@
         for (int title=1; title <= IfoFile->NumberOfTitles(); title++)
         {
 			timecode_startA = timecode_endA;
-			
-            wxString Filename = pConfig->Read("OutputDirectory","") + wxString::Format("menuVTS%02d.xml", title);
+
+			// VTS Menu
+			if (IfoFile->LanguageUnits(title) && IfoFile->LanguageUnits(title)->nr_of_lus)
+			{
+				wxString Filename = pConfig->Read("OutputDirectory","") + wxString::Format("VTSM%02d_menu.xml", title);
+				wxTextFile XmlFile(Filename);
+				XmlFile.Create();
+				XmlFile.AddLine("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>");
+				XmlFile.AddLine("<!DOCTYPE Chapters SYSTEM \"matroskachapters.dtd\">");
+				XmlFile.AddLine("");
+
+				XmlFile.AddLine("<Chapters>");
+				lvl++;
+				XmlFile.AddLine(IndentString(lvl)+"<EditionEntry>");
+					lvl++;
+					XmlFile.AddLine(IndentString(lvl)+"<EditionUID>"+editionUID+"</EditionUID>");
+					XmlFile.AddLine(IndentString(lvl)+"<EditionProcessed>1</EditionProcessed>"); // DVD style menu
+		
+					XmlFile.AddLine(IndentString(lvl)+"<!-- Video Title Set -->");
+					XmlFile.AddLine(IndentString(lvl)+"<ChapterAtom>");
+						lvl++;
+						wxString _myUIDa = CreateUID();
+						XmlFile.AddLine(IndentString(lvl)+"<ChapterUID>"+_myUIDa+"</ChapterUID>");
+						_PrivateVTS[2] = title >> 8;
+						_PrivateVTS[3] = title & 0xFF;
+						XmlFile.AddLine(IndentString(lvl)+"<ChapterProcessedPrivate>"+encodebase64(_PrivateVTS,4)+"</ChapterProcessedPrivate>");
+
+						timecode_endA = HandleLanguageUnit(lvl, XmlFile, timecode_startA, *IfoFile, title);
+
+						DisplayTime(lvl, XmlFile, timecode_startA, timecode_endA);
+						lvl--;
+					XmlFile.AddLine(IndentString(lvl)+"</ChapterAtom>");
+
+					lvl--;
+				XmlFile.AddLine(IndentString(lvl)+"</EditionEntry>");
+				lvl--;
+				XmlFile.AddLine("</Chapters>");
+				XmlFile.Write();
+			}
+
+			timecode_startA = timecode_endA;
+
+			// VTS content
+            wxString Filename = pConfig->Read("OutputDirectory","") + wxString::Format("VTS%02d_menu.xml", title);
             wxTextFile XmlFile(Filename);
             XmlFile.Create();
             XmlFile.AddLine("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>");
@@ -1217,14 +1259,7 @@
 					_PrivateVTS[2] = title >> 8;
 					_PrivateVTS[3] = title & 0xFF;
 					XmlFile.AddLine(IndentString(lvl)+"<ChapterProcessedPrivate>"+encodebase64(_PrivateVTS,4)+"</ChapterProcessedPrivate>");
-				
-					// VTS Menu
-					if (IfoFile->LanguageUnits(title) && IfoFile->LanguageUnits(title)->nr_of_lus)
-					{
-						timecode_endA = HandleLanguageUnit(lvl, XmlFile, timecode_startA, *IfoFile, title);
-					}
 
-					// VTS content
 					if (IfoFile->VtsTitles(title) && IfoFile->VtsPGCs(title))
 					{
 						uint64_t timecode_startB = timecode_endA, timecode_endB = timecode_endA;
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.