aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Plugins/Extensions
diff options
context:
space:
mode:
authorFraxinas <andreas.frisch@multimedia-labs.de>2010-04-09 08:25:08 +0200
committerFraxinas <andreas.frisch@multimedia-labs.de>2010-04-09 08:25:08 +0200
commit98c7a787df63a93f868548c2b1e357c0d873ebbe (patch)
treee8258f3e175e540e6106e0b7202abcf550b825d1 /lib/python/Plugins/Extensions
parentae60e9e3642949a91b7ea4f77374495fec9a51ed (diff)
parent76250cdc36d0f0e84505d5654066229b846f035f (diff)
downloadenigma2-98c7a787df63a93f868548c2b1e357c0d873ebbe.tar.gz
enigma2-98c7a787df63a93f868548c2b1e357c0d873ebbe.zip
Merge branch 'experimental' of git.opendreambox.org:/git/enigma2 into experimental
Diffstat (limited to 'lib/python/Plugins/Extensions')
-rw-r--r--lib/python/Plugins/Extensions/DVDBurn/DVDProject.py102
-rw-r--r--lib/python/Plugins/Extensions/DVDBurn/DVDTitle.py28
-rwxr-xr-xlib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py23
-rw-r--r--lib/python/Plugins/Extensions/DVDBurn/TitleCutter.py22
-rwxr-xr-xlib/python/Plugins/Extensions/DVDBurn/TitleList.py115
-rwxr-xr-xlib/python/Plugins/Extensions/DVDBurn/TitleProperties.py13
-rw-r--r--lib/python/Plugins/Extensions/DVDBurn/plugin.py2
-rw-r--r--lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp47
-rw-r--r--lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.h2
-rwxr-xr-xlib/python/Plugins/Extensions/MediaPlayer/plugin.py2
10 files changed, 255 insertions, 101 deletions
diff --git a/lib/python/Plugins/Extensions/DVDBurn/DVDProject.py b/lib/python/Plugins/Extensions/DVDBurn/DVDProject.py
index 83672460..7f755db4 100644
--- a/lib/python/Plugins/Extensions/DVDBurn/DVDProject.py
+++ b/lib/python/Plugins/Extensions/DVDBurn/DVDProject.py
@@ -1,5 +1,7 @@
from Tools.Directories import fileExists
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigText, ConfigSelection, getConfigListEntry, ConfigSequence, ConfigSubList
+import DVDTitle
+import xml.dom.minidom
class ConfigColor(ConfigSequence):
def __init__(self, default = [128,128,128]):
@@ -10,7 +12,10 @@ class ConfigFilename(ConfigText):
ConfigText.__init__(self, default = "", fixed_size = True, visible_width = False)
def getMulti(self, selected):
- filename = (self.text.rstrip("/").rsplit("/",1))[1].encode("utf-8")[:40] + " "
+ if self.text == "":
+ return ("mtext"[1-selected:], "", 0)
+ cut_len = min(len(self.text),40)
+ filename = (self.text.rstrip("/").rsplit("/",1))[1].encode("utf-8")[:cut_len] + " "
if self.allmarked:
mark = range(0, len(filename))
else:
@@ -34,10 +39,11 @@ class DVDProject:
self.settings.vmgm = ConfigFilename()
self.filekeys = ["vmgm", "isopath", "menutemplate"]
self.menutemplate = MenuTemplate()
+ self.error = ""
+ self.session = None
def addService(self, service):
- import DVDTitle
- title = DVDTitle.DVDTitle()
+ title = DVDTitle.DVDTitle(self)
title.addService(service)
self.titles.append(title)
return title
@@ -100,47 +106,78 @@ class DVDProject:
return ret
def loadProject(self, filename):
- import xml.dom.minidom
- try:
+ #try:
if not fileExists(filename):
self.error = "xml file not found!"
- raise AttributeError
- else:
- self.error = ""
+ #raise AttributeError
file = open(filename, "r")
data = file.read().decode("utf-8").replace('&',"&amp;").encode("ascii",'xmlcharrefreplace')
file.close()
projectfiledom = xml.dom.minidom.parseString(data)
- for project in projectfiledom.childNodes[0].childNodes:
- if project.nodeType == xml.dom.minidom.Element.nodeType:
- if project.tagName == 'settings':
- i = 0
- if project.attributes.length < len(self.settings.dict())-1:
- self.error = "project attributes missing"
- raise AttributeError
- while i < project.attributes.length:
- item = project.attributes.item(i)
- key = item.name.encode("utf-8")
- try:
- val = eval(item.nodeValue)
- except (NameError, SyntaxError):
- val = item.nodeValue.encode("utf-8")
- try:
- self.settings.dict()[key].setValue(val)
- except (KeyError):
- self.error = "unknown attribute '%s'" % (key)
- raise AttributeError
- i += 1
+ for node in projectfiledom.childNodes[0].childNodes:
+ print "node:", node
+ if node.nodeType == xml.dom.minidom.Element.nodeType:
+ if node.tagName == 'settings':
+ self.xmlAttributesToConfig(node, self.settings)
+ elif node.tagName == 'titles':
+ self.xmlGetTitleNodeRecursive(node)
+
for key in self.filekeys:
val = self.settings.dict()[key].getValue()
if not fileExists(val):
self.error += "\n%s '%s' not found" % (key, val)
- if len(self.error):
- raise AttributeError
+ #except AttributeError:
+ #print "loadProject AttributeError", self.error
+ #self.error += (" in project '%s'") % (filename)
+ #return False
+ return True
+
+ def xmlAttributesToConfig(self, node, config):
+ try:
+ i = 0
+ #if node.attributes.length < len(config.dict())-1:
+ #self.error = "project attributes missing"
+ #raise AttributeError
+ while i < node.attributes.length:
+ item = node.attributes.item(i)
+ key = item.name.encode("utf-8")
+ try:
+ val = eval(item.nodeValue)
+ except (NameError, SyntaxError):
+ val = item.nodeValue.encode("utf-8")
+ try:
+ print "config[%s].setValue(%s)" % (key, val)
+ config.dict()[key].setValue(val)
+ except (KeyError):
+ self.error = "unknown attribute '%s'" % (key)
+ print "KeyError", self.error
+ raise AttributeError
+ i += 1
except AttributeError:
- self.error += (" in project '%s'") % (filename)
+ self.error += (" XML attribute error '%s'") % node.toxml()
return False
- return True
+
+ def xmlGetTitleNodeRecursive(self, node, title_idx = -1):
+ print "[xmlGetTitleNodeRecursive]", title_idx, node
+ print node.childNodes
+ for subnode in node.childNodes:
+ print "xmlGetTitleNodeRecursive subnode:", subnode
+ if subnode.nodeType == xml.dom.minidom.Element.nodeType:
+ if subnode.tagName == 'title':
+ title_idx += 1
+ title = DVDTitle.DVDTitle(self)
+ self.titles.append(title)
+ self.xmlGetTitleNodeRecursive(subnode, title_idx)
+ if subnode.tagName == 'path':
+ print "path:", subnode.firstChild.data
+ filename = subnode.firstChild.data
+ self.titles[title_idx].addFile(filename.encode("utf-8"))
+ if subnode.tagName == 'properties':
+ self.xmlAttributesToConfig(node, self.titles[title_idx].properties)
+ if subnode.tagName == 'audiotracks':
+ self.xmlGetTitleNodeRecursive(subnode, title_idx)
+ if subnode.tagName == 'audiotrack':
+ print "audiotrack...", subnode.toxml()
def getSize(self):
totalsize = 0
@@ -187,6 +224,7 @@ class MenuTemplate(DVDProject):
self.filekeys = ["menubg", "menuaudio", "fontface_headline", "fontface_title", "fontface_subtitle"]
from TitleProperties import languageChoices
self.settings.menulang = ConfigSelection(choices = languageChoices.choices, default=languageChoices.choices[1][0])
+ self.error = ""
def loadTemplate(self, filename):
ret = DVDProject.loadProject(self, filename)
diff --git a/lib/python/Plugins/Extensions/DVDBurn/DVDTitle.py b/lib/python/Plugins/Extensions/DVDBurn/DVDTitle.py
index 660005e6..6dff00d6 100644
--- a/lib/python/Plugins/Extensions/DVDBurn/DVDTitle.py
+++ b/lib/python/Plugins/Extensions/DVDBurn/DVDTitle.py
@@ -1,4 +1,5 @@
from Components.config import config, ConfigSubsection, ConfigSubList, ConfigInteger, ConfigText, ConfigSelection, getConfigListEntry, ConfigSequence, ConfigYesNo
+import TitleCutter
class ConfigFixedText(ConfigText):
def __init__(self, text, visible_width=60):
@@ -7,17 +8,17 @@ class ConfigFixedText(ConfigText):
pass
class DVDTitle:
- def __init__(self):
+ def __init__(self, project):
self.properties = ConfigSubsection()
self.properties.menutitle = ConfigText(fixed_size = False, visible_width = 80)
self.properties.menusubtitle = ConfigText(fixed_size = False, visible_width = 80)
- self.DVBname = _("Title")
- self.DVBdescr = _("Description")
- self.DVBchannel = _("Channel")
self.properties.aspect = ConfigSelection(choices = [("4:3", _("4:3")), ("16:9", _("16:9"))])
self.properties.widescreen = ConfigSelection(choices = [("nopanscan", "nopanscan"), ("noletterbox", "noletterbox")])
self.properties.autochapter = ConfigInteger(default = 0, limits = (0, 60))
self.properties.audiotracks = ConfigSubList()
+ self.DVBname = _("Title")
+ self.DVBdescr = _("Description")
+ self.DVBchannel = _("Channel")
self.cuesheet = [ ]
self.source = None
self.filesize = 0
@@ -27,6 +28,8 @@ class DVDTitle:
self.chaptermarks = [ ]
self.timeCreate = None
self.VideoType = -1
+ self.project = project
+ self.length = 0
def addService(self, service):
from os import path
@@ -36,7 +39,7 @@ class DVDTitle:
self.source = service
serviceHandler = eServiceCenter.getInstance()
info = serviceHandler.info(service)
- sDescr = info and " " + info.getInfoString(service, iServiceInformation.sDescription) or ""
+ sDescr = info and info.getInfoString(service, iServiceInformation.sDescription) or ""
self.DVBdescr = sDescr
sTimeCreate = info.getInfo(service, iServiceInformation.sTimeCreate)
if sTimeCreate > 1:
@@ -49,9 +52,20 @@ class DVDTitle:
self.filesize = path.getsize(self.inputfile)
self.estimatedDiskspace = self.filesize
self.length = info.getLength(service)
+
+ def addFile(self, filename):
+ from enigma import eServiceReference
+ ref = eServiceReference(1, 0, filename)
+ self.addService(ref)
+ self.project.session.openWithCallback(self.titleEditDone, TitleCutter.CutlistReader, self)
+
+ def titleEditDone(self, cutlist):
+ self.initDVDmenuText(len(self.project.titles))
+ self.cuesheet = cutlist
+ self.produceFinalCuesheet()
- def initDVDmenuText(self, project, track):
- s = project.menutemplate.settings
+ def initDVDmenuText(self, track):
+ s = self.project.menutemplate.settings
self.properties.menutitle.setValue(self.formatDVDmenuText(s.titleformat.getValue(), track))
self.properties.menusubtitle.setValue(self.formatDVDmenuText(s.subtitleformat.getValue(), track))
diff --git a/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py b/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py
index a1c38842..39d7277e 100755
--- a/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py
+++ b/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py
@@ -92,10 +92,10 @@ class ProjectSettings(Screen,ConfigListScreen):
<ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />
<ePixmap pixmap="skin_default/buttons/yellow.png" position="280,0" size="140,40" alphatest="on" />
<ePixmap pixmap="skin_default/buttons/blue.png" position="420,0" size="140,40" alphatest="on" />
- <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
- <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
- <widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#a08500" transparent="1" />
- <widget source="key_blue" render="Label" position="420,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#18188b" transparent="1" />
+ <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
+ <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+ <widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#a08500" transparent="1" />
+ <widget source="key_blue" render="Label" position="420,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#18188b" transparent="1" />
<widget name="config" position="5,50" size="550,276" scrollbarMode="showOnDemand" />
<ePixmap pixmap="skin_default/div-h.png" position="0,350" zPosition="1" size="560,2" />
<widget source="info" render="Label" position="10,360" size="550,80" font="Regular;18" halign="center" valign="center" />
@@ -233,10 +233,19 @@ class ProjectSettings(Screen,ConfigListScreen):
else:
self.session.open(MessageBox,self.project.error,MessageBox.TYPE_ERROR)
elif scope == "project":
- if self.project.loadProject(path):
- self.initConfigList()
+ self.path = path
+ print "len(self.titles)", len(self.project.titles)
+ if len(self.project.titles):
+ self.session.openWithCallback(self.askLoadCB, MessageBox,text = _("Your current collection will get lost!") + "\n" + _("Do you want to restore your settings?"), type = MessageBox.TYPE_YESNO)
else:
- self.session.open(MessageBox,self.project.error,MessageBox.TYPE_ERROR)
+ self.askLoadCB(True)
elif scope:
configRef.setValue(path)
self.initConfigList()
+
+ def askLoadCB(self, answer):
+ if answer is not None and answer:
+ if self.project.loadProject(self.path):
+ self.initConfigList()
+ else:
+ self.session.open(MessageBox,self.project.error,MessageBox.TYPE_ERROR) \ No newline at end of file
diff --git a/lib/python/Plugins/Extensions/DVDBurn/TitleCutter.py b/lib/python/Plugins/Extensions/DVDBurn/TitleCutter.py
index 61152e8a..a52fad9f 100644
--- a/lib/python/Plugins/Extensions/DVDBurn/TitleCutter.py
+++ b/lib/python/Plugins/Extensions/DVDBurn/TitleCutter.py
@@ -52,13 +52,35 @@ class TitleCutter(CutListEditor):
CutListEditor.grabFrame(self)
def exit(self):
+ if self.t.VideoType == -1:
+ self.getPMTInfo()
self.checkAndGrabThumb()
self.session.nav.stopService()
self.close(self.cut_list[:])
class CutlistReader(TitleCutter):
+ skin = """
+ <screen position="0,0" size="720,576">
+ <eLabel position="0,0" size="720,576" zPosition="1" backgroundColor="#000000" />
+ <widget name="Video" position="0,0" size="100,75" />
+ <widget name="SeekState" position="0,0" />
+ <widget source="cutlist" position="0,0" render="Listbox" >
+ <convert type="TemplatedMultiContent">
+ {"template": [
+ MultiContentEntryText(text = 1),
+ MultiContentEntryText(text = 2)
+ ],
+ "fonts": [gFont("Regular", 18)],
+ "itemHeight": 20
+ }
+ </convert>
+ </widget>
+ <widget name="Timeline" position="0,0" />
+ </screen>"""
+
def __init__(self, session, t):
TitleCutter.__init__(self, session, t)
+ self.skin = CutlistReader.skin
def getPMTInfo(self):
TitleCutter.getPMTInfo(self)
diff --git a/lib/python/Plugins/Extensions/DVDBurn/TitleList.py b/lib/python/Plugins/Extensions/DVDBurn/TitleList.py
index dbc988b1..2cbeb633 100755
--- a/lib/python/Plugins/Extensions/DVDBurn/TitleList.py
+++ b/lib/python/Plugins/Extensions/DVDBurn/TitleList.py
@@ -11,38 +11,46 @@ from Components.Sources.List import List
from Components.Sources.StaticText import StaticText
from Components.Sources.Progress import Progress
from Components.MultiContent import MultiContentEntryText
+from Components.Label import MultiColorLabel
from enigma import gFont, RT_HALIGN_LEFT, RT_HALIGN_RIGHT
from Tools.Directories import resolveFilename, SCOPE_PLUGINS
class TitleList(Screen, HelpableScreen):
skin = """
- <screen name="TitleList" position="center,center" size="560,445" title="DVD Tool" >
+ <screen name="TitleList" position="center,center" size="560,470" title="DVD Tool" >
<ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
<ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />
<ePixmap pixmap="skin_default/buttons/yellow.png" position="280,0" size="140,40" alphatest="on" />
<ePixmap pixmap="skin_default/buttons/blue.png" position="420,0" size="140,40" alphatest="on" />
- <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
- <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
- <widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#a08500" transparent="1" />
- <widget source="key_blue" render="Label" position="420,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#18188b" transparent="1" />
+ <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
+ <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+ <widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#a08500" transparent="1" />
+ <widget source="key_blue" render="Label" position="420,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#18188b" transparent="1" />
<widget source="title_label" render="Label" position="10,48" size="540,38" font="Regular;18" transparent="1" />
- <widget source="error_label" render="Label" position="10,48" size="540,395" zPosition="3" font="Regular;20" transparent="1" />
- <widget source="titles" render="Listbox" scrollbarMode="showOnDemand" position="10,86" size="540,312" zPosition="3" transparent="1" >
+ <widget source="error_label" render="Label" position="10,48" size="540,296" zPosition="3" font="Regular;20" transparent="1" />
+ <widget source="titles" render="Listbox" scrollbarMode="showOnDemand" position="10,86" size="546,296" zPosition="3" transparent="1" >
<convert type="TemplatedMultiContent">
{"template": [
- MultiContentEntryText(pos = (0, 0), size = (420, 20), font = 0, flags = RT_HALIGN_LEFT, text = 1), # index 1 Title,
- MultiContentEntryText(pos = (0, 20), size = (328, 17), font = 1, flags = RT_HALIGN_LEFT, text = 2), # index 2 description,
- MultiContentEntryText(pos = (420, 6), size = (120, 20), font = 1, flags = RT_HALIGN_RIGHT, text = 3), # index 3 begin time,
- MultiContentEntryText(pos = (328, 20), size = (154, 17), font = 1, flags = RT_HALIGN_RIGHT, text = 4), # index 4 channel,
- MultiContentEntryText(pos = (482, 20), size = (58, 20), font = 1, flags = RT_HALIGN_RIGHT, text = 5), # index 4 channel,
+ MultiContentEntryText(pos = (0, 0), size = (360, 20), font = 0, flags = RT_HALIGN_LEFT, text = 1), # index 1 Title,
+ MultiContentEntryText(pos = (0, 20), size = (360, 17), font = 1, flags = RT_HALIGN_LEFT, text = 2), # index 2 description,
+ MultiContentEntryText(pos = (366, 6), size = (152, 20), font = 1, flags = RT_HALIGN_RIGHT, text = 3), # index 3 channel,
+ MultiContentEntryText(pos = (366, 20), size = (102, 17), font = 1, flags = RT_HALIGN_RIGHT, text = 4), # index 4 begin time,
+ MultiContentEntryText(pos = (470, 20), size = (48, 20), font = 1, flags = RT_HALIGN_RIGHT, text = 5), # index 5 duration,
],
"fonts": [gFont("Regular", 20), gFont("Regular", 14)],
"itemHeight": 37
}
</convert>
</widget>
- <widget source="space_bar" render="Progress" position="10,410" size="540,26" borderWidth="1" backgroundColor="#254f7497" />
- <widget source="space_label" render="Label" position="40,414" size="480,22" zPosition="2" font="Regular;18" halign="center" transparent="1" foregroundColor="#000000" />
+ <ePixmap pixmap="skin_default/div-h.png" position="0,390" zPosition="10" size="560,2" />
+ <ePixmap pixmap="skin_default/buttons/key_menu.png" position="10,394" size="35,25" alphatest="on" />
+ <widget source="hint" render="Label" position="50,396" size="540,22" font="Regular;18" halign="left" />
+ <widget name="medium_label" position="10,420" size="540,22" font="Regular;18" halign="left" foregroundColors="#FFFFFF,#FFFF00,#FF0000" />
+ <widget source="space_bar_single" render="Progress" position="10,446" size="270,24" borderWidth="1" zPosition="2" backgroundColor="#254f7497" />
+ <widget source="space_label_single" render="Label" position="10,449" size="270,22" zPosition="3" font="Regular;18" halign="center" transparent="1" foregroundColor="#000000" />
+ <widget source="space_bar_dual" render="Progress" position="10,446" size="540,24" borderWidth="1" backgroundColor="#254f7497" />
+ <widget source="space_label_dual" render="Label" position="10,449" size="540,22" zPosition="2" font="Regular;18" halign="center" transparent="1" foregroundColor="#000000" />
+
</screen>"""
def __init__(self, session, project = None):
@@ -75,17 +83,19 @@ class TitleList(Screen, HelpableScreen):
self["title_label"] = StaticText()
self["error_label"] = StaticText()
- self["space_label"] = StaticText()
- self["space_bar"] = Progress()
+ self["space_label_single"] = StaticText()
+ self["space_label_dual"] = StaticText()
+ self["hint"] = StaticText(_("Advanced Options"))
+ self["medium_label"] = MultiColorLabel()
+ self["space_bar_single"] = Progress()
+ self["space_bar_dual"] = Progress()
+ self["titles"] = List([])
+ self.previous_size = 0
if project is not None:
self.project = project
else:
self.newProject()
-
- self["titles"] = List([])
- self.updateTitleList()
- self.previous_size = 0
self.onLayoutFinish.append(self.layoutFinished)
def layoutFinished(self):
@@ -107,15 +117,16 @@ class TitleList(Screen, HelpableScreen):
j = self.backgroundJob
menu.append(("%s: %s (%d%%)" % (j.getStatustext(), j.name, int(100*j.progress/float(j.end))), self.showBackgroundJob))
menu.append((_("DVD media toolbox"), self.toolbox))
- menu.append((_("Preview menu"), self.previewMenu))
if self.project.settings.output.getValue() == "dvd":
if len(self["titles"].list):
menu.append((_("Burn DVD"), self.burnProject))
elif self.project.settings.output.getValue() == "iso":
menu.append((_("Create DVD-ISO"), self.burnProject))
menu.append((_("Burn existing image to DVD"), self.selectImage))
- menu.append((_("Edit chapters of current title"), self.editTitle))
- menu.append((_("Reset and renumerate title names"), self.resetTitles))
+ if len(self["titles"].list):
+ menu.append((_("Preview menu"), self.previewMenu))
+ menu.append((_("Edit chapters of current title"), self.editTitle))
+ menu.append((_("Reset and renumerate title names"), self.resetTitles))
menu.append((_("Exit"), self.leave))
self.session.openWithCallback(self.menuCallback, ChoiceBox, title="", list=menu)
@@ -149,9 +160,9 @@ class TitleList(Screen, HelpableScreen):
<ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
<ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />
<ePixmap pixmap="skin_default/buttons/yellow.png" position="280,0" size="140,40" alphatest="on" />
- <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
- <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
- <widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#a08500" transparent="1" />
+ <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
+ <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+ <widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#a08500" transparent="1" />
<widget name="waitingtext" position="0,45" size="560,395" zPosition="4" font="Regular;22" halign="center" valign="center" />
<widget name="list" position="5,40" size="550,375" zPosition="2" scrollbarMode="showOnDemand" />
<widget name="DescriptionBorder" pixmap="skin_default/border_eventinfo.png" position="0,316" zPosition="1" size="560,103" transparent="1" alphatest="on" />
@@ -197,7 +208,7 @@ class TitleList(Screen, HelpableScreen):
self.close(current)
self.session.openWithCallback(self.selectedSource, DVDMovieSelection)
- def selectedSource(self, source):
+ def selectedSource(self, source = None):
if source is None:
return None
if not source.getPath().endswith(".ts"):
@@ -228,7 +239,7 @@ class TitleList(Screen, HelpableScreen):
def settingsCB(self, update=True):
if not update:
return
- self["title_label"].text = _("Table of content for collection") + " \"" + self.project.settings.name.getValue() + "\":"
+ self.updateTitleList()
def loadTemplate(self):
filename = resolveFilename(SCOPE_PLUGINS)+"Extensions/DVDBurn/DreamboxDVD.ddvdp.xml"
@@ -281,9 +292,11 @@ class TitleList(Screen, HelpableScreen):
if len(list):
self["key_red"].text = _("Remove title")
self["key_yellow"].text = _("Title properties")
+ self["title_label"].text = _("Table of content for collection") + " \"" + self.project.settings.name.getValue() + "\":"
else:
self["key_red"].text = ""
self["key_yellow"].text = ""
+ self["title_label"].text = _("Please add titles to the compilation.")
def updateSize(self):
size = self.project.size/(1024*1024)
@@ -292,20 +305,32 @@ class TitleList(Screen, HelpableScreen):
print "updateSize:", size, "MAX_DL:", MAX_DL, "MAX_SL:", MAX_SL
if size > MAX_DL:
percent = 100 * size / float(MAX_DL)
- self["space_label"].text = "%d MB - " % size + _("exceeds dual layer medium!") + " (%.2f%% " % (100-percent) + _("free") + ")"
- self["space_bar"].value = int(percent)
+ self["space_label_dual"].text = "%d MB (%.2f%%)" % (size, percent)
+ self["space_bar_dual"].value = int(percent)
+ self["space_bar_single"].value = 100
+ self["space_label_single"].text = ""
+ self["medium_label"].setText(_("Exceeds dual layer medium!"))
+ self["medium_label"].setForegroundColorNum(2)
if self.previous_size < MAX_DL:
- self.session.open(MessageBox,text = _("exceeds dual layer medium!"), type = MessageBox.TYPE_ERROR)
+ self.session.open(MessageBox,text = _("Exceeds dual layer medium!"), type = MessageBox.TYPE_ERROR)
elif size > MAX_SL:
percent = 100 * size / float(MAX_DL)
- self["space_label"].text = "%d MB " % size + _("of a DUAL layer medium used.") + " (%.2f%% " % (100-percent) + _("free") + ")"
- self["space_bar"].value = int(percent)
+ self["space_label_dual"].text = "%d MB (%.2f%%)" % (size, percent)
+ self["space_bar_dual"].value = int(percent)
+ self["space_bar_single"].value = 100
+ self["space_label_single"].text = ""
+ self["medium_label"].setText(_("Required medium type:") + " " + _("DUAL LAYER DVD") + ", %d MB " % (MAX_DL - size) + _("free"))
+ self["medium_label"].setForegroundColorNum(1)
if self.previous_size < MAX_SL:
- self.session.open(MessageBox,text = _("Your collection exceeds the size of a single layer medium, you will need a blank dual layer DVD!"), type = MessageBox.TYPE_INFO)
+ self.session.open(MessageBox, text = _("Your collection exceeds the size of a single layer medium, you will need a blank dual layer DVD!"), timeout = 10, type = MessageBox.TYPE_INFO)
elif size < MAX_SL:
percent = 100 * size / float(MAX_SL)
- self["space_label"].text = "%d MB " % size + _("of a SINGLE layer medium used.") + " (%.2f%% " % (100-percent) + _("free") + ")"
- self["space_bar"].value = int(percent)
+ self["space_label_single"].text = "%d MB (%.2f%%)" % (size, percent)
+ self["space_bar_single"].value = int(percent)
+ self["space_bar_dual"].value = 0
+ self["space_label_dual"].text = ""
+ self["medium_label"].setText(_("Required medium type:") + " " + _("SINGLE LAYER DVD") + ", %d MB " % (MAX_SL - size) + _("free"))
+ self["medium_label"].setForegroundColorNum(0)
self.previous_size = size
def getCurrentTitle(self):
@@ -323,9 +348,7 @@ class TitleList(Screen, HelpableScreen):
def titleEditDone(self, cutlist):
t = self.current_edit_title
- t.initDVDmenuText(self.project,len(self.project.titles))
- t.cuesheet = cutlist
- t.produceFinalCuesheet()
+ t.titleEditDone(cutlist)
if t.VideoType != 0:
self.session.openWithCallback(self.DVDformatCB,MessageBox,text = _("The DVD standard doesn't support H.264 (HDTV) video streams. Do you want to create a Dreambox format data DVD (which will not play in stand-alone DVD players) instead?"), type = MessageBox.TYPE_YESNO)
else:
@@ -335,7 +358,7 @@ class TitleList(Screen, HelpableScreen):
count = 0
for title in self.project.titles:
count += 1
- title.initDVDmenuText(self.project,count)
+ title.initDVDmenuText(count)
self.updateTitleList()
def DVDformatCB(self, answer):
@@ -346,5 +369,13 @@ class TitleList(Screen, HelpableScreen):
else:
self.removeTitle(t)
- def leave(self):
- self.close()
+ def leave(self, close = False):
+ if not len(self["titles"].list) or close:
+ self.close()
+ else:
+ self.session.openWithCallback(self.exitCB, MessageBox,text = _("Your current collection will get lost!") + "\n" + _("Do you really want to exit?"), type = MessageBox.TYPE_YESNO)
+
+ def exitCB(self, answer):
+ print "exitCB", answer
+ if answer is not None and answer:
+ self.close() \ No newline at end of file
diff --git a/lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py b/lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py
index 0a664eba..956f054d 100755
--- a/lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py
+++ b/lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py
@@ -21,10 +21,12 @@ class TitleProperties(Screen,ConfigListScreen):
<screen name="TitleProperties" position="center,center" size="560,445" title="Properties of current title" >
<ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
<ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />
+ <ePixmap pixmap="skin_default/buttons/yellow.png" position="280,0" size="140,40" alphatest="on" />
<ePixmap pixmap="skin_default/buttons/blue.png" position="420,0" size="140,40" alphatest="on" />
- <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
- <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
- <widget source="key_blue" render="Label" position="420,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#18188b" transparent="1" />
+ <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
+ <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+ <widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#a08500" transparent="1" />
+ <widget source="key_blue" render="Label" position="420,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#18188b" transparent="1" />
<widget source="serviceinfo" render="Label" position="10,46" size="350,144" font="Regular;18" />
<widget name="thumbnail" position="370,46" size="180,144" alphatest="on" />
<widget name="config" position="10,206" size="540,228" scrollbarMode="showOnDemand" />
@@ -38,7 +40,8 @@ class TitleProperties(Screen,ConfigListScreen):
self["key_red"] = StaticText(_("Cancel"))
self["key_green"] = StaticText(_("OK"))
- self["key_blue"] = StaticText(_("Edit Title"))
+ self["key_yellow"] = StaticText(_("Edit Title"))
+ self["key_blue"] = StaticText()
self["serviceinfo"] = StaticText()
self["thumbnail"] = Pixmap()
@@ -57,7 +60,7 @@ class TitleProperties(Screen,ConfigListScreen):
{
"green": self.exit,
"red": self.cancel,
- "blue": self.editTitle,
+ "yellow": self.editTitle,
"cancel": self.cancel,
"ok": self.ok,
}, -2)
diff --git a/lib/python/Plugins/Extensions/DVDBurn/plugin.py b/lib/python/Plugins/Extensions/DVDBurn/plugin.py
index 45f438da..bd856b47 100644
--- a/lib/python/Plugins/Extensions/DVDBurn/plugin.py
+++ b/lib/python/Plugins/Extensions/DVDBurn/plugin.py
@@ -12,6 +12,6 @@ def main_add(session, service, **kwargs):
dvdburn.selectedSource(service)
def Plugins(**kwargs):
- descr = _("Burn to DVD...")
+ descr = _("Burn to DVD")
return [PluginDescriptor(name="DVD Burn", description=descr, where = PluginDescriptor.WHERE_MOVIELIST, fnc=main_add, icon="dvdburn.png"),
PluginDescriptor(name="DVD Burn", description=descr, where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main, icon="dvdburn.png") ]
diff --git a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp
index 0372c497..2ba53927 100644
--- a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp
+++ b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp
@@ -85,12 +85,9 @@ RESULT eServiceFactoryDVD::offlineOperations(const eServiceReference &, ePtr<iSe
DEFINE_REF(eServiceDVD);
eServiceDVD::eServiceDVD(eServiceReference ref):
- m_ref(ref),
- m_ddvdconfig(ddvd_create()),
- m_subtitle_widget(0),
- m_state(stIdle),
- m_current_trick(0),
- m_pump(eApp, 1)
+ m_ref(ref), m_ddvdconfig(ddvd_create()), m_subtitle_widget(0), m_state(stIdle),
+ m_current_trick(0), m_pump(eApp, 1), m_width(-1), m_height(-1),
+ m_aspect(-1), m_framerate(-1), m_progressive(-1)
{
int aspect = DDVD_16_9;
int policy = DDVD_PAN_SCAN;
@@ -309,6 +306,32 @@ void eServiceDVD::gotMessage(int /*what*/)
m_event(this, evSeekableStatusChanged);
m_event(this, evUser+12);
break;
+#ifdef DDVD_SUPPORTS_PICTURE_INFO
+ case DDVD_SIZE_CHANGED:
+ {
+ int changed = m_width != -1 && m_height != -1 && m_aspect != -1;
+ ddvd_get_last_size(m_ddvdconfig, &m_width, &m_height, &m_aspect);
+ if (changed)
+ m_event((iPlayableService*)this, evVideoSizeChanged);
+ break;
+ }
+ case DDVD_PROGRESSIVE_CHANGED:
+ {
+ int changed = m_progressive != -1;
+ ddvd_get_last_progressive(m_ddvdconfig, &m_progressive);
+ if (changed)
+ m_event((iPlayableService*)this, evVideoProgressiveChanged);
+ break;
+ }
+ case DDVD_FRAMERATE_CHANGED:
+ {
+ int changed = m_framerate != -1;
+ ddvd_get_last_framerate(m_ddvdconfig, &m_framerate);
+ if (changed)
+ m_event((iPlayableService*)this, evVideoFramerateChanged);
+ break;
+ }
+#endif
default:
break;
}
@@ -500,6 +523,18 @@ int eServiceDVD::getInfo(int w)
case sUser+7:
case sUser+8:
return resIsPyObject;
+#ifdef DDVD_SUPPORTS_PICTURE_INFO
+ case sVideoWidth:
+ return m_width;
+ case sVideoHeight:
+ return m_height;
+ case sAspect:
+ return m_aspect;
+ case sProgressive:
+ return m_progressive;
+ case sFrameRate:
+ return m_framerate;
+#endif
default:
return resNA;
}
diff --git a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.h b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.h
index c730d501..c751a394 100644
--- a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.h
+++ b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.h
@@ -127,6 +127,8 @@ private:
void loadCuesheet();
void saveCuesheet();
+
+ int m_width, m_height, m_aspect, m_framerate, m_progressive;
};
#endif
diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
index 036bbbb9..0fc78fb1 100755
--- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
+++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
@@ -110,7 +110,7 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
# 'None' is magic to start at the list of mountpoints
defaultDir = config.mediaplayer.defaultDir.getValue()
- self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|mov)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
+ self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|m2ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|mov)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
self["filelist"] = self.filelist
self.playlist = MyPlayList()