X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/4438bf2708045c28b32839ae840866d861bace03..fb412ff32c7938649c72d55eed3f5c8ccb5e0a99:/lib/python/Screens/InfoBarGenerics.py diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index c3c6e21a..2624209c 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -13,7 +13,7 @@ from Components.PluginComponent import plugins from Components.ProgressBar import * from Components.ServiceEventTracker import ServiceEventTracker from Components.ServiceName import ServiceName -from Components.config import config, configElement, ConfigSubsection, configSequence, configElementBoolean +from Components.config import config, configElement, ConfigSubsection, configSequence, configElementBoolean, configSelection, configElement_nonSave, getConfigListEntry from Components.config import configfile, configsequencearg from Components.TimerList import TimerEntryComponent from Components.TunerInfo import TunerInfo @@ -1020,6 +1020,7 @@ class InfoBarExtensions: PIPON = 0 PIPOFF = 1 MOVEPIP = 2 + PIPSWAP = 3 def extensions(self): list = [] @@ -1028,29 +1029,30 @@ class InfoBarExtensions: elif self.pipshown == True: list.append((_("Disable Picture in Picture"), self.PIPOFF)) list.append((_("Move Picture in Picture"), self.MOVEPIP)) + list.append((_("Swap services"), self.PIPSWAP)) self.session.openWithCallback(self.extensionCallback, ChoiceBox, title=_("Please choose an extension..."), list = list) def extensionCallback(self, answer): if answer is not None: if answer[1] == self.PIPON: -# self.session.nav.stopService() self.pip = self.session.instantiateDialog(PictureInPicture) - #self.pip.show() newservice = self.session.nav.getCurrentlyPlayingServiceReference() - self.pipservice = eServiceCenter.getInstance().play(newservice) - if self.pipservice and not self.pipservice.setTarget(1): - self.pipservice.start() + + if self.pip.playService(newservice): self.pipshown = True else: - self.pipservice = None + self.pipshown = False del self.pip self.session.nav.playService(newservice) elif answer[1] == self.PIPOFF: - #self.pip.hide() - self.pipservice = None del self.pip self.pipshown = False + elif answer[1] == self.PIPSWAP: + swapservice = self.pip.getCurrentService() + self.pip.playService(self.session.nav.getCurrentlyPlayingServiceReference()) + self.session.nav.playService(swapservice) + elif answer[1] == self.MOVEPIP: self.session.open(PiPSetup, pip = self.pip) @@ -1192,9 +1194,11 @@ class InfoBarAudioSelection: def audioSelection(self): service = self.session.nav.getCurrentService() audio = service.audioTracks() - self.audio = audio + self.audioTracks = audio n = audio.getNumberOfTracks() if n > 0: +# self.audioChannel = service.audioChannel() +# config.audio.audiochannel = configElement_nonSave("config.audio.audiochannel", configSelection, self.audioChannel.getCurrentChannel(), (("left", _("Left >")), ("stereo", _("< Stereo >")), ("right", _("< Right")))) tlist = [] for x in range(n): i = audio.getTrackInfo(x) @@ -1214,6 +1218,9 @@ class InfoBarAudioSelection: selectedAudio = tlist[0][1] tlist.sort(lambda x,y : cmp(x[0], y[0])) + +# tlist.insert(0, getConfigListEntry(_("Audio Channel"), config.audio.audiochannel)) + selection = 0 for x in tlist: if x[1] != selectedAudio: @@ -1222,11 +1229,15 @@ class InfoBarAudioSelection: break self.session.openWithCallback(self.audioSelected, ChoiceBox, title=_("Select audio track"), list = tlist, selection = selection) + else: + del self.audioTracks def audioSelected(self, audio): if audio is not None: - self.audio.selectTrack(audio[1]) - del self.audio + self.audioTracks.selectTrack(audio[1]) + del self.audioTracks +# del self.audioChannel +# del config.audio.audiochannel class InfoBarSubserviceSelection: def __init__(self): @@ -1401,8 +1412,11 @@ class InfoBarNotifications: Notifications.notificationAdded.append(self.checkNotificationsIfExecing) def checkNotificationsIfExecing(self): - if self.execing: - self.checkNotifications() + try: + if self.execing: + self.checkNotifications() + except: + print "******************************* A SEVERE ERROR HAPPENED... Someone who understands the code... please fix :) *******" def checkNotifications(self): if len(Notifications.notifications):