add ability to filter by tag. they must be created by hand right now.
[enigma2.git] / lib / python / Components / MediaPlayer.py
index c271c3c64989bfa5105efbe6edee5ddfc369f9cc..b2cb4eb57086f1afa3105aa48d7e6fcda497f0b0 100644 (file)
@@ -24,15 +24,15 @@ STATE_REWIND = 3
 STATE_FORWARD = 4
 STATE_NONE = 5
 
-PlayIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "play-small-fs8.png"))
-PauseIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "pause-small-fs8.png"))
-StopIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "stop-small-fs8.png"))
-RewindIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "rewind-small-fs8.png"))
-ForwardIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "forward-small-fs8.png"))
+PlayIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_mp_play.png"))
+PauseIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_mp_pause.png"))
+StopIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_mp_stop.png"))
+RewindIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_mp_rewind.png"))
+ForwardIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_mp_forward.png"))
 
 def PlaylistEntryComponent(serviceref, state):
        res = [ serviceref ]
-       res.append((eListboxPythonMultiContent.TYPE_TEXT, 35, 0, 250, 32, 0, RT_VALIGN_CENTER, os.path.split(serviceref.getPath().split('/')[-1])[1]))
+       res.append((eListboxPythonMultiContent.TYPE_TEXT,25, 0, 470, 32, 0, RT_VALIGN_CENTER, os.path.split(serviceref.getPath().split('/')[-1])[1]))
        png = None
        if state == STATE_PLAY:
                png = PlayIcon
@@ -46,7 +46,7 @@ def PlaylistEntryComponent(serviceref, state):
                png = ForwardIcon
 
        if png is not None:
-               res.append((eListboxPythonMultiContent.TYPE_PIXMAP, 0, 0, 33, 32, png))
+               res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 5, 0, 16, 16, png))
     
        return res
 
@@ -57,7 +57,7 @@ class PlayList(MenuList, HTMLComponent, GUIComponent):
                self.list = []
                self.l.setList(self.list)
                self.l.setFont(0, gFont("Regular", 18))
-               self.currPlaying = 0
+               self.currPlaying = -1
                self.oldCurrPlaying = -1
        
        def clear(self):
@@ -70,7 +70,7 @@ class PlayList(MenuList, HTMLComponent, GUIComponent):
 
        def postWidgetCreate(self, instance):
                instance.setContent(self.l)
-               instance.setItemHeight(32)
+               instance.setItemHeight(22)
 
        def getSelection(self):
                return self.l.getCurrentSelection()[0]
@@ -91,6 +91,8 @@ class PlayList(MenuList, HTMLComponent, GUIComponent):
                self.currPlaying = index
        
        def updateState(self, state):
+               if self.currPlaying == -1:
+                       return
                if len(self.list) > self.oldCurrPlaying and self.oldCurrPlaying != -1:
                        self.list[self.oldCurrPlaying] = PlaylistEntryComponent(self.list[self.oldCurrPlaying][0], STATE_NONE)
                self.list[self.currPlaying] = PlaylistEntryComponent(self.list[self.currPlaying][0], state)