allow switching between simple and complex (multiple) titleset authoring mode, move...
[enigma2.git] / lib / python / Plugins / Extensions / DVDBurn / TitleCutter.py
index 163269c74ff05bbe9757ba439c8784398849d0fc..5cbd5d52bbeb7ef10bbb134154456f9fc6c42289 100644 (file)
@@ -20,16 +20,32 @@ class TitleCutter(CutListEditor):
                audio = service and service.audioTracks()
                n = audio and audio.getNumberOfTracks() or 0
                if n > 0:
+                       from DVDTitle import ConfigFixedText
+                       from TitleProperties import languageChoices
+                       from Components.config import config, ConfigSubsection, ConfigSubList, ConfigSelection, ConfigYesNo
+                       self.t.properties.audiotracks = ConfigSubList()
                        for x in range(n):
                                i = audio.getTrackInfo(x)
                                language = i.getLanguage()
                                description = i.getDescription()
+                               pid = str(i.getPID())
                                if description == "MPEG":
                                        description = "MP2"
-                               self.t.audiotracks.append((language, description))
-               print "[DVDBurn getAudioTracks]", self.t.audiotracks
-               self.t.sVideoType = service.info().getInfo(iServiceInformation.sVideoType)
-               print "[DVDBurn getVideoType]", self.t.sVideoType
+                               if not languageChoices.langdict.has_key(language):
+                                       language="nolang"
+                               print "[audiotrack] pid:", pid, "description:", description, "language:", language
+                               self.t.properties.audiotracks.append(ConfigSubsection())
+                               self.t.properties.audiotracks[-1].active = ConfigYesNo(default = True)
+                               self.t.properties.audiotracks[-1].format = ConfigFixedText(description)
+                               self.t.properties.audiotracks[-1].language = ConfigSelection(choices = languageChoices.choices, default=language)
+                               self.t.properties.audiotracks[-1].pid = ConfigFixedText(pid)
+               sAspect = service.info().getInfo(iServiceInformation.sAspect)
+               if sAspect in ( 1, 2, 5, 6, 9, 0xA, 0xD, 0xE ):
+                       aspect = "4:3"
+               else:
+                       aspect = "16:9"
+               self.t.properties.aspect.setValue(aspect)
+               self.t.VideoType = service.info().getInfo(iServiceInformation.sVideoType)
 
        def exit(self):
                self.session.nav.stopService()