diff options
| author | Andreas Frisch <andreas.frisch@multimedia-labs.de> | 2008-09-03 12:24:05 +0000 |
|---|---|---|
| committer | Andreas Frisch <andreas.frisch@multimedia-labs.de> | 2008-09-03 12:24:05 +0000 |
| commit | 2dc13ab463d67b1255ec31cbe2b27cafef318dbe (patch) | |
| tree | e75ad9b4933c8d7cd4c4bcd11a829ecf7eba8d1b /lib/python/Plugins/Extensions/DVDBurn/DVDProject.py | |
| parent | 2d77201356e5b7b4fb1971f651349f33e8cccd00 (diff) | |
| download | enigma2-2dc13ab463d67b1255ec31cbe2b27cafef318dbe.tar.gz enigma2-2dc13ab463d67b1255ec31cbe2b27cafef318dbe.zip | |
fix cuesheets, add multiple menu pages support, add preview support, add project saveing ...
Diffstat (limited to 'lib/python/Plugins/Extensions/DVDBurn/DVDProject.py')
| -rw-r--r-- | lib/python/Plugins/Extensions/DVDBurn/DVDProject.py | 72 |
1 files changed, 60 insertions, 12 deletions
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('<?xml version="1.0" encoding="utf-8" ?>\n') + list.append('<DreamDVDBurnerProject>\n') + list.append('\t<config') + list.append(' name="' + self.name + '"') + list.append(' vmgm="' + self.vmgm + '"') + list.append(' />\n') + list.append('\t<menu') + list.append(' bg="' + self.menubg + '"') + list.append(' audio="' + self.menuaudio + '"') + list.append(' color_button="' + str(self.color_button) + '"') + list.append(' color_highlight="' + str(self.color_highlight) + '"') + list.append(' color_headline="' + str(self.color_headline) + '"') + list.append(' font_face="' + self.font_face + '"') + list.append(' font_size="' + str(self.font_size) + '"') + list.append(' space_left="' + str(self.space_left) + '"') + list.append(' space_top="' + str(self.space_top) + '"') + list.append(' space_rows="' + str(self.space_rows) + '"') + list.append(' />\n') + list.append('\t<titles>\n') + for title in self.titles: + list.append('\t\t<path>') + list.append(stringToXML(title.source.getPath())) + list.append('</path>\n') + list.append('\t</titles>\n') + list.append('</DreamDVDBurnerProject>\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 |
