<key id="KEY_INFO" mapto="showEPGList" flags="m" />
</map>
- <map context="InfoBarInstantRecord">
- <key id="KEY_R" mapto="instantRecord" flags="m" />
+ <map context="InfobarInstantRecord">
+ <key id="KEY_RED" mapto="instantRecord" flags="m" />
</map>
- <map context="InfoBarChannelSelection">
+ <map context="InfobarChannelSelection">
<key id="KEY_LEFT" mapto="zapUp" flags="mr" />
<key id="KEY_RIGHT" mapto="zapDown" flags="mr" />
<key id="KEY_UP" mapto="switchChannelUp" flags="mr" />
<key id="BTN_1" mapto="zapDown" flags="mr" />
</map>
- <map context="InfoBarMenuActions">
+ <map context="InfobarMenuActions">
<key id="KEY_MENU" mapto="mainMenu" flags="mr" />
</map>
<map context="InfobarActions">
<key id="KEY_VIDEO" mapto="showMovies" flags="m" />
+ </map>
+
+ <map context="InfobarAudioSelectionActions">
<key id="KEY_AUDIO" mapto="audioSelection" flags="m" />
</map>
<key id="KEY_GREEN" mapto="unPauseService" flags="m" />
<key id="KEY_RED" mapto="seekBack" flags="m" />
<key id="KEY_BLUE" mapto="seekFwd" flags="m" />
+
+ <key id="KEY_LEFT" mapto="seekBack" flags="m" />
+ <key id="KEY_RIGHT" mapto="seekFwd" flags="m" />
+ </map>
+
+ <map context="MoviePlayerActions">
+ <key id="KEY_VIDEO" mapto="leavePlayer" flags="m" />
+ <key id="KEY_TV" mapto="leavePlayer" flags="m" />
</map>
<map context="ChannelSelectActions">
<widget name="Event_Next_Duration" position="555,98" size="70,26" font="Arial;22" backgroundColor="dark" />
<!-- <eLabel position="70,0" size="300,30" text=".oO skin Oo." font="Arial;20" /> -->
</screen>
+
+ <screen name="MoviePlayer" flags="wfNoBorder" position="0,380" size="720,148" title="InfoBar">
+ <ePixmap position="0,0" size="720,148" pixmap="/usr/share/enigma2/info-bg.png" />
+ <widget name="ServiceName" position="69,25" size="427,26" valign="center" font="Arial;22" backgroundColor="#101258" />
+ <widget name="CurrentTime" position="575,10" size="90,30" backgroundColor="dark" font="Arial;19" />
+ <eLabel position="70,0" size="300,30" text=".oO skin Oo." font="Arial;20" />
+ </screen>
+
+
<screen name="NumberZap" flags="wfNoBorder" position="300,120" size="120,60">
<widget name="number" position="30,15" size="80,25" font="Arial;23" />
</screen>
<screen name="Mute" flags="wfNoBorder" position="100,100" size="59,80" title="Mute">
<ePixmap position="0,0" size="59,80" pixmap="/usr/share/enigma2/mute-fs8.png" />
</screen>
- <screen name="ChannelSelection" position="90,100" size="560,420" title="Channel Selection">
- <widget name="list" position="10,50" size="540,325" />
+ <screen name="ChannelSelection" position="90,100" size="560,450" title="Channel Selection">
+ <widget name="list" position="10,50" size="540,400" />
<!-- <widget name="okbutton" position="340,50" size="140,30" />-->
<widget name="key_red" position="0,0" size="140,40" backgroundColor="red" font="Arial;21" />
<widget name="key_green" position="140,0" size="140,40" backgroundColor="green" font="Arial;21" />
<screen name="MessageBox" position="0,300" size="720,10" title="Message">
<widget name="text" position="0,0" size="650,0" font="Arial;22" />
<applet type="onLayoutFinish">
-# this should be factored out into some helper code, but currently demonstrated applets.
+# this should be factored out into some helper code, but currently demonstrates applets.
from enigma import eSize, ePoint
orgwidth = self.instance.size().width()
from Screen import Screen
+from Screens.MovieSelection import MovieSelection
+from Screens.MessageBox import MessageBox
+
from Components.Clock import Clock
from Components.ActionMap import ActionMap
-from Screens.AudioSelection import AudioSelection
-from Screens.MovieSelection import MovieSelection
+from Components.ServicePosition import ServicePosition
from Screens.InfoBarGenerics import InfoBarVolumeControl, InfoBarShowHide, \
InfoBarPowerKey, InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \
- InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord
+ InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord, \
+ InfoBarAudioSelection
from enigma import *
class InfoBar(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
- InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord):
+ InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection):
+
def __init__(self, session):
Screen.__init__(self, session)
+
+ self["actions"] = ActionMap( [ "InfobarActions" ],
+ {
+ "showMovies": self.showMovies,
+ })
for x in InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
- InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord:
+ InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection:
x.__init__(self)
- self["actions"] = ActionMap( [ "InfobarActions" ],
+ self["CurrentTime"] = Clock()
+
+ def showMovies(self):
+ self.session.openWithCallback(self.movieSelected, MovieSelection)
+
+ def movieSelected(self, service):
+ if service is not None:
+ self.session.open(MoviePlayer, service)
+
+class MoviePlayer(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
+ InfoBarMenu, \
+ InfoBarServiceName, InfoBarPVR, InfoBarAudioSelection):
+
+ def __init__(self, session, service):
+ Screen.__init__(self, session)
+
+ self["actions"] = ActionMap( [ "MoviePlayerActions" ],
{
- "showMovies": self.showMovies,
- #"quit": self.quit,
- "audioSelection": self.audioSelection,
+ "leavePlayer": self.leavePlayer
})
+
+ for x in InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, InfoBarMenu, InfoBarServiceName, InfoBarPVR, InfoBarAudioSelection:
+ x.__init__(self)
self["CurrentTime"] = Clock()
# ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
- # Clock()
+
+ self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
+ self.session.nav.playService(service)
- def showMovies(self):
- self.session.open(MovieSelection)
-
- def audioSelection(self):
- service = self.session.nav.getCurrentService()
- audio = service.audioTracks()
- n = audio.getNumberOfTracks()
- if n > 0:
- self.session.open(AudioSelection, audio)
+ def leavePlayer(self):
+ self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, "Stop playing this movie?")
+
+ def leavePlayerConfirmed(self, answer):
+ if answer == True:
+ self.session.nav.playService(self.lastservice)
+ self.close()
from Components.config import configfile
from ChannelSelection import ChannelSelection
-
from Components.ServiceName import ServiceName
from Components.EventInfo import EventInfo
-from Components.ServicePosition import ServicePosition
from EpgSelection import EPGSelection
from Screens.MessageBox import MessageBox
-from Screens.MovieSelection import MovieSelection
from Screens.Volume import Volume
from Screens.Mute import Mute
from Screens.Standby import Standby
#instantiate forever
self.servicelist = self.session.instantiateDialog(ChannelSelection)
- self["ChannelSelectActions"] = ActionMap( ["InfoBarChannelSelection"],
+ self["ChannelSelectActions"] = ActionMap( ["InfobarChannelSelection"],
{
"switchChannelUp": self.switchChannelUp,
"switchChannelDown": self.switchChannelDown,
class InfoBarMenu:
""" Handles a menu action, to open the (main) menu """
def __init__(self):
- self["MenuActions"] = ActionMap( [ "InfoBarMenuActions" ],
+ self["MenuActions"] = ActionMap( [ "InfobarMenuActions" ],
{
"mainMenu": self.mainMenu,
})
"""Instant Record - handles the instantRecord action in order to
start/stop instant records"""
def __init__(self):
- self["InstnantRecordActions"] = ActionMap( [ "InfoBarInstantRecord" ],
+ self["InstnantRecordActions"] = ActionMap( [ "InfobarInstantRecord" ],
{
"instantRecord": self.instantRecord,
})
self.session.openWithCallback(self.recordQuestionCallback, MessageBox, "Do you want to stop the current\n(instant) recording?")
else:
self.session.openWithCallback(self.recordQuestionCallback, MessageBox, "Start recording?")
+
+from Screens.AudioSelection import AudioSelection
+
+class InfoBarAudioSelection:
+ def __init__(self):
+ self["AudioSelectionAction"] = ActionMap( [ "InfobarAudioSelectionActions" ],
+ {
+ "audioSelection": self.audioSelection,
+ })
+
+ def audioSelection(self):
+ service = self.session.nav.getCurrentService()
+ audio = service.audioTracks()
+ n = audio.getNumberOfTracks()
+ if n > 0:
+ self.session.open(AudioSelection, audio)
self["actions"] = ActionMap(["OkCancelActions", "ContextMenuActions"],
{
- "cancel": self.close,
+ "cancel": self.abort,
"ok": self.movieSelected,
"contextMenu": self.doContext,
})
return self["list"].getCurrent()[0]
def movieSelected(self):
- self.session.nav.playService(self.getCurrent())
- self.close()
+ self.close(self.getCurrent())
def doContext(self):
self.session.open(ChannelContextMenu, self, self.getCurrent())
+
+ def abort(self):
+ self.close(None)