diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2009-04-24 12:03:28 +0200 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2009-04-24 12:03:28 +0200 |
| commit | 019ba406ed5ba46782951d501ed2d4c0a96e6096 (patch) | |
| tree | 58c85bf4801a62c27a30d4366d9e45e81ba5bd98 /lib/python | |
| parent | 8188ccaebf3b9c51ef2916cb7e69ef954291392f (diff) | |
| parent | 056af5306995176e457ddd471aa2b5c3a5223c4f (diff) | |
| download | enigma2-019ba406ed5ba46782951d501ed2d4c0a96e6096.tar.gz enigma2-019ba406ed5ba46782951d501ed2d4c0a96e6096.zip | |
Merge branch 'master' of git.opendreambox.org:/git/enigma2
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Components/Converter/ClockToText.py | 6 | ||||
| -rw-r--r-- | lib/python/Components/Converter/RemainingToText.py | 8 | ||||
| -rw-r--r-- | lib/python/Components/Converter/ServiceInfo.py | 35 | ||||
| -rw-r--r-- | lib/python/Components/Sources/FrontendStatus.py | 2 | ||||
| -rw-r--r-- | lib/python/Plugins/Extensions/MediaPlayer/plugin.py | 30 |
5 files changed, 64 insertions, 17 deletions
diff --git a/lib/python/Components/Converter/ClockToText.py b/lib/python/Components/Converter/ClockToText.py index 109f9125..8ef98742 100644 --- a/lib/python/Components/Converter/ClockToText.py +++ b/lib/python/Components/Converter/ClockToText.py @@ -9,6 +9,7 @@ class ClockToText(Converter, object): DATE = 3 FORMAT = 4 AS_LENGTH = 5 + TIMESTAMP = 6 # add: date, date as string, weekday, ... # (whatever you need!) @@ -23,6 +24,8 @@ class ClockToText(Converter, object): self.type = self.DATE elif type == "AsLength": self.type = self.AS_LENGTH + elif type == "Timestamp": + self.type = self.TIMESTAMP elif str(type).find("Format") != -1: self.type = self.FORMAT self.fmt_string = type[7:] @@ -40,6 +43,8 @@ class ClockToText(Converter, object): return "%d min" % (time / 60) elif self.type == self.AS_LENGTH: return "%d:%02d" % (time / 60, time % 60) + elif self.type == self.TIMESTAMP: + return str(time) t = localtime(time) @@ -57,6 +62,7 @@ class ClockToText(Converter, object): return str(s1+s2) else: return strftime(self.fmt_string, t) + else: return "???" diff --git a/lib/python/Components/Converter/RemainingToText.py b/lib/python/Components/Converter/RemainingToText.py index 4249e30a..66897579 100644 --- a/lib/python/Components/Converter/RemainingToText.py +++ b/lib/python/Components/Converter/RemainingToText.py @@ -5,6 +5,7 @@ class RemainingToText(Converter, object): DEFAULT = 0 WITH_SECONDS = 1 NO_SECONDS = 2 + IN_SECONDS = 3 def __init__(self, type): Converter.__init__(self, type) @@ -12,6 +13,8 @@ class RemainingToText(Converter, object): self.type = self.WITH_SECONDS elif type == "NoSeconds": self.type = self.NO_SECONDS + elif type == "InSeconds": + self.type = self.IN_SECONDS else: self.type = self.DEFAULT @@ -33,6 +36,11 @@ class RemainingToText(Converter, object): return "+%d:%02d" % (remaining / 3600, (remaining / 60) - ((remaining / 3600) * 60)) else: return "%02d:%02d" % (duration / 3600, (duration / 60) - ((duration / 3600) * 60)) + elif self.type == self.IN_SECONDS: + if remaining is not None: + return str(remaining) + else: + return str(duration) elif self.type == self.DEFAULT: if remaining is not None: return "+%d min" % (remaining / 60) diff --git a/lib/python/Components/Converter/ServiceInfo.py b/lib/python/Components/Converter/ServiceInfo.py index d4054f0c..f0773bf1 100644 --- a/lib/python/Components/Converter/ServiceInfo.py +++ b/lib/python/Components/Converter/ServiceInfo.py @@ -10,6 +10,15 @@ class ServiceInfo(Converter, object): SUBSERVICES_AVAILABLE = 4 XRES = 5 YRES = 6 + APID = 7 + VPID = 8 + PCRPID = 9 + PMTPID = 10 + TXTPID = 11 + TSID = 12 + ONID = 13 + SID = 14 + def __init__(self, type): Converter.__init__(self, type) @@ -21,6 +30,14 @@ class ServiceInfo(Converter, object): "SubservicesAvailable": (self.SUBSERVICES_AVAILABLE, (iPlayableService.evUpdatedEventInfo,)), "VideoWidth": (self.XRES, (iPlayableService.evVideoSizeChanged,)), "VideoHeight": (self.YRES, (iPlayableService.evVideoSizeChanged,)), + "AudioPid": (self.APID, (iPlayableService.evUpdatedInfo,)), + "VideoPid": (self.VPID, (iPlayableService.evUpdatedInfo,)), + "PcrPid": (self.PCRPID, (iPlayableService.evUpdatedInfo,)), + "PmtPid": (self.PMTPID, (iPlayableService.evUpdatedInfo,)), + "TxtPid": (self.TXTPID, (iPlayableService.evUpdatedInfo,)), + "TsId": (self.TSID, (iPlayableService.evUpdatedInfo,)), + "OnId": (self.ONID, (iPlayableService.evUpdatedInfo,)), + "Sid": (self.SID, (iPlayableService.evUpdatedInfo,)), }[type] def getServiceInfoString(self, info, what): @@ -73,8 +90,24 @@ class ServiceInfo(Converter, object): if self.type == self.XRES: return self.getServiceInfoString(info, iServiceInformation.sVideoWidth) - if self.type == self.YRES: + elif self.type == self.YRES: return self.getServiceInfoString(info, iServiceInformation.sVideoHeight) + elif self.type == self.APID: + return self.getServiceInfoString(info, iServiceInformation.sAudioPID) + elif self.type == self.VPID: + return self.getServiceInfoString(info, iServiceInformation.sVideoPID) + elif self.type == self.PCRPID: + return self.getServiceInfoString(info, iServiceInformation.sPCRPID) + elif self.type == self.PMTPID: + return self.getServiceInfoString(info, iServiceInformation.sPMTPID) + elif self.type == self.TXTPID: + return self.getServiceInfoString(info, iServiceInformation.sTXTPID) + elif self.type == self.TSID: + return self.getServiceInfoString(info, iServiceInformation.sTSID) + elif self.type == self.ONID: + return self.getServiceInfoString(info, iServiceInformation.sONID) + elif self.type == self.SID: + return self.getServiceInfoString(info, iServiceInformation.sSID) return "" text = property(getText) diff --git a/lib/python/Components/Sources/FrontendStatus.py b/lib/python/Components/Sources/FrontendStatus.py index 5eb3445f..8f1b36dc 100644 --- a/lib/python/Components/Sources/FrontendStatus.py +++ b/lib/python/Components/Sources/FrontendStatus.py @@ -46,7 +46,7 @@ class FrontendStatus(Source): if suspended: self.poll_timer.stop() else: - self.poll_timer.start(self.update_interval) + self.updateFrontendStatus() def destroy(self): self.poll_timer.callback.remove(self.updateFrontendStatus) diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py index 0f46c996..71b486a3 100644 --- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py @@ -264,23 +264,23 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB def __evUpdatedInfo(self): currPlay = self.session.nav.getCurrentService() - currenttitle = currPlay.info().getInfo(iServiceInformation.sCurrentTitle) - totaltitles = currPlay.info().getInfo(iServiceInformation.sTotalTitles) - sTitle = currPlay.info().getInfoString(iServiceInformation.sTitle) - print "[__evUpdatedInfo] title %d of %d (%s)" % (currenttitle, totaltitles, sTitle) + sTagTrackNumber = currPlay.info().getInfo(iServiceInformation.sTagTrackNumber) + sTagTrackCount = currPlay.info().getInfo(iServiceInformation.sTagTrackCount) + sTagTitle = currPlay.info().getInfoString(iServiceInformation.sTagTitle) + print "[__evUpdatedInfo] title %d of %d (%s)" % (sTagTrackNumber, sTagTrackCount, sTagTitle) self.readTitleInformation() def __evAudioDecodeError(self): currPlay = self.session.nav.getCurrentService() - sAudioType = currPlay.info().getInfoString(iServiceInformation.sUser+10) - print "[__evAudioDecodeError] audio-codec %s can't be decoded by hardware" % (sAudioType) - self.session.open(MessageBox, _("This Dreambox can't decode %s streams!") % sAudioType, type = MessageBox.TYPE_INFO,timeout = 20 ) + sTagAudioCodec = currPlay.info().getInfoString(iServiceInformation.sTagAudioCodec) + print "[__evAudioDecodeError] audio-codec %s can't be decoded by hardware" % (sTagAudioCodec) + self.session.open(MessageBox, _("This Dreambox can't decode %s streams!") % sTagAudioCodec, type = MessageBox.TYPE_INFO,timeout = 20 ) def __evVideoDecodeError(self): currPlay = self.session.nav.getCurrentService() - sVideoType = currPlay.info().getInfoString(iServiceInformation.sVideoType) - print "[__evVideoDecodeError] video-codec %s can't be decoded by hardware" % (sVideoType) - self.session.open(MessageBox, _("This Dreambox can't decode %s streams!") % sVideoType, type = MessageBox.TYPE_INFO,timeout = 20 ) + sTagVideoCodec = currPlay.info().getInfoString(iServiceInformation.sTagVideoCodec) + print "[__evVideoDecodeError] video-codec %s can't be decoded by hardware" % (sTagVideoCodec) + self.session.open(MessageBox, _("This Dreambox can't decode %s streams!") % sTagVideoCodec, type = MessageBox.TYPE_INFO,timeout = 20 ) def __evPluginError(self): currPlay = self.session.nav.getCurrentService() @@ -295,11 +295,11 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB def readTitleInformation(self): currPlay = self.session.nav.getCurrentService() if currPlay is not None: - sTitle = currPlay.info().getInfoString(iServiceInformation.sTitle) - sAlbum = currPlay.info().getInfoString(iServiceInformation.sAlbum) - sGenre = currPlay.info().getInfoString(iServiceInformation.sGenre) - sArtist = currPlay.info().getInfoString(iServiceInformation.sArtist) - sYear = currPlay.info().getInfoString(iServiceInformation.sTimeCreate) + sTitle = currPlay.info().getInfoString(iServiceInformation.sTagTitle) + sAlbum = currPlay.info().getInfoString(iServiceInformation.sTagAlbum) + sGenre = currPlay.info().getInfoString(iServiceInformation.sTagGenre) + sArtist = currPlay.info().getInfoString(iServiceInformation.sTagArtist) + sYear = currPlay.info().getInfoString(iServiceInformation.sTagDate) if sTitle == "": if not self.isAudioCD: |
