aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorFraxinas <andreas.frisch@multimedia-labs.de>2008-11-19 12:42:52 +0100
committerFraxinas <andreas.frisch@multimedia-labs.de>2008-11-19 12:42:52 +0100
commite09c5aad8f93dab13e7b981a75c4d5473ea1376c (patch)
tree4bb6ee6b63d24e64a031c19e9775f9e976dbf953 /lib/python
parentac28912f03ba943cce61b30df2014f06dd499ba7 (diff)
downloadenigma2-e09c5aad8f93dab13e7b981a75c4d5473ea1376c.tar.gz
enigma2-e09c5aad8f93dab13e7b981a75c4d5473ea1376c.zip
update MediaPlayer to use new async ePicLoad function for cover artwork. currently no transparent background possible though :/
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Plugins/Extensions/MediaPlayer/plugin.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
index babef3e7..981f08cb 100644
--- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
+++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
@@ -1,6 +1,6 @@
from os import path as os_path, remove as os_remove, listdir as os_listdir
from time import strftime
-from enigma import iPlayableService, eTimer, eServiceCenter, iServiceInformation, loadPic
+from enigma import iPlayableService, eTimer, eServiceCenter, iServiceInformation, ePicLoad
from ServiceReference import ServiceReference
from Screens.Screen import Screen
from Screens.HelpMenu import HelpableScreen
@@ -171,6 +171,9 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
self.currList = "filelist"
self.coverArtFileName = ""
+ self.picload = ePicLoad()
+ self.picload.PictureData.get().append(self.paintCoverArtPixmapCB)
+
self.isAudioCD = False
self.AudioCD_albuminfo = {}
self.cdAudioTrackFiles = []
@@ -206,6 +209,7 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
config.mediaplayer.defaultDir.setValue(self.filelist.getCurrentDirectory())
config.mediaplayer.defaultDir.save()
hotplugNotifier.remove(self.hotplugCB)
+ del self.picload
self.close()
def checkSkipShowHideLock(self):
@@ -294,9 +298,15 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
new_coverArtFileName = path + filename
if self.coverArtFileName != new_coverArtFileName:
self.coverArtFileName = new_coverArtFileName
- pixmap = loadPic(self.coverArtFileName, 116, 116, AVSwitch().getAspectRatioSetting()/2,1,0,0)
- if pixmap is not None:
- self["coverArt"].instance.setPixmap(pixmap.__deref__())
+ sc = AVSwitch().getFramebufferScale()
+ #0=Width 1=Height 2=Aspect 3=use_cache 4=resize_type 5=Background(#AARRGGBB)
+ self.picload.setPara((self["coverArt"].instance.size().width(), self["coverArt"].instance.size().height(), sc[0], sc[1], False, 1, "#ff000000"))
+ self.picload.startDecode(self.coverArtFileName)
+
+ def paintCoverArtPixmapCB(self, picInfo=None):
+ ptr = self.picload.getData()
+ if ptr != None:
+ self["coverArt"].instance.setPixmap(ptr.__deref__())
def leftDown(self):
self.lefttimer = True