From 2dc13ab463d67b1255ec31cbe2b27cafef318dbe Mon Sep 17 00:00:00 2001 From: Andreas Frisch Date: Wed, 3 Sep 2008 12:24:05 +0000 Subject: fix cuesheets, add multiple menu pages support, add preview support, add project saveing ... --- .../Plugins/Extensions/DVDBurn/DVDProject.py | 72 ++++++++++++++++++---- 1 file changed, 60 insertions(+), 12 deletions(-) (limited to 'lib/python/Plugins/Extensions/DVDBurn/DVDProject.py') diff --git a/lib/python/Plugins/Extensions/DVDBurn/DVDProject.py b/lib/python/Plugins/Extensions/DVDBurn/DVDProject.py index e7876e41..48a75544 100644 --- a/lib/python/Plugins/Extensions/DVDBurn/DVDProject.py +++ b/lib/python/Plugins/Extensions/DVDBurn/DVDProject.py @@ -1,20 +1,68 @@ +from Tools.Directories import resolveFilename, fileExists, SCOPE_FONTS, SCOPE_PLUGINS, SCOPE_SKIN class DVDProject: def __init__(self): self.titles = [ ] self.target = None - self.name = _("New DVD") + self.name = _("Dreambox DVD record") + self.vmgm = resolveFilename(SCOPE_PLUGINS,"Extensions/DVDBurn/dreamvmgm.mpg") + self.menuaudio = resolveFilename(SCOPE_PLUGINS,"Extensions/DVDBurn/silence.mp2") + self.menubg = resolveFilename(SCOPE_SKIN, "dreamdvd_02.jpg") + # tuples with R, G, B values + self.color_button = ( 0x08, 0x00, 0x00 ) + self.color_highlight = ( 0x00, 0xC0, 0xC0 ) + self.color_headline = ( 0x00, 0x00, 0x80 ) + self.font_face = resolveFilename(SCOPE_FONTS, "nmsbd.ttf") + # tuple with three pixel values ( headline, title, subtitle ) + self.font_size = ( 48, 28, 16 ) + # please supply even numbers for all dimensions + self.space_left = 30 + self.space_top = 120 + self.space_rows = 36 def addService(self, service): import DVDTitle - t = DVDTitle.DVDTitle() - t.source = service + title = DVDTitle.DVDTitle() + title.addService(service) + self.titles.append(title) + return title + + def saveProject(self, path): + import xml.dom.minidom + from Tools.XMLTools import elementsWithTag, mergeText, stringToXML + list = [] + list.append('\n') + list.append('\n') + list.append('\t\n') + list.append('\t\n') + list.append('\t\n') + for title in self.titles: + list.append('\t\t') + list.append(stringToXML(title.source.getPath())) + list.append('\n') + list.append('\t\n') + list.append('\n') - from enigma import eServiceCenter, iServiceInformation - serviceHandler = eServiceCenter.getInstance() - - info = serviceHandler.info(service) - descr = info and " " + info.getInfoString(service, iServiceInformation.sDescription) or "" - t.name = info and info.getName(service) or "Title" + descr - - self.titles.append(t) - return t + i = 0 + filename = path + "/" + self.name + ".ddvdp.xml" + while fileExists(filename): + i = i+1 + filename = path + "/" + self.name + str(i).zfill(3) + ".ddvdp.xml" + + file = open(filename, "w") + for x in list: + file.write(x) + file.close() \ No newline at end of file -- cgit v1.2.3