Hallo liebes Forum, ich bin gerade an einem Plugin zu erweitern.
Jetzt aktuell habe ich ein Modul namens "modul.py" wo das eigentliche Plugin enthalten ist.
Öffnen tue ich es mit "plugin.py" was ja klar ist, ich hab deshalb den Weg gewählt, weil es zum programmieren erstmal erleichtert, weil bei jeden Aufruf wird das modul neu geladen und nach Veränderung gleich eingelesen, so brauch ich enigma nicht immer neu starten.
Soweit funktioniert das auch alles, beim öffnen erscheint links oben in der Ecke ein kleines Bildchen.
Jetzt möchte ich aber mehrere Bilder, quasi in Diashow manier mittels eTimer abspielen.
Heißt ich habe 5 Bildchen in einen Ordner, die möchte ich in Minuten Takt nacheinander abspielen lassen, nun hab ich viel über eTimer und so gelesen, aber ich bin schon am verzweifeln, ich bekomme es nicht hin, hab schon mit Listen und for schleifen u.s.w. probiert
Vielleicht kann ja hier aus dem Forum jemand weiter helfen.
Hier ist mein modul.py
- from Screens.Screen import Screen
- from Components.Label import Label
- from Components.Pixmap import Pixmap
- from Components.AVSwitch import AVSwitch
- from Components.ActionMap import ActionMap
- from Plugins.Plugin import PluginDescriptor
- from enigma import ePicLoad
- ###########################################################################
- class PictureScreen(Screen):
- skin="""
- <screen name="PictureScreen" flags="wfNoBorder" position="30,0" size="200,140" title="Picture Screen" backgroundColor="#002C2C39">
- <widget name="myPic" position="0,0" size="200,140" zPosition="0" alphatest="off" />
- </screen>"""
- def __init__(self, session, picPath = None):
- Screen.__init__(self, session)
- print "[PictureScreen] __init__\n"
- self.picPath = picPath
- self.Scale = AVSwitch().getFramebufferScale()
- self.PicLoad = ePicLoad()
- self["myPic"] = Pixmap()
- self["myActionMap"] = ActionMap(["SetupActions"],
- {
- "ok": self.cancel,
- "cancel": self.cancel
- }, -1)
- self.PicLoad.PictureData.get().append(self.DecodePicture)
- self.onLayoutFinish.append(self.ShowPicture)
- def ShowPicture(self):
- if self.picPath is not None:
- self.PicLoad.setPara([
- self["myPic"].instance.size().width(),
- self["myPic"].instance.size().height(),
- self.Scale[0],
- self.Scale[1],
- 0,
- 1,
- "#002C2C39"])#002C2C39
- self.PicLoad.startDecode(self.picPath)
- def DecodePicture(self, PicInfo = ""):
- if self.picPath is not None:
- ptr = self.PicLoad.getData()
- self["myPic"].instance.setPixmap(ptr)
- def cancel(self):
- print "[PictureScreen] - cancel\n"
- self.close(None)
Und hier mein plugin.py:
- from Plugins.Plugin import PluginDescriptor
- import modul
- def start(session, **kwargs):
- reload(modul)
- try:
- session.open(modul.PictureScreen, picPath = "/usr/lib/enigma2/python/Plugins/Extensions/modi/111.png")
- except:
- import traceback
- traceback.print_exc()
- def Plugins(**kwargs):
- return PluginDescriptor(name=_("Beispiel Plugin"), description=_("to view formula one stats"), icon="logo.png", where=[PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_PLUGINMENU], fnc=start)