InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, \
InfoBarSubserviceSelection, InfoBarTuner, InfoBarShowMovies, InfoBarTimeshift, \
InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView, \
- InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions
+ InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, \
+ InfoBarSubtitleSupport
from Screens.HelpMenu import HelpableScreen, HelpMenu
InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection,
HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
InfoBarSubserviceSelection, InfoBarTuner, InfoBarTimeshift, InfoBarSeek,
- InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, Screen):
+ InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions,
+ InfoBarSubtitleSupport, Screen):
def __init__(self, session):
Screen.__init__(self, session)
InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \
InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
InfoBarTuner, InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, \
- InfoBarTeletextPlugin, InfoBarExtensions:
+ InfoBarTeletextPlugin, InfoBarExtensions, InfoBarSubtitleSupport:
x.__init__(self)
self.helpList.append((self["actions"], "InfobarActions", [("showMovies", "Watch a Movie...")]))
InfoBarMenu, \
InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications,
InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView,
- InfoBarSummarySupport, InfoBarTeletextPlugin, Screen):
+ InfoBarSummarySupport, InfoBarTeletextPlugin, InfoBarSubtitleSupport, Screen):
def __init__(self, session, service):
Screen.__init__(self, session)
InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, \
InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \
InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \
- InfoBarSummarySupport, InfoBarTeletextPlugin:
+ InfoBarSummarySupport, InfoBarTeletextPlugin, InfoBarSubtitleSupport:
x.__init__(self)
self["CurrentTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
PIPOFF = 1
MOVEPIP = 2
PIPSWAP = 3
+ ENABLE_SUBTITLE = 4
def extensions(self):
list = []
list.append((_("Disable Picture in Picture"), self.PIPOFF))
list.append((_("Move Picture in Picture"), self.MOVEPIP))
list.append((_("Swap services"), self.PIPSWAP))
+
+ s = self.getCurrentServiceSubtitle()
+
+ for x in s.getSubtitleList():
+ list.append(("DEBUG: Enable Subtitles: " + x[0], self.ENABLE_SUBTITLE, x))
+
self.session.openWithCallback(self.extensionCallback, ChoiceBox, title=_("Please choose an extension..."), list = list)
def extensionCallback(self, answer):
elif answer[1] == self.MOVEPIP:
self.session.open(PiPSetup, pip = self.pip)
+ elif answer[1] == self.ENABLE_SUBTITLE:
+ self.selected_subtitle = answer[2]
+ self.subtitles_enabled = True
from RecordTimer import parseEvent
# reenable if it was enabled
r = self.__subtitles_enabled
self.__subtitles_enabled = False
+ self.__selected_subtitle = None
self.setSubtitlesEnable(r)
def getCurrentServiceSubtitle(self):
def setSubtitlesEnable(self, enable=True):
subtitle = self.getCurrentServiceSubtitle()
- if enable:
+ if enable and self.__selected_subtitle:
if subtitle and not self.__subtitles_enabled:
- subtitle.enableSubtitles(self.subtitle_window.instance, 0)
+ subtitle.enableSubtitles(self.subtitle_window.instance, self.selected_subtitle)
self.subtitle_window.show()
self.__subtitles_enabled = True
else:
self.subtitle_window.hide()
self.__subtitles_enabled = False
-
- subtitlesEnabled = property(lambda self: self.__subtitlesEnabled, setSubtitlesEnable)
+
+ def setSelectedSubtitle(self, subtitle):
+ if self.__selected_subtitle != subtitle and self.subtitles_enabled:
+ subtitle = self.getCurrentServiceSubtitle()
+
+ # kick
+ self.__serviceStarted()
+ self.__selected_subtitle = subtitle
+
+ subtitles_enabled = property(lambda self: self.__subtitles_enabled, setSubtitlesEnable)
+ selected_subtitle = property(lambda self: self.__selected_subtitle, setSelectedSubtitle)