X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/c9c1118e12d2e2402d3b2e4eb954d1379da4e160..8f957309b2bfb7df00c123f91ebb6d1d302848ba:/lib/python/Components/MediaPlayer.py diff --git a/lib/python/Components/MediaPlayer.py b/lib/python/Components/MediaPlayer.py index aff19199..a728aef7 100644 --- a/lib/python/Components/MediaPlayer.py +++ b/lib/python/Components/MediaPlayer.py @@ -1,12 +1,12 @@ -from HTMLComponent import * -from GUIComponent import * +from HTMLComponent import HTMLComponent +from GUIComponent import GUIComponent from MenuList import MenuList from Tools.Directories import SCOPE_SKIN_IMAGE, resolveFilename from os import path -from enigma import eListboxPythonMultiContent, eListbox, RT_VALIGN_CENTER, loadPNG, gFont +from enigma import eListboxPythonMultiContent, eListbox, RT_VALIGN_CENTER, loadPNG, gFont, eServiceCenter STATE_PLAY = 0 STATE_PAUSE = 1 @@ -48,8 +48,10 @@ class PlayList(MenuList, HTMLComponent, GUIComponent): self.list = [] self.l.setList(self.list) self.l.setFont(0, gFont("Regular", 18)) + self.l.setItemHeight(22) self.currPlaying = -1 self.oldCurrPlaying = -1 + self.serviceHandler = eServiceCenter.getInstance() def clear(self): del self.list[:] @@ -61,7 +63,6 @@ class PlayList(MenuList, HTMLComponent, GUIComponent): def postWidgetCreate(self, instance): instance.setContent(self.l) - instance.setItemHeight(22) def getSelection(self): return self.l.getCurrentSelection()[0] @@ -108,6 +109,14 @@ class PlayList(MenuList, HTMLComponent, GUIComponent): def getCurrentIndex(self): return self.currPlaying + + def getCurrentEvent(self): + l = self.l.getCurrentSelection() + return l and self.serviceHandler.info(l[0]).getEvent(l[0]) + + def getCurrent(self): + l = self.l.getCurrentSelection() + return l and l[0] def getServiceRefList(self): return [ x[0] for x in self.list ]