1 from Tools.Directories import resolveFilename, fileExists, SCOPE_FONTS, SCOPE_PLUGINS, SCOPE_SKIN
6 self.name = _("Dreambox DVD record")
7 self.vmgm = resolveFilename(SCOPE_PLUGINS,"Extensions/DVDBurn/dreamvmgm.mpg")
8 self.menuaudio = resolveFilename(SCOPE_PLUGINS,"Extensions/DVDBurn/silence.mp2")
9 self.menubg = resolveFilename(SCOPE_SKIN, "dreamdvd_02.jpg")
10 # tuples with R, G, B values
11 self.color_button = ( 0x08, 0x00, 0x00 )
12 self.color_highlight = ( 0x00, 0xC0, 0xC0 )
13 self.color_headline = ( 0x00, 0x00, 0x80 )
14 self.font_face = resolveFilename(SCOPE_FONTS, "nmsbd.ttf")
15 # tuple with three pixel values ( headline, title, subtitle )
16 self.font_size = ( 48, 28, 16 )
17 # please supply even numbers for all dimensions
22 def addService(self, service):
24 title = DVDTitle.DVDTitle()
25 title.addService(service)
26 self.titles.append(title)
29 def saveProject(self, path):
30 import xml.dom.minidom
31 from Tools.XMLTools import elementsWithTag, mergeText, stringToXML
33 list.append('<?xml version="1.0" encoding="utf-8" ?>\n')
34 list.append('<DreamDVDBurnerProject>\n')
35 list.append('\t<config')
36 list.append(' name="' + self.name + '"')
37 list.append(' vmgm="' + self.vmgm + '"')
39 list.append('\t<menu')
40 list.append(' bg="' + self.menubg + '"')
41 list.append(' audio="' + self.menuaudio + '"')
42 list.append(' color_button="' + str(self.color_button) + '"')
43 list.append(' color_highlight="' + str(self.color_highlight) + '"')
44 list.append(' color_headline="' + str(self.color_headline) + '"')
45 list.append(' font_face="' + self.font_face + '"')
46 list.append(' font_size="' + str(self.font_size) + '"')
47 list.append(' space_left="' + str(self.space_left) + '"')
48 list.append(' space_top="' + str(self.space_top) + '"')
49 list.append(' space_rows="' + str(self.space_rows) + '"')
51 list.append('\t<titles>\n')
52 for title in self.titles:
53 list.append('\t\t<path>')
54 list.append(stringToXML(title.source.getPath()))
55 list.append('</path>\n')
56 list.append('\t</titles>\n')
57 list.append('</DreamDVDBurnerProject>\n')
60 filename = path + "/" + self.name + ".ddvdp.xml"
61 while fileExists(filename):
63 filename = path + "/" + self.name + str(i).zfill(3) + ".ddvdp.xml"
65 file = open(filename, "w")