8 self.estimatedDiskspace = 0
11 self.chaptermarks = [ ]
13 def addService(self, service):
15 from enigma import eServiceCenter, iServiceInformation
17 serviceHandler = eServiceCenter.getInstance()
18 info = serviceHandler.info(service)
19 self.descr = info and " " + info.getInfoString(service, iServiceInformation.sDescription) or ""
20 self.name = info and info.getName(service) or "Title" + t.descr
21 self.inputfile = service.getPath()
22 self.filesize = path.getsize(self.inputfile)
23 self.estimatedDiskspace = self.filesize
24 self.length = info.getLength(service)
26 def produceFinalCuesheet(self):
27 print "[produceFinalCuesheet] >>> ", self.inputfile, self.cuesheet
39 self.chaptermarks = [ ]
41 # our demuxer expects *strictly* IN,OUT lists.
42 currently_in = not any(type == CUT_TYPE_IN for pts, type in self.cuesheet)
44 self.cutlist.append(0) # emulate "in" at first
46 for (pts, type) in self.cuesheet:
47 #print "pts=", pts, "type=", type, "accumulated_in=", accumulated_in, "accumulated_at=", accumulated_at, "last_in=", last_in
48 if type == CUT_TYPE_IN and not currently_in:
49 self.cutlist.append(pts)
53 if type == CUT_TYPE_OUT and currently_in:
54 self.cutlist.append(pts)
56 # accumulate the segment
57 accumulated_in += pts - last_in
61 if type == CUT_TYPE_MARK and currently_in:
62 # relocate chaptermark against "in" time. This is not 100% accurate,
63 # as the in/out points are not.
64 reloc_pts = pts - last_in + accumulated_in
65 self.chaptermarks.append(reloc_pts)
67 print "cutlist =", self.cutlist, "chaptermarks =", self.chaptermarks, "accumulated_in =", accumulated_in
69 if len(self.cutlist) > 1:
70 part = accumulated_in / (self.length*90000.0)
71 usedsize = int ( part * self.filesize )
72 print "part=", part, "filesize=", self.filesize, "estimatedDiskspace=", usedsize
73 self.estimatedDiskspace = usedsize
74 self.length = accumulated_in / 90000