allow burning videos (also H.264) to data DVDs
[enigma2.git] / lib / python / Plugins / Extensions / DVDBurn / TitleList.py
index 6fcc326..353efe6 100644 (file)
@@ -11,7 +11,7 @@ from Components.Sources.Progress import Progress
 from Components.FileList import FileList
 from Components.Label import Label
 from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT
 from Components.FileList import FileList
 from Components.Label import Label
 from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT
-from Tools.Directories import resolveFilename, SCOPE_PLAYLIST
+from Tools.Directories import resolveFilename, SCOPE_PLUGINS
 
 class TitleList(Screen):
        skin = """
 
 class TitleList(Screen):
        skin = """
@@ -130,10 +130,13 @@ class TitleList(Screen):
                if source is None:
                        return None
                t = self.project.addService(source)
                if source is None:
                        return None
                t = self.project.addService(source)
-               self.editTitle(t, readOnly=True)
+               self.editTitle(t, readOnly=False)
 
        def removeCurrentTitle(self):
                title = self.getCurrentTitle()
 
        def removeCurrentTitle(self):
                title = self.getCurrentTitle()
+               self.removeTitle(title)
+       
+       def removeTitle(self, title):
                if title is not None:
                        self.project.titles.remove(title)
                        self.updateTitleList()
                if title is not None:
                        self.project.titles.remove(title)
                        self.updateTitleList()
@@ -147,7 +150,7 @@ class TitleList(Screen):
                self["title_label"].text = _("Table of content for collection") + " \"" + self.project.settings.name.getValue() + "\":"
 
        def loadTemplate(self):
                self["title_label"].text = _("Table of content for collection") + " \"" + self.project.settings.name.getValue() + "\":"
 
        def loadTemplate(self):
-               filename = resolveFilename(SCOPE_PLAYLIST)+"DreamboxDVDtemplate.ddvdp.xml"
+               filename = resolveFilename(SCOPE_PLUGINS)+"Extensions/DVDBurn/DreamboxDVDtemplate.ddvdp.xml"
                if self.project.loadProject(filename):
                        self["error_label"].hide()
                        return True
                if self.project.loadProject(filename):
                        self["error_label"].hide()
                        return True
@@ -158,11 +161,17 @@ class TitleList(Screen):
                        return False
 
        def burnProject(self):
                        return False
 
        def burnProject(self):
-               autochapter = self.project.settings.autochapter.getValue()
-               if autochapter > 0:
-                       for title in self.project.titles:
-                               title.produceAutoChapter(autochapter)
-               self.project.waitboxref = self.project.session.open(ProjectSettings.WaitBox,self.burnProjectCB)
+               if self.project.settings.authormode.getValue() == "data_ts":
+                       import Process
+                       job = Process.BurnDataTS(self.session, self.project)
+                       from Screens.TaskView import JobView
+                       self.session.open(JobView, job)
+               else:
+                       autochapter = self.project.settings.autochapter.getValue()
+                       if autochapter > 0:
+                               for title in self.project.titles:
+                                       title.produceAutoChapter(autochapter)
+                       self.project.waitboxref = self.project.session.open(ProjectSettings.WaitBox,self.burnProjectCB)
 
        def burnProjectCB(self):
                import Process
 
        def burnProjectCB(self):
                import Process
@@ -221,8 +230,18 @@ class TitleList(Screen):
                t = self.current_edit_title
                t.cuesheet = cutlist
                t.produceFinalCuesheet()
                t = self.current_edit_title
                t.cuesheet = cutlist
                t.produceFinalCuesheet()
-               print "title edit of %s done, resulting cutlist:" % (t.source.toString()), t.cutlist, "chaptermarks:", t.chaptermarks
-               self.updateTitleList()
+               if t.sVideoType != 0:
+                       self.session.openWithCallback(self.DVDformatCB,MessageBox,text = _("The DVD standard doesn't support H.264 (HDTV) video streams. Do you want to create a Dreambox format data DVD (which will not play in stand-alone DVD players) instead?"), type = MessageBox.TYPE_YESNO)
+               else:
+                       self.updateTitleList()
+
+       def DVDformatCB(self, answer):
+               t = self.current_edit_title
+               if answer == True:
+                       self.project.settings.authormode.setValue("data_ts")
+                       self.updateTitleList()
+               else:
+                       self.removeTitle(t)
 
        def leave(self):
                self.close()
 
        def leave(self):
                self.close()