X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/bce53d4a67d1655a496eebe5912c8573e880114e..35403704d9aee1e5d322e2fa59a90d8fb2a32c91:/lib/python/Plugins/Extensions/MediaPlayer/plugin.py diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py index e8504ff0..c69dd28e 100644 --- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py @@ -21,7 +21,6 @@ from Components.Harddisk import harddiskmanager from Components.config import config from Tools.Directories import fileExists, pathExists, resolveFilename, SCOPE_CONFIG, SCOPE_PLAYLIST, SCOPE_SKIN_IMAGE from settings import MediaPlayerSettings -from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier import random class MyPlayList(PlayList): @@ -111,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|mkv|mp4|m4a|dat|flac)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls") + self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|mkv|mp4|m4a|dat|flac|mov|flv)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls") self["filelist"] = self.filelist self.playlist = MyPlayList() @@ -137,6 +136,8 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB self["repeat"] = MultiPixmap() self.seek_target = None + + from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) class MoviePlayerActionMap(NumberActionMap): @@ -244,6 +245,7 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB if config.mediaplayer.saveDirOnExit.getValue(): config.mediaplayer.defaultDir.setValue(self.filelist.getCurrentDirectory()) config.mediaplayer.defaultDir.save() + from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.remove(self.hotplugCB) del self["coverArt"].picload self.close() @@ -262,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() @@ -293,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: @@ -899,7 +901,7 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB def subtitleSelection(self): from Screens.Subtitles import Subtitles - self.session.open(Subtitles) + self.session.open(Subtitles, self) def hotplugCB(self, dev, media_state): if dev == harddiskmanager.getCD():