aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/Components')
-rw-r--r--lib/python/Components/Makefile.am2
-rw-r--r--lib/python/Components/MovieList.py89
-rw-r--r--lib/python/Components/__init__.py2
3 files changed, 91 insertions, 2 deletions
diff --git a/lib/python/Components/Makefile.am b/lib/python/Components/Makefile.am
index d9b3890e..7d35f561 100644
--- a/lib/python/Components/Makefile.am
+++ b/lib/python/Components/Makefile.am
@@ -6,4 +6,4 @@ install_DATA = \
Clock.py HTMLSkin.py ServiceList.py VariableText.py \
ConfigList.py Header.py ServiceName.py VariableValue.py \
EventInfo.py Label.py ServiceScan.py VolumeBar.py \
- GUIComponent.py MenuList.py TextInput.py __init__.py
+ GUIComponent.py MenuList.py TextInput.py __init__.py MovieList.py
diff --git a/lib/python/Components/MovieList.py b/lib/python/Components/MovieList.py
new file mode 100644
index 00000000..4144353e
--- /dev/null
+++ b/lib/python/Components/MovieList.py
@@ -0,0 +1,89 @@
+from HTMLComponent import *
+from GUIComponent import *
+
+from enigma import eListboxPythonMultiContent, eListbox, gFont
+
+from enigma import eServiceReference, eServiceCenter, \
+ eServiceCenterPtr, iListableServicePtr, \
+ iStaticServiceInformationPtr
+
+
+
+RT_HALIGN_LEFT = 0
+RT_HALIGN_RIGHT = 1
+RT_HALIGN_CENTER = 2
+RT_HALIGN_BLOCK = 4
+
+RT_VALIGN_TOP = 0
+RT_VALIGN_CENTER = 8
+RT_VALIGN_BOTTOM = 16
+
+RT_WRAP = 32
+
+
+#
+# | name of movie |
+#
+def MovieListEntry(serviceref, serviceHandler):
+ res = [ serviceref ]
+
+ info = iStaticServiceInformationPtr()
+
+ if serviceHandler.info(serviceref, info):
+ # ignore service which refuse to info
+ del info
+ return
+
+ res.append((0, 0, 400, 30, 0, RT_HALIGN_LEFT, info.getName(serviceref)))
+ res.append((0, 30, 200, 20, 1, RT_HALIGN_LEFT, "Toller Film"))
+ res.append((0, 50, 200, 20, 1, RT_HALIGN_LEFT, "Aufgenommen: irgendwann"))
+ res.append((200, 50, 200, 20, 1, RT_HALIGN_RIGHT, "1232MB"))
+
+ return res
+
+class MovieList(HTMLComponent, GUIComponent):
+ def __init__(self, root):
+ GUIComponent.__init__(self)
+ self.l = eListboxPythonMultiContent()
+ self.load(root)
+ self.l.setList(self.list)
+ self.l.setFont(0, gFont("Arial", 30))
+ self.l.setFont(1, gFont("Arial", 18))
+
+ def getCurrent(self):
+ return self.l.getCurrentSelection()
+
+ def GUIcreate(self, parent):
+ self.instance = eListbox(parent)
+ self.instance.setContent(self.l)
+ self.instance.setItemHeight(75)
+
+ def GUIdelete(self):
+ self.instance.setContent(None)
+ self.instance = None
+
+ def load(self, root):
+ # this lists our root service, then building a
+ # nice list
+
+ self.list = [ ]
+
+ serviceHandler = eServiceCenterPtr()
+ eServiceCenter.getInstance(serviceHandler)
+ list = iListableServicePtr()
+
+ if serviceHandler.list(root, list):
+ raise "listing of movies failed"
+
+ movieList = [ ]
+ while 1:
+ s = eServiceReference()
+ if list.getNext(s):
+ del s
+ del list
+ break
+ movieList.append(s)
+
+ # now process them...
+ for ref in movieList:
+ self.list.append(MovieListEntry(ref, serviceHandler))
diff --git a/lib/python/Components/__init__.py b/lib/python/Components/__init__.py
index d7cd406b..9f15abd4 100644
--- a/lib/python/Components/__init__.py
+++ b/lib/python/Components/__init__.py
@@ -3,5 +3,5 @@ __all__ = ["ActionMap", "Button", "Clock", "ConfigList", "EventInfo",
"GUIComponent", "GUISkin", "HTMLComponent", "HTMLSkin", "Header",
"Label", "MenuList", "PerServiceDisplay", "ProgressBar", "ServiceList",
"ServiceName", "ServiceScan", "VariableText", "VariableValue", "VolumeBar",
- "components", "config", "TimerList", "TimeInput" ]
+ "components", "config", "TimerList", "TimeInput", "MovieList" ]