def processOutputLine(self, line):
line = line[:-1]
+ #print "[DemuxTask]", line
MSG_NEW_FILE = "---> new File: "
MSG_PROGRESS = "[PROGRESS] "
- MSG_NEW_MP2 = "--> MPEG Audio (0x"
- MSG_NEW_AC3 = "--> AC-3/DTS Audio on PID "
+ MSG_NEW_MP2 = "++> Mpg Audio: PID 0x"
+ MSG_NEW_AC3 = "++> AC3/DTS Audio: PID 0x"
if line.startswith(MSG_NEW_FILE):
file = line[len(MSG_NEW_FILE):]
progress = line[len(MSG_PROGRESS):]
self.haveProgress(progress)
elif line.startswith(MSG_NEW_MP2) or line.startswith(MSG_NEW_AC3):
- self.currentPID = str(int(line.rstrip()[-6:].rsplit('0x',1)[-1],16))
+ try:
+ self.currentPID = str(int(line.split(': PID 0x',1)[1].split(' ',1)[0],16))
+ except ValueError:
+ print "[DemuxTask] ERROR: couldn't detect Audio PID (projectx too old?)"
def haveNewFile(self, file):
print "[DemuxTask] produced file:", file, self.currentPID
if failed:
import os
for file in self.generated_files:
- os.remove(file)
+ try:
+ os.remove(file)
+ except OSError:
+ pass
class MplexTaskPostcondition(Condition):
def check(self, task):
elif line.startswith(":-["):
if line.find("ASC=30h") != -1:
self.error = self.ERROR_NOTWRITEABLE
- if line.find("ASC=24h") != -1:
+ elif line.find("ASC=24h") != -1:
self.error = self.ERROR_LOAD
- if line.find("SK=5h/ASC=A8h/ACQ=04h") != -1:
+ elif line.find("SK=5h/ASC=A8h/ACQ=04h") != -1:
self.error = self.ERROR_MINUSRWBUG
else:
self.error = self.ERROR_UNKNOWN
self.finish(aborted = True)
def run(self, callback):
+ self.callback = callback
failed_preconditions = self.checkPreconditions(True) + self.checkPreconditions(False)
if len(failed_preconditions):
callback(self, failed_preconditions)
return
- self.callback = callback
Task.processFinished(self, 0)
class PreviewTask(Task):
if self.job.menupreview:
self.previewProject()
else:
- from Tools import Notifications
- Notifications.AddNotificationWithCallback(self.previewCB, MessageBox, _("Do you want to preview this DVD before burning?"), timeout = 60, default = False)
+ import Screens.Standby
+ if Screens.Standby.inStandby:
+ self.previewCB(False)
+ else:
+ from Tools import Notifications
+ Notifications.AddNotificationWithCallback(self.previewCB, MessageBox, _("Do you want to preview this DVD before burning?"), timeout = 60, default = False)
def abort(self):
self.finish(aborted = True)
authorxml.append('<?xml version="1.0" encoding="utf-8"?>\n')
authorxml.append(' <dvdauthor dest="' + (job.workspace+"/dvd") + '">\n')
authorxml.append(' <vmgm>\n')
- authorxml.append(' <menus>\n')
+ authorxml.append(' <menus lang="' + job.project.menutemplate.settings.menulang.getValue() + '">\n')
authorxml.append(' <pgc>\n')
authorxml.append(' <vob file="' + job.project.settings.vmgm.getValue() + '" />\n', )
if mode.startswith("menu"):
authorxml.append(' </vmgm>\n')
authorxml.append(' <titleset>\n')
if mode.startswith("menu"):
- authorxml.append(' <menus>\n')
+ authorxml.append(' <menus lang="' + job.project.menutemplate.settings.menulang.getValue() + '">\n')
authorxml.append(' <video aspect="4:3"/>\n')
for menu_count in range(1 , job.nr_menus+1):
if menu_count == 1:
authorxml.append('<?xml version="1.0" encoding="utf-8"?>\n')
authorxml.append(' <dvdauthor dest="' + (job.workspace+"/dvd") + '" jumppad="yes">\n')
authorxml.append(' <vmgm>\n')
- authorxml.append(' <menus>\n')
+ authorxml.append(' <menus lang="' + job.project.menutemplate.settings.menulang.getValue() + '">\n')
authorxml.append(' <video aspect="4:3"/>\n')
if mode.startswith("menu"):
for menu_count in range(1 , job.nr_menus+1):
- authorxml.append(' <pgc>\n')
+ if menu_count == 1:
+ authorxml.append(' <pgc>\n')
+ else:
+ authorxml.append(' <pgc>\n')
menu_start_title = (menu_count-1)*job.titles_per_menu + 1
menu_end_title = (menu_count)*job.titles_per_menu + 1
if menu_end_title > nr_titles:
for i in range( nr_titles ):
title = job.project.titles[i]
authorxml.append(' <titleset>\n')
+ authorxml.append(' <menus lang="' + job.project.menutemplate.settings.menulang.getValue() + '">\n')
+ authorxml.append(' <pgc entry="root">\n')
+ authorxml.append(' <pre>\n')
+ authorxml.append(' jump vmgm menu entry title;\n')
+ authorxml.append(' </pre>\n')
+ authorxml.append(' </pgc>\n')
+ authorxml.append(' </menus>\n')
authorxml.append(' <titles>\n')
for audiotrack in title.properties.audiotracks:
active = audiotrack.active.getValue()
self.name = _("Burn DVD")
tool = "/bin/growisofs"
burnargs = [ "-Z", "/dev/" + harddiskmanager.getCD(), "-dvd-compat" ]
+ if self.project.size/(1024*1024) > self.project.MAX_SL:
+ burnargs += [ "-use-the-force-luke=4gms", "-speed=1", "-R" ]
elif output == "iso":
self.name = _("Create DVD-ISO")
tool = "/usr/bin/mkisofs"
if output == "dvd":
self.name = _("Burn DVD")
burnargs = [ "-Z", "/dev/" + harddiskmanager.getCD(), "-dvd-compat" ]
+ if self.project.size/(1024*1024) > self.project.MAX_SL:
+ burnargs += [ "-use-the-force-luke=4gms", "-speed=1", "-R" ]
elif output == "iso":
tool = "/usr/bin/mkisofs"
self.name = _("Create DVD-ISO")
Job.__init__(self, _("Burn DVD"))
self.project = project
self.menupreview = False
+ from Tools.Directories import getSize
if imagepath.endswith(".iso"):
PreviewTask(self, imagepath)
burnargs = [ "-Z", "/dev/" + harddiskmanager.getCD() + '='+imagepath, "-dvd-compat" ]
+ if getSize(imagepath)/(1024*1024) > self.project.MAX_SL:
+ burnargs += [ "-use-the-force-luke=4gms", "-speed=1", "-R" ]
else:
PreviewTask(self, imagepath + "/VIDEO_TS/")
volName = self.project.settings.name.getValue()
burnargs = [ "-Z", "/dev/" + harddiskmanager.getCD(), "-dvd-compat" ]
+ if getSize(imagepath)/(1024*1024) > self.project.MAX_SL:
+ burnargs += [ "-use-the-force-luke=4gms", "-speed=1", "-R" ]
burnargs += [ "-dvd-video", "-publisher", "Dreambox", "-V", volName, imagepath ]
tool = "/bin/growisofs"
BurnTask(self, burnargs, tool)