self.settings.font_size = ConfigPixelvals()
self.settings.space = ConfigPixelvals()
self.settings.vmgm = ConfigText(visible_width = 40)
+ self.settings.autochapter = ConfigInteger(default = 0, limits = (0, 99))
+ self.filekeys = ["vmgm", "menubg", "menuaudio", "font_face"]
def addService(self, service):
import DVDTitle
self.error = "unknown attribute '%s'" % (key)
raise AttributeError
i += 1
- checkfiles = ["vmgm", "menubg", "menuaudio", "font_face"]
- for key in checkfiles:
+ for key in self.filekeys:
val = self.settings.dict()[key].getValue()
if not fileExists(val):
self.error += "\n%s '%s' not found" % (key, val)
self.length = info.getLength(service)
def produceFinalCuesheet(self):
- print "[produceFinalCuesheet] >>> ", self.inputfile, self.cuesheet
-
CUT_TYPE_IN = 0
CUT_TYPE_OUT = 1
CUT_TYPE_MARK = 2
reloc_pts = pts - last_in + accumulated_in
self.chaptermarks.append(reloc_pts)
- print "cutlist =", self.cutlist, "chaptermarks =", self.chaptermarks, "accumulated_in =", accumulated_in
-
if len(self.cutlist) > 1:
part = accumulated_in / (self.length*90000.0)
usedsize = int ( part * self.filesize )
- print "part=", part, "filesize=", self.filesize, "estimatedDiskspace=", usedsize
self.estimatedDiskspace = usedsize
self.length = accumulated_in / 90000
+
+ def produceAutoChapter(self, minutes):
+ if len(self.chaptermarks) < 1:
+ chapterpts = self.cutlist[0]
+ while chapterpts < self.length*90000:
+ chapterpts += 90000 * 60 * minutes
+ self.chaptermarks.append(chapterpts)
\ No newline at end of file
self.list.append(getConfigListEntry(_("Menu")+' '+_("spaces (top, between rows, left)"), self.settings.space))
self.list.append(getConfigListEntry(_("Menu")+' '+_("Audio"), self.settings.menuaudio))
self.list.append(getConfigListEntry(_("VMGM (intro trailer)"), self.settings.vmgm))
+ self.list.append(getConfigListEntry(_("Auto chapter split every ? minutes (0=never)"), self.settings.autochapter))
ConfigListScreen.__init__(self, self.list)
self.keydict = {}
def ok(self):
key = self.keydict[self["config"].getCurrent()[1]]
- browseKeys = ["menubg", "menuaudio", "vmgm", "font_face"]
- if key in browseKeys:
+ if key in self.project.filekeys:
self.session.openWithCallback(self.FileBrowserClosed, FileBrowser, key, self.settings)
def cancel(self):
self.session.open(MessageBox,text,type = MessageBox.TYPE_ERROR)
def FileBrowserClosed(self, path, scope):
- if scope == "project":
+ if scope in self.project.filekeys:
+ self.settings.dict()[scope].setValue(path)
+ elif scope == "project":
if not self.project.loadProject(path):
self.session.open(MessageBox,self.project.error,MessageBox.TYPE_ERROR)
- elif scope:
- self.settings.dict()[scope].setValue(path)
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)
def burnProjectCB(self):