1 from Plugins.Extensions.CutListEditor.plugin import CutListEditor
2 from Components.ServiceEventTracker import ServiceEventTracker
3 from enigma import iPlayableService, iServiceInformation
4 from Tools.Directories import fileExists
6 class TitleCutter(CutListEditor):
7 def __init__(self, session, t):
8 CutListEditor.__init__(self, session, t.source)
9 self.skin = CutListEditor.skin
10 self.session = session
12 self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
14 iPlayableService.evUpdatedInfo: self.getPMTInfo,
15 iPlayableService.evCuesheetChanged: self.refillList
17 self.onExecBegin.remove(self.showTutorial)
20 service = self.session.nav.getCurrentService()
21 audio = service and service.audioTracks()
22 n = audio and audio.getNumberOfTracks() or 0
24 from DVDTitle import ConfigFixedText
25 from TitleProperties import languageChoices
26 from Components.config import config, ConfigSubsection, ConfigSubList, ConfigSelection, ConfigYesNo
27 self.t.properties.audiotracks = ConfigSubList()
29 i = audio.getTrackInfo(x)
30 DVB_lang = i.getLanguage()
31 description = i.getDescription()
33 if description == "MPEG":
35 print "[audiotrack] pid:", pid, "description:", description, "language:", DVB_lang, "count:", x, "active:", (x < 8)
36 self.t.properties.audiotracks.append(ConfigSubsection())
37 self.t.properties.audiotracks[-1].active = ConfigYesNo(default = (x < 8))
38 self.t.properties.audiotracks[-1].format = ConfigFixedText(description)
39 self.t.properties.audiotracks[-1].language = ConfigSelection(choices = languageChoices.choices, default=languageChoices.getLanguage(DVB_lang))
40 self.t.properties.audiotracks[-1].pid = ConfigFixedText(pid)
41 self.t.properties.audiotracks[-1].DVB_lang = ConfigFixedText(DVB_lang)
42 sAspect = service.info().getInfo(iServiceInformation.sAspect)
43 if sAspect in ( 1, 2, 5, 6, 9, 0xA, 0xD, 0xE ):
47 self.t.properties.aspect.setValue(aspect)
48 self.t.VideoType = service.info().getInfo(iServiceInformation.sVideoType)
50 def checkAndGrabThumb(self):
51 if not fileExists(self.t.inputfile.rsplit('.',1)[0] + ".png"):
52 CutListEditor.grabFrame(self)
55 if self.t.VideoType == -1:
57 self.checkAndGrabThumb()
58 self.session.nav.stopService()
59 self.close(self.cut_list[:])
61 class CutlistReader(TitleCutter):
63 <screen position="0,0" size="720,576">
64 <eLabel position="0,0" size="720,576" zPosition="1" backgroundColor="#000000" />
65 <widget name="Video" position="0,0" size="100,75" />
66 <widget name="SeekState" position="0,0" />
67 <widget source="cutlist" position="0,0" render="Listbox" >
68 <convert type="TemplatedMultiContent">
70 MultiContentEntryText(text = 1),
71 MultiContentEntryText(text = 2)
73 "fonts": [gFont("Regular", 18)],
78 <widget name="Timeline" position="0,0" />
81 def __init__(self, session, t):
82 TitleCutter.__init__(self, session, t)
83 self.skin = CutlistReader.skin
86 TitleCutter.getPMTInfo(self)
87 TitleCutter.checkAndGrabThumb(self)
88 self.close(self.cut_list[:])