def serviceStarted(self): #override from InfoBarShowHide new = self.servicelist.newServicePlayed() if self.execing: InfoBarShowHide.serviceStarted(self) self.current_begin_time=0 elif not self.__checkServiceStarted in self.onShown and new: self.onShown.append(self.__checkServiceStarted)
def serviceStarted(self): #override from InfoBarShowHide new = self.servicelist.newServicePlayed() if self.execing: InfoBarShowHide.serviceStarted(self) self.current_begin_time = 0 elif not self.__checkServiceStarted in self.onShown and new: self.onShown.append(self.__checkServiceStarted)
def __init__(self, session, playlistCallback, nextItemCallback, prevItemCallback, infoCallback, menuCallback): Screen.__init__(self, session) self.skinName = ['KodiVideoPlayer', 'MoviePlayer'] statusScreen = self.session.instantiateDialog(StatusScreen) InfoBarBase.__init__(self, steal_current_service=True) SubsSupport.__init__(self, searchSupport=True, embeddedSupport=True) SubsSupportStatus.__init__(self) InfoBarSeek.__init__(self) InfoBarShowHide.__init__(self) InfoBarSubservicesSupport.__init__(self) InfoBarAspectChange.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarNotifications.__init__(self) HelpableScreen.__init__(self) self.playlistCallback = playlistCallback self.nextItemCallback = nextItemCallback self.prevItemCallback = prevItemCallback self.infoCallback = infoCallback self.menuCallback = menuCallback self.statusScreen = statusScreen self.defaultImage = None self.postAspectChange.append(self.showAspectChanged) self.__timer = eTimer() self.__timer.callback.append(self.__seekToPosition) self.__image = None self.__position = None self.__firstStart = True self["image"] = WebPixmap(self.defaultImage, caching=False) self["directionActions"] = HelpableActionMap( self, "DirectionActions", { "downUp": (playlistCallback, _("Show playlist")), "upUp": (playlistCallback, _("Show playlist")), }) self["okCancelActions"] = HelpableActionMap(self, "OkCancelActions", {"cancel": self.close}) self["actions"] = HelpableActionMap( self, "KodiPlayerActions", { "menuPressed": (menuCallback, _("Show playback menu")), "infoPressed": (infoCallback, _("Show playback info")), "nextPressed": (nextItemCallback, _("Skip to next item in playlist")), "prevPressed": (prevItemCallback, _("Skip to previous item in playlist")) }) self.eventTracker = ServiceEventTracker( self, { iPlayableService.evStart: self.__evStart, }) self.onClose.append( boundFunction(self.session.deleteDialog, self.statusScreen)) self.onClose.append( boundFunction(Notifications.RemovePopup, self.RESUME_POPUP_ID)) self.onClose.append(self.__timer.stop)
def __init__(self, session, playlistCallback, nextItemCallback, prevItemCallback, infoCallback, menuCallback): Screen.__init__(self, session) self.skinName = ['KodiVideoPlayer', 'MoviePlayer'] statusScreen = self.session.instantiateDialog(StatusScreen) InfoBarBase.__init__(self, steal_current_service=True) SubsSupport.__init__(self, searchSupport=True, embeddedSupport=True) SubsSupportStatus.__init__(self) InfoBarSeek.__init__(self) InfoBarShowHide.__init__(self) InfoBarSubservicesSupport.__init__(self) InfoBarAspectChange.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarNotifications.__init__(self) HelpableScreen.__init__(self) self.playlistCallback = playlistCallback self.nextItemCallback = nextItemCallback self.prevItemCallback = prevItemCallback self.infoCallback = infoCallback self.menuCallback = menuCallback self.statusScreen = statusScreen self.defaultImage = None self.postAspectChange.append(self.showAspectChanged) self.__timer = eTimer() self.__timer.callback.append(self.__seekToPosition) self.__image = None self.__position = None self.__firstStart = True self["image"] = WebPixmap(self.defaultImage, caching=False) self["directionActions"] = HelpableActionMap(self, "DirectionActions", { "downUp": (playlistCallback, _("Show playlist")), "upUp": (playlistCallback, _("Show playlist")), }) self["okCancelActions"] = HelpableActionMap(self, "OkCancelActions", { "cancel": self.close }) self["actions"] = HelpableActionMap(self, "KodiPlayerActions", { "menuPressed": (menuCallback, _("Show playback menu")), "infoPressed": (infoCallback, _("Show playback info")), "nextPressed": (nextItemCallback, _("Skip to next item in playlist")), "prevPressed": (prevItemCallback, _("Skip to previous item in playlist")) }) self.eventTracker = ServiceEventTracker(self, { iPlayableService.evStart : self.__evStart, }) self.onClose.append(boundFunction(self.session.deleteDialog, self.statusScreen)) self.onClose.append(boundFunction(Notifications.RemovePopup, self.RESUME_POPUP_ID)) self.onClose.append(self.__timer.stop)
def __init__(self, session, streamurl, servicetype): Screen.__init__(self, session) self.session = session InfoBarBase.__init__(self) InfoBarMoviePlayerSummarySupport.__init__(self) InfoBarServiceNotifications.__init__(self) InfoBarShowHide.__init__(self) InfoBarSeek.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) IPTVInfoBarPVRState.__init__(self, PVRState, True) if cfg.subs.value is True: SubsSupport.__init__(self, searchSupport=True, embeddedSupport=True) SubsSupportStatus.__init__(self) self.streamurl = streamurl self.servicetype = servicetype skin = skin_path + 'catchupplayer.xml' self["epg_description"] = StaticText() self["streamcat"] = StaticText() self["streamtype"] = StaticText() self["extension"] = StaticText() self["epg_picon"] = Pixmap() self["eventname"] = Label() self["state"] = Label() self["speed"] = Label() self["statusicon"] = MultiPixmap() self["PTSSeekBack"] = Pixmap() self["PTSSeekPointer"] = Pixmap() with open(skin, 'r') as f: self.skin = f.read() self.setup_title = _('Catch Up') self['actions'] = ActionMap( ["XStreamityActions"], { 'cancel': self.back, 'red': self.back, 'tv': self.toggleStreamType, 'info': self.toggleStreamType, "stop": self.back, }, -2) self.onFirstExecBegin.append( boundFunction(self.playStream, self.servicetype, self.streamurl))
def __init__(self, session, service, restoreService=True, infoCallback=None, getNextService=None, getPrevService=None, stopCallback=None, pauseCallback=None): Screen.__init__(self, session) InfoBarNotifications.__init__(self) InfoBarSeek.__init__(self) InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) InfoBarCueSheetSupport.__init__(self) #TODO FIX THIS HACK # currently we just want to be able to resume playback (if supported by e2), # for now we don't care about cutting or jumpmarks or anything like that... del self["CueSheetActions"] self.session = session self.service = service self.infoCallback = infoCallback self.getNextServiceCB = getNextService self.getPrevServiceCB = getPrevService self.stopCB = stopCallback self.pauseCB = pauseCallback self.callback = None self.screen_timeout = 5000 self.nextservice = None self.is_closing = False self.restoreService = restoreService self.oldService = self.session.nav.getCurrentlyPlayingServiceReference( ) self["actions"] = ActionMap( [ "OkCancelActions", "InfobarSeekActions", "MediaPlayerActions", "MovieSelectionActions" ], { "cancel": self.leavePlayer, "stop": self.leavePlayer, "playpauseService": self.playpause, "previous": self.playPrev, "next": self.playNext, "showEventInfo": self.showVideoInfo, }, -2) self.returning = False self.onShown.append(self.play) self.onClose.append(self.__onClose)
def __init__(self, session, player_callback): Screen.__init__(self, session) self.skinName = ["ArchivCZSKMoviePlayer", "MoviePlayer"] InfoBarBase.__init__(self) InfoBarShowHide.__init__(self) InfoBarSeek.__init__(self) # disable slowmotion/fastforward self.seekFwd = self.seekFwdManual self.seekBack = self.seekBackManual initSubsSettings() SubsSupport.__init__(self, defaultPath=config_archivczsk.tmpPath.value, forceDefaultPath=True, searchSupport=True, embeddedSupport=True, preferEmbedded=True) SubsSupportStatus.__init__(self) InfoBarAudioSelectionNoSubtitles.__init__(self) InfoBarNotifications.__init__(self) InfoBarSubservicesSupport.__init__(self) InfoBarAspectChange.__init__(self) self.postAspectChange.append(self.__aspect_changed) HelpableScreen.__init__(self) self.status_dialog = self.session.instantiateDialog(StatusScreen) self.player_callback = player_callback self.__timer = eTimer() self.__timer_conn = eConnectCallback(self.__timer.timeout, self.__pts_available) self.__subtitles_url = None self.__resume_time_sec = None self["actions"] = HelpableActionMap( self, "ArchivCZSKMoviePlayerActions", { "showPlaylist": (boundFunction(self.player_callback, ( "playlist", "show", )), _("Show playlist")), "nextEntry": (boundFunction(self.player_callback, ( "playlist", "next", )), _("Play next entry in playlist")), "prevEntry": (boundFunction(self.player_callback, ( "playlist", "prev", )), _("Play previous entry in playlist")), "cancel": (boundFunction(self.player_callback, ("exit", )), _("Exit player")), }, -2) self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evStart: self.__service_started, }) self.onClose.append(self.__on_close)
def __init__(self, session, master): MediaGUI.__init__(self, session, master) InfoBarNotifications.__init__(self) InfoBarSeek.__init__(self) InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) InfoBarCueSheetSupport.__init__(self) self.skinName = "MoviePlayer" self.setTitle(_("UPnP/DLNA Video Player")) # TODO FIX THIS HACK # currently we just want to be able to resume playback (if supported by e2), # for now we don't care about cutting or jumpmarks or anything like that... del self["CueSheetActions"]
def __init__(self, session, service, config_plugins_plugin, leave_on_eof=False): self.service = service self.leave_on_eof = leave_on_eof self.allowPiP = False self.allowPiPSwap = False Screen.__init__(self, session) HelpableScreen.__init__(self) self.skinName = getSkinName("CockpitPlayer") self["Service"] = COCCurrentService(session.nav, self) InfoBarShowHide.__init__(self) InfoBarBase.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarNotifications.__init__(self) CockpitPlayerAudio.__init__(self, session, config_plugins_plugin) CockpitPlayerSubtitles.__init__(self, config_plugins_plugin) CockpitCueSheet.__init__(self, service) CockpitSeek.__init__(self, service, config_plugins_plugin) CockpitPVRState.__init__(self) CutList.__init__(self) self["actions"] = HelpableActionMap( self, "CockpitActions", { "STOP": (self.leavePlayer, _("Stop playback")), "EXIT": (self.leavePlayer, _("Stop playback")), "POWER": (self.leavePlayer, _("Stop playback")), "CHANNELUP": (self.skipForward, _("Skip forward")), "CHANNELDOWN": (self.skipBackward, _("Skip backward")), "INFOS": (self.infoMovie, _("EPG Info")), }, -2) self._event_tracker = ServiceEventTracker(screen=self, eventmap={ iPlayableService.evStart: self.__serviceStarted, }) self.service_started = False self.cut_list = [] self.resume_point = 0 self.onShown.append(self.__onShow)
def __init__(self, session, streamurl, servicetype): Screen.__init__(self, session) self.session = session InfoBarBase.__init__(self) InfoBarMoviePlayerSummarySupport.__init__(self) InfoBarServiceNotifications.__init__(self) InfoBarShowHide.__init__(self) InfoBarSeek.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) IPTVInfoBarPVRState.__init__(self, PVRState, True) SubsSupport.__init__(self, searchSupport=True, embeddedSupport=True) SubsSupportStatus.__init__(self) self.streamurl = streamurl self.servicetype = servicetype skin = skin_path + 'vodplayer.xml' self["streamcat"] = StaticText() self["streamtype"] = StaticText() self["extension"] = StaticText() self["cover"] = Pixmap() self["eventname"] = Label() self["state"] = Label() self["speed"] = Label() self["statusicon"] = MultiPixmap() with open(skin, 'r') as f: self.skin = f.read() self.setup_title = _('VOD') self['actions'] = ActionMap( ["XStreamityActions"], { 'cancel': self.back, 'tv': self.toggleStreamType, "channelUp": self.next, "channelDown": self.prev, "up": self.prev, "down": self.next, "stop": self.back, }, -2) self.onLayoutFinish.append(self.__layoutFinished)
def __init__(self, session, service, restoreService=True, infoCallback=None, getNextService=None, getPrevService=None, stopCallback=None, pauseCallback=None, getMetadata=None): Screen.__init__(self, session) InfoBarNotifications.__init__(self) InfoBarSeek.__init__(self) InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) InfoBarCueSheetSupport.__init__(self) # TODO FIX THIS HACK # currently we just want to be able to resume playback (if supported by e2), # for now we don't care about cutting or jumpmarks or anything like that... del self["CueSheetActions"] self.session = session self.service = service self.infoCallback = infoCallback self.getNextServiceCB = getNextService self.getPrevServiceCB = getPrevService self.stopCB = stopCallback self.pauseCB = pauseCallback self.callback = None self.screen_timeout = 5000 self.nextservice = None self.is_closing = False self.restoreService = restoreService self.oldService = self.session.nav.getCurrentlyPlayingServiceReference() self.getMetadata = getMetadata self.__delayed_close_timer = eTimer() self.__delayed_close_timer.callback.append(self.close) self["actions"] = ActionMap(["OkCancelActions", "InfobarSeekActions", "MediaPlayerActions", "MovieSelectionActions"], { "cancel": self.leavePlayer, "stop": self.leavePlayer, "playpauseService": self.playpause, "previous": self.playPrev, "next": self.playNext, "showEventInfo": self.showVideoInfo, }, -2) self.returning = False self.onShown.append(self.play) self.onClose.append(self.__onClose)
def __init__(self, session, player_callback): Screen.__init__(self, session) self.skinName = ["ArchivCZSKMoviePlayer", "MoviePlayer"] InfoBarBase.__init__(self) InfoBarShowHide.__init__(self) InfoBarSeek.__init__(self) # disable slowmotion/fastforward self.seekFwd = self.seekFwdManual self.seekBack = self.seekBackManual initSubsSettings() SubsSupport.__init__(self, defaultPath = config_archivczsk.tmpPath.value, forceDefaultPath = True, searchSupport = True) SubsSupportStatus.__init__(self) InfoBarAudioSelectionNoSubtitles.__init__(self) InfoBarNotifications.__init__(self) InfoBarSubservicesSupport.__init__(self) InfoBarAspectChange.__init__(self) self.postAspectChange.append(self.__aspect_changed) HelpableScreen.__init__(self) self.status_dialog = self.session.instantiateDialog(StatusScreen) self.player_callback = player_callback self.__timer = eTimer() self.__timer_conn = eConnectCallback(self.__timer.timeout, self.__pts_available) self.__subtitles_url = None self.__resume_time_sec = None self["actions"] = HelpableActionMap(self, "ArchivCZSKMoviePlayerActions", {"showPlaylist": (boundFunction(self.player_callback, ("playlist", "show",)), _("Show playlist")), "nextEntry":(boundFunction(self.player_callback, ("playlist", "next",)), _("Play next entry in playlist")), "prevEntry":(boundFunction(self.player_callback, ("playlist", "prev",)), _("Play previous entry in playlist")), "cancel":(boundFunction(self.player_callback, ("exit",)), _("Exit player")), }, -2) self.__event_tracker = ServiceEventTracker(screen=self, eventmap= { iPlayableService.evStart: self.__service_started, }) self.onClose.append(self.__on_close)
def __init__(self, session, dvd_device = None, dvd_filelist = None, args = None): if not dvd_filelist: dvd_filelist = [] Screen.__init__(self, session) InfoBarBase.__init__(self) InfoBarNotifications.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap='MediaPlayerCueSheetActions') InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) self.save_infobar_seek_config() self.change_infobar_seek_config() InfoBarSeek.__init__(self) InfoBarPVRState.__init__(self) InfoBarLongKeyDetection.__init__(self) self.oldService = self.session.nav.getCurrentlyPlayingServiceOrGroup() self.session.nav.stopService() self['audioLabel'] = Label('n/a') self['subtitleLabel'] = Label('') self['angleLabel'] = Label('') self['chapterLabel'] = Label('') self['anglePix'] = Pixmap() self['anglePix'].hide() self.last_audioTuple = None self.last_subtitleTuple = None self.last_angleTuple = None self.totalChapters = 0 self.currentChapter = 0 self.totalTitles = 0 self.currentTitle = 0 self.__event_tracker = ServiceEventTracker(screen=self, eventmap={iPlayableService.evStopped: self.__serviceStopped, iPlayableService.evUser: self.__timeUpdated, iPlayableService.evUser + 1: self.__statePlay, iPlayableService.evUser + 2: self.__statePause, iPlayableService.evUser + 3: self.__osdFFwdInfoAvail, iPlayableService.evUser + 4: self.__osdFBwdInfoAvail, iPlayableService.evUser + 5: self.__osdStringAvail, iPlayableService.evUser + 6: self.__osdAudioInfoAvail, iPlayableService.evUser + 7: self.__osdSubtitleInfoAvail, iPlayableService.evUser + 8: self.__chapterUpdated, iPlayableService.evUser + 9: self.__titleUpdated, iPlayableService.evUser + 11: self.__menuOpened, iPlayableService.evUser + 12: self.__menuClosed, iPlayableService.evUser + 13: self.__osdAngleInfoAvail}) self['DVDPlayerDirectionActions'] = ActionMap(['DirectionActions'], {'left': self.keyLeft, 'right': self.keyRight, 'up': self.keyUp, 'down': self.keyDown, 'leftRepeated': self.doNothing, 'rightRepeated': self.doNothing, 'upRepeated': self.doNothing, 'downRepeated': self.doNothing, 'leftUp': self.doNothing, 'rightUp': self.doNothing, 'upUp': self.doNothing, 'downUp': self.doNothing}) self['OkCancelActions'] = ActionMap(['OkCancelActions'], {'ok': self.keyOk, 'cancel': self.keyCancel}) self['DVDPlayerPlaybackActions'] = HelpableActionMap(self, 'DVDPlayerActions', {'dvdMenu': (self.enterDVDMenu, _('show DVD main menu')), 'toggleInfo': (self.toggleInfo, _('toggle time, chapter, audio, subtitle info')), 'nextChapter': (self.nextChapter, _('forward to the next chapter')), 'prevChapter': (self.prevChapter, _('rewind to the previous chapter')), 'nextTitle': (self.nextTitle, _('jump forward to the next title')), 'prevTitle': (self.prevTitle, _('jump back to the previous title')), 'tv': (self.askLeavePlayer, _('exit DVD player or return to file browser')), 'dvdAudioMenu': (self.enterDVDAudioMenu, _('(show optional DVD audio menu)')), 'AudioSelection': (self.enterAudioSelection, _('Select audio track')), 'nextAudioTrack': (self.nextAudioTrack, _('switch to the next audio track')), 'nextSubtitleTrack': (self.nextSubtitleTrack, _('switch to the next subtitle language')), 'nextAngle': (self.nextAngle, _('switch to the next angle')), 'seekBeginning': self.seekBeginning}, -2) self['NumberActions'] = NumberActionMap(['NumberActions'], {'1': self.keyNumberGlobal, '2': self.keyNumberGlobal, '3': self.keyNumberGlobal, '4': self.keyNumberGlobal, '5': self.keyNumberGlobal, '6': self.keyNumberGlobal, '7': self.keyNumberGlobal, '8': self.keyNumberGlobal, '9': self.keyNumberGlobal, '0': self.keyNumberGlobal}) self.onClose.append(self.__onClose) try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except: pass self.autoplay = dvd_device or dvd_filelist if dvd_device: self.physicalDVD = True else: self.scanHotplug() self.dvd_filelist = dvd_filelist self.onFirstExecBegin.append(self.opened) self.service = None self.in_menu = False if fileExists('/proc/stb/fb/dst_left'): self.left = open('/proc/stb/fb/dst_left', 'r').read() self.width = open('/proc/stb/fb/dst_width', 'r').read() self.top = open('/proc/stb/fb/dst_top', 'r').read() self.height = open('/proc/stb/fb/dst_height', 'r').read() if self.left != '00000000' or self.top != '00000000' or self.width != '000002d0' or self.height != '0000000240': open('/proc/stb/fb/dst_left', 'w').write('00000000') open('/proc/stb/fb/dst_width', 'w').write('000002d0') open('/proc/stb/fb/dst_top', 'w').write('00000000') open('/proc/stb/fb/dst_height', 'w').write('0000000240') self.onClose.append(self.__restoreOSDSize) return
def __init__(self, session, dvd_device=None, dvd_filelist=None, args=None): if not dvd_filelist: dvd_filelist = [] Screen.__init__(self, session) InfoBarBase.__init__(self) InfoBarNotifications.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap="MediaPlayerCueSheetActions") InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) self.save_infobar_seek_config() self.change_infobar_seek_config() InfoBarSeek.__init__(self) InfoBarPVRState.__init__(self) InfoBarLongKeyDetection.__init__(self) self.oldService = self.session.nav.getCurrentlyPlayingServiceOrGroup() self.session.nav.stopService() self["audioLabel"] = Label("n/a") self["subtitleLabel"] = Label("") self["angleLabel"] = Label("") self["chapterLabel"] = Label("") self["anglePix"] = Pixmap() self["anglePix"].hide() self.last_audioTuple = None self.last_subtitleTuple = None self.last_angleTuple = None self.totalChapters = 0 self.currentChapter = 0 self.totalTitles = 0 self.currentTitle = 0 self.__event_tracker = ServiceEventTracker(screen=self, eventmap= { iPlayableService.evStopped: self.__serviceStopped, iPlayableService.evUser: self.__timeUpdated, iPlayableService.evUser+1: self.__statePlay, iPlayableService.evUser+2: self.__statePause, iPlayableService.evUser+3: self.__osdFFwdInfoAvail, iPlayableService.evUser+4: self.__osdFBwdInfoAvail, iPlayableService.evUser+5: self.__osdStringAvail, iPlayableService.evUser+6: self.__osdAudioInfoAvail, iPlayableService.evUser+7: self.__osdSubtitleInfoAvail, iPlayableService.evUser+8: self.__chapterUpdated, iPlayableService.evUser+9: self.__titleUpdated, iPlayableService.evUser+11: self.__menuOpened, iPlayableService.evUser+12: self.__menuClosed, iPlayableService.evUser+13: self.__osdAngleInfoAvail }) self["DVDPlayerDirectionActions"] = ActionMap(["DirectionActions"], { #MENU KEY DOWN ACTIONS "left": self.keyLeft, "right": self.keyRight, "up": self.keyUp, "down": self.keyDown, #MENU KEY REPEATED ACTIONS "leftRepeated": self.doNothing, "rightRepeated": self.doNothing, "upRepeated": self.doNothing, "downRepeated": self.doNothing, #MENU KEY UP ACTIONS "leftUp": self.doNothing, "rightUp": self.doNothing, "upUp": self.doNothing, "downUp": self.doNothing, }) self["OkCancelActions"] = ActionMap(["OkCancelActions"], { "ok": self.keyOk, "cancel": self.keyCancel, }) self["DVDPlayerPlaybackActions"] = HelpableActionMap(self, "DVDPlayerActions", { #PLAYER ACTIONS "dvdMenu": (self.enterDVDMenu, _("Show DVD main menu")), "toggleInfo": (self.toggleInfo, _("Toggle time, chapter, audio, subtitle info")), "nextChapter": (self.nextChapter, _("Forward to the next chapter")), "prevChapter": (self.prevChapter, _("Rewind to the previous chapter")), "nextTitle": (self.nextTitle, _("Jump forward to the next title")), "prevTitle": (self.prevTitle, _("Jump back to the previous title")), "tv": (self.askLeavePlayer, _("Exit DVD player or return to file browser")), "dvdAudioMenu": (self.enterDVDAudioMenu, _("(Show optional DVD audio menu)")), "AudioSelection": (self.enterAudioSelection, _("Select audio track")), "nextAudioTrack": (self.nextAudioTrack, _("Switch to the next audio track")), "nextSubtitleTrack": (self.nextSubtitleTrack, _("Switch to the next subtitle language")), "nextAngle": (self.nextAngle, _("Switch to the next angle")), "seekBeginning": (self.seekBeginning, _("Jump back to the start")) }, prio=-2) self["NumberActions"] = NumberActionMap(["NumberActions"], { "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, "4": self.keyNumberGlobal, "5": self.keyNumberGlobal, "6": self.keyNumberGlobal, "7": self.keyNumberGlobal, "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal, }) self.onClose.append(self.__onClose) try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except: pass self.autoplay = dvd_device or dvd_filelist if dvd_device: self.physicalDVD = True else: self.scanHotplug() self.dvd_filelist = dvd_filelist self.onFirstExecBegin.append(self.opened) self.service = None self.in_menu = False
def __init__(self, session, dvd_device = None, dvd_filelist = [ ], args = None): Screen.__init__(self, session) InfoBarBase.__init__(self) InfoBarNotifications.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions") InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) self.save_infobar_seek_config() self.change_infobar_seek_config() InfoBarSeek.__init__(self) InfoBarPVRState.__init__(self) self.oldService = self.session.nav.getCurrentlyPlayingServiceOrGroup() self.dvdScreen = None self.session.nav.stopService() self["audioLabel"] = Label("n/a") self["subtitleLabel"] = Label("") self["angleLabel"] = Label("") self["chapterLabel"] = Label("") self["anglePix"] = Pixmap() self["anglePix"].hide() self.last_audioTuple = None self.last_subtitleTuple = None self.last_angleTuple = None self.totalChapters = 0 self.currentChapter = 0 self.totalTitles = 0 self.currentTitle = 0 self.__event_tracker = ServiceEventTracker(screen=self, eventmap= { iPlayableService.evEnd: self.__serviceStopped, iPlayableService.evStopped: self.__serviceStopped, iPlayableService.evUser: self.__timeUpdated, iPlayableService.evUser+1: self.__statePlay, iPlayableService.evUser+2: self.__statePause, iPlayableService.evUser+3: self.__osdFFwdInfoAvail, iPlayableService.evUser+4: self.__osdFBwdInfoAvail, iPlayableService.evUser+5: self.__osdStringAvail, iPlayableService.evUser+6: self.__osdAudioInfoAvail, iPlayableService.evUser+7: self.__osdSubtitleInfoAvail, iPlayableService.evUser+8: self.__chapterUpdated, iPlayableService.evUser+9: self.__titleUpdated, iPlayableService.evUser+11: self.__menuOpened, iPlayableService.evUser+12: self.__menuClosed, iPlayableService.evUser+13: self.__osdAngleInfoAvail }) self["DVDPlayerDirectionActions"] = ActionMap(["DirectionActions"], { #MENU KEY DOWN ACTIONS "left": self.keyLeft, "right": self.keyRight, "up": self.keyUp, "down": self.keyDown, #MENU KEY REPEATED ACTIONS "leftRepeated": self.doNothing, "rightRepeated": self.doNothing, "upRepeated": self.doNothing, "downRepeated": self.doNothing, #MENU KEY UP ACTIONS "leftUp": self.doNothing, "rightUp": self.doNothing, "upUp": self.doNothing, "downUp": self.doNothing, }) self["OkCancelActions"] = ActionMap(["OkCancelActions"], { "ok": self.keyOk, "cancel": self.keyCancel, }, -2) self["DVDPlayerPlaybackActions"] = HelpableActionMap(self, "DVDPlayerActions", { #PLAYER ACTIONS "dvdMenu": (self.enterDVDMenu, _("show DVD main menu")), "toggleInfo": (self.toggleInfo, _("toggle time, chapter, audio, subtitle info")), "nextChapter": (self.nextChapter, _("forward to the next chapter")), "prevChapter": (self.prevChapter, _("rewind to the previous chapter")), "nextTitle": (self.nextTitle, _("jump forward to the next title")), "prevTitle": (self.prevTitle, _("jump back to the previous title")), "tv": (self.askLeavePlayer, _("exit DVD player or return to file browser")), "dvdAudioMenu": (self.enterDVDAudioMenu, _("(show optional DVD audio menu)")), "AudioSelection": (self.enterAudioSelection, _("Select audio track")), "nextAudioTrack": (self.nextAudioTrack, _("switch to the next audio track")), "nextSubtitleTrack": (self.nextSubtitleTrack, _("switch to the next subtitle language")), "nextAngle": (self.nextAngle, _("switch to the next angle")), "seekBeginning": self.seekBeginning, }, -2) self["DVDPlayerColorActions"] = HelpableActionMap(self, "ColorActions", { "blue": (self.chapterZap, _("jump to chapter by number")), }, -2) self.onClose.append(self.__onClose) try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except: pass self.autoplay = dvd_device or dvd_filelist if dvd_device: self.physicalDVD = True else: self.scanHotplug() self.dvd_filelist = dvd_filelist self.onFirstExecBegin.append(self.opened) self.service = None self.in_menu = False if fileExists("/proc/stb/vmpeg/0/dst_left"): self.left = open("/proc/stb/vmpeg/0/dst_left", "r").read()[:-1] self.width = open("/proc/stb/vmpeg/0/dst_width", "r").read()[:-1] self.top = open("/proc/stb/vmpeg/0/dst_top", "r").read()[:-1] self.height = open("/proc/stb/vmpeg/0/dst_height", "r").read()[:-1] if self.left != "0" or self.top != "0" or self.width != "2d0" or self.height != "240": open("/proc/stb/vmpeg/0/dst_left", "w").write("0") open("/proc/stb/vmpeg/0/dst_width", "w").write("2d0") open("/proc/stb/vmpeg/0/dst_top", "w").write("0") open("/proc/stb/vmpeg/0/dst_height", "w").write("240") self.onClose.append(self.__restoreOSDSize)
def doShow(self): if False == self.isClosing: InfoBarShowHide.doShow(self) else: printExc("customMoviePlayer.doShow")
def __init__(self, session, streamurl, servicetype): Screen.__init__(self, session) self.session = session InfoBarBase.__init__(self) InfoBarMoviePlayerSummarySupport.__init__(self) InfoBarServiceNotifications.__init__(self) InfoBarShowHide.__init__(self) InfoBarSeek.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) IPTVInfoBarPVRState.__init__(self, PVRState, True) SubsSupport.__init__(self, searchSupport=True, embeddedSupport=True) SubsSupportStatus.__init__(self) self.streamurl = streamurl self.servicetype = servicetype skin = skin_path + 'vodplayer.xml' self["streamcat"] = StaticText() self["streamtype"] = StaticText() self["extension"] = StaticText() self.PicLoad = ePicLoad() self.Scale = AVSwitch().getFramebufferScale() try: self.PicLoad.PictureData.get().append(self.DecodePicture) except: self.PicLoad_conn = self.PicLoad.PictureData.connect( self.DecodePicture) self["cover"] = Pixmap() self["eventname"] = Label() self["state"] = Label() self["speed"] = Label() self["statusicon"] = MultiPixmap() self["PTSSeekBack"] = Pixmap() self["PTSSeekPointer"] = Pixmap() with open(skin, 'r') as f: self.skin = f.read() self.setup_title = _('VOD') self['actions'] = ActionMap( ["XStreamityActions"], { 'cancel': self.back, 'tv': self.toggleStreamType, 'info': self.toggleStreamType, "channelUp": self.__next__, "channelDown": self.prev, "up": self.prev, "down": self.__next__, "stop": self.back, "red": self.back, }, -2) self.onFirstExecBegin.append( boundFunction(self.playStream, self.servicetype, self.streamurl))
def __init__(self, session, dvd_device=None, dvd_filelist=[], args=None): Screen.__init__(self, session) InfoBarBase.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap="MediaPlayerCueSheetActions") InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) self.subtitle_window.real_hide = self.subtitle_window.hide self.subtitle_window.hide = self.SubtitleWindowFakeHide InfoBarExtensions.__init__(self) InfoBarPlugins.__init__(self) InfoBarNotifications.__init__(self) HelpableScreen.__init__(self) self.save_infobar_seek_config() self.change_infobar_seek_config() InfoBarSeek.__init__(self) InfoBarPVRState.__init__(self) self.dvdScreen = self.session.instantiateDialog(DVDOverlay) self.oldService = self.session.nav.getCurrentlyPlayingServiceReference( ) self.session.nav.stopService() self["audioLabel"] = Label("n/a") self["subtitleLabel"] = Label("") self["angleLabel"] = Label("") self["chapterLabel"] = Label("") self["anglePix"] = Pixmap() self["anglePix"].hide() self.last_audioString = None self.last_subtitleString = None self.last_angleTuple = None self.totalChapters = 0 self.currentChapter = 0 self.totalTitles = 0 self.currentTitle = 0 self._subs_enabled = False self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evEnd: self.__serviceStopped, iPlayableService.evStopped: self.__serviceStopped, iPlayableService.evAudioListChanged: self.__osdAudioInfoAvail, iPlayableService.evSubtitleListChanged: self.__osdSubtitleInfoAvail, iPlayableService.evUser + 1: self.__statePlay, iPlayableService.evUser + 2: self.__statePause, iPlayableService.evUser + 3: self.__osdFFwdInfoAvail, iPlayableService.evUser + 4: self.__osdFBwdInfoAvail, iPlayableService.evUser + 5: self.__osdStringAvail, iPlayableService.evUser + 6: self.__osdAngleInfoAvail, iPlayableService.evUser + 7: self.__chapterUpdated, iPlayableService.evUser + 8: self.__titleUpdated, iPlayableService.evUser + 9: self.__menuOpened, iPlayableService.evUser + 10: self.__menuClosed }) self["DVDPlayerDirectionActions"] = ActionMap( ["DirectionActions"], { #MENU KEY DOWN ACTIONS "left": self.keyLeft, "right": self.keyRight, "up": self.keyUp, "down": self.keyDown, #MENU KEY REPEATED ACTIONS "leftRepeated": self.doNothing, "rightRepeated": self.doNothing, "upRepeated": self.doNothing, "downRepeated": self.doNothing, #MENU KEY UP ACTIONS "leftUp": self.doNothing, "rightUp": self.doNothing, "upUp": self.doNothing, "downUp": self.doNothing, }) self["OkCancelActions"] = ActionMap(["OkCancelActions"], { "ok": self.keyOk, "cancel": self.keyCancel, }) self["DVDPlayerPlaybackActions"] = HelpableActionMap( self, "DVDPlayerActions", { #PLAYER ACTIONS "dvdMenu": (self.enterDVDMenu, _("show DVD main menu")), "toggleInfo": (self.toggleInfo, _("toggle time, chapter, audio, subtitle info")), "nextChapter": (self.nextChapter, _("forward to the next chapter")), "prevChapter": (self.prevChapter, _("rewind to the previous chapter")), "nextTitle": (self.nextTitle, _("jump forward to the next title")), "prevTitle": (self.prevTitle, _("jump back to the previous title")), "tv": (self.askLeavePlayer, _("exit DVD player or return to file browser")), "dvdAudioMenu": (self.enterDVDAudioMenu, _("(show optional DVD audio menu)")), "AudioSelection": (self.enterAudioSelection, _("Select audio track")), "nextAudioTrack": (self.nextAudioTrack, _("switch to the next audio track")), "nextSubtitleTrack": (self.nextSubtitleTrack, _("switch to the next subtitle language")), "nextAngle": (self.nextAngle, _("switch to the next angle")), "seekBeginning": self.seekBeginning, }, -2) self["NumberActions"] = NumberActionMap( ["NumberActions"], { "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, "4": self.keyNumberGlobal, "5": self.keyNumberGlobal, "6": self.keyNumberGlobal, "7": self.keyNumberGlobal, "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal, }) self.onClose.append(self.__onClose) from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) self.autoplay = dvd_device or dvd_filelist if dvd_device: self.physicalDVD = True else: self.scanHotplug() self.dvd_filelist = dvd_filelist self.onFirstExecBegin.append(self.opened) self.service = None self.in_menu = False
def __init__(self, session, dvd_device = None, dvd_filelist = [ ], args = None): Screen.__init__(self, session) InfoBarBase.__init__(self) InfoBarNotifications.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions") InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) self.save_infobar_seek_config() self.change_infobar_seek_config() InfoBarSeek.__init__(self) InfoBarPVRState.__init__(self) self.dvdScreen = self.session.instantiateDialog(DVDOverlay) self.skinName = ["AZDVDPlayer", "DVDPlayer" ] self.oldService = self.session.nav.getCurrentlyPlayingServiceReference() self.session.nav.stopService() self["audioLabel"] = Label("n/a") self["subtitleLabel"] = Label("") self["angleLabel"] = Label("") self["chapterLabel"] = Label("") self["anglePix"] = Pixmap() self["anglePix"].hide() self.last_audioTuple = None self.last_subtitleTuple = None self.last_angleTuple = None self.totalChapters = 0 self.currentChapter = 0 self.totalTitles = 0 self.currentTitle = 0 AZDVDPlayer.STATE = "NONE" self.__event_tracker = ServiceEventTracker(screen=self, eventmap= { iPlayableService.evStopped: self.__serviceStopped, iPlayableService.evStart: self.__serviceStarted, iPlayableService.evUser+3: self.__osdFFwdInfoAvail, iPlayableService.evUser+4: self.__osdFBwdInfoAvail, iPlayableService.evUser+6: self.__osdAudioInfoAvail, iPlayableService.evUser+7: self.__osdSubtitleInfoAvail, iPlayableService.evUser+8: self.__chapterUpdated, iPlayableService.evUser+9: self.__titleUpdated, iPlayableService.evUser+11: self.__menuOpened, iPlayableService.evUser+12: self.__menuClosed, iPlayableService.evUser+13: self.__osdAngleInfoAvail }) self["DVDPlayerDirectionActions"] = ActionMap(["DirectionActions"], { #MENU KEY DOWN ACTIONS "left": self.keyLeft, "right": self.keyRight, "up": self.keyUp, "down": self.keyDown, #MENU KEY REPEATED ACTIONS "leftRepeated": self.doNothing, "rightRepeated": self.doNothing, "upRepeated": self.doNothing, "downRepeated": self.doNothing, #MENU KEY UP ACTIONS "leftUp": self.doNothing, "rightUp": self.doNothing, "upUp": self.doNothing, "downUp": self.doNothing, }) self["OkCancelActions"] = ActionMap(["OkCancelActions"], { "ok": self.keyOk, "cancel": self.keyCancel, }) self["DVDPlayerPlaybackActions"] = HelpableActionMap(self, "AZDVDPlayerActions", { #DVDPLAYER OWN ACTIONS "stop": (self.stop, _("exit DVD player")), "toggleInfo": (self.toggleInfo, _("toggle time, chapter, audio, subtitle info")), "dvdMenu": (self.menu, _("show DVD main menu")), "nextChapter": (self.nextChapter, _("forward to the next chapter")), "prevChapter": (self.prevChapter, _("rewind to the previous chapter")), "nextTitle": (self.nextTitle, _("jump forward to the next title")), "prevTitle": (self.prevTitle, _("jump back to the previous title")), "nextAudioTrack": (self.nextAudioTrack, _("switch to the next audio track")), "SubtitleSelection": (self.subtitleSelection, _("switch to the next subtitle language")), "nextSubtitleTrack": (self.nextSubtitleTrack, _("switch to the next subtitle language")), "nextAngle": (self.nextAngle, _("switch to the next angle")), "seekBeginning": self.seekBeginning, #Actions linked to inforbarseek "pause": (self.playpauseService, _("Pause / Resume")), "seekFwd": (self.seekFwd, _("Seek forward")), "seekBwd": (self.seekBack, _("Seek backward")), #Actions from infobaraudioselection "AudioSelection": (self.audioSelection, _("Select audio track")), }, -2) self["NumberActions"] = NumberActionMap( [ "NumberActions"], { "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, "4": self.keyNumberGlobal, "5": self.keyNumberGlobal, "6": self.keyNumberGlobal, "7": self.keyNumberGlobal, "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal, }) self.onClose.append(self.__onClose) from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) self.autoplay = dvd_device or dvd_filelist if dvd_device: self.physicalDVD = True else: self.scanHotplug() self.dvd_filelist = dvd_filelist self.onFirstExecBegin.append(self.opened) self.service = None self.in_menu = False
def __init__(self, session, ref = "", args = None): Screen.__init__(self, session) InfoBarBase.__init__(self) InfoBarNotifications.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions") InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) self.save_infobar_seek_config() self.change_infobar_seek_config() InfoBarSeek.__init__(self) InfoBarPVRState.__init__(self) self.skinName = ["MRUAPlayer", "DVDPlayer" ] self.oldService = self.session.nav.getCurrentlyPlayingServiceReference() self.session.nav.stopService() self["audioLabel"] = Label("n/a") self["subtitleLabel"] = Label("") self["angleLabel"] = Label("") self["chapterLabel"] = Label("") self["anglePix"] = Pixmap() self["anglePix"].hide() self.last_audioTuple = None self.last_subtitleTuple = None self.last_angleTuple = None self.totalChapters = 0 self.currentChapter = 0 self.totalTitles = 0 self.currentTitle = 0 self.__event_tracker = ServiceEventTracker(screen=self, eventmap= { iPlayableService.evStopped: self.__serviceStopped, iPlayableService.evStart: self.__serviceStarted, iPlayableService.evUser+1: self.__statePlay, iPlayableService.evUser+2: self.__statePause, iPlayableService.evUser+3: self.__osdStringAvail, iPlayableService.evUser+4: self.__osdAudioInfoAvail, iPlayableService.evUser+5: self.__osdSubtitleInfoAvail }) self["MRUAPlayerDirectionActions"] = ActionMap(["DirectionActions"], { #MENU KEY DOWN ACTIONS "left": self.keyLeft, "right": self.keyRight, #"up": self.keyUp, #"down": self.keyDown, #MENU KEY REPEATED ACTIONS "leftRepeated": self.doNothing, "rightRepeated": self.doNothing, "upRepeated": self.doNothing, "downRepeated": self.doNothing, #MENU KEY UP ACTIONS "leftUp": self.doNothing, "rightUp": self.doNothing, "upUp": self.doNothing, "downUp": self.doNothing, }) self["OkCancelActions"] = ActionMap(["OkCancelActions"], { "ok": self.keyOk, "cancel": self.keyCancel, }) self["DVDPlayerPlaybackActions"] = HelpableActionMap(self, "MRUAPlayerActions", { #MRUAPLAYER'S OWN ACTIONS "stop": (self.stop, _("Stop Playback")), "keyMenu": (self.menu, _("Show menu options")), "seekTotime": (self.seekTotime, _("switch to the next angle")), "seekFwdinput": (self.seekFwdInput, _("Seek forward with input box")), "seekBwdinput": (self.seekBwdInput, _("Seek backward with input box")), "subtitles": (self.subtitleSelection, _("Subtitle selection")), #Actions linked to inforbarseek "playpause": (self.playpauseService, _("Pause / Resume")), "toggleInfo": (self.toggleShow, _("toggle time, chapter, audio, subtitle info")), #"seekFwd": (self.seekFwd, _("Seek forward")), #"seekBwd": (self.seekBack, _("Seek backward")), #Actions from Inforbaraudioselection "AudioSelection": (self.audioSelection, _("Select audio track")), }, -2) self["NumberActions"] = NumberActionMap( [ "NumberActions"], { "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, "4": self.keyNumberGlobal, "5": self.keyNumberGlobal, "6": self.keyNumberGlobal, "7": self.keyNumberGlobal, "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal, }) self.onClose.append(self.__onClose) config.plugins.mc_mrua.screenres.value = str(config.av.videomode[config.av.videoport.value].value)[:-1] #print config.plugins.mc_mrua.sreenres.value #Tmp Hack added to disable RTC while playing through mrua os.system("echo 0 > /tmp/zerortc") os.system("mount -o bind /tmp/zerortc /proc/stb/fp/rtc") self.ref = ref self.onFirstExecBegin.append(self.Start) self.service = None self.in_menu = False
def __init__(self, session, playlistCallback, nextItemCallback, prevItemCallback, infoCallback, menuCallback): Screen.__init__(self, session) self.skinName = ['KodiVideoPlayer'] statusScreen = self.session.instantiateDialog(StatusScreen) InfoBarBase.__init__(self, steal_current_service=True) SubsSupport.__init__(self, searchSupport=True, embeddedSupport=True) SubsSupportStatus.__init__(self) InfoBarSeek.__init__(self) InfoBarShowHide.__init__(self) InfoBarSubservicesSupport.__init__(self) InfoBarAspectChange.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarNotifications.__init__(self) HelpableScreen.__init__(self) self.playlistCallback = playlistCallback self.nextItemCallback = nextItemCallback self.prevItemCallback = prevItemCallback self.infoCallback = infoCallback self.menuCallback = menuCallback self.statusScreen = statusScreen self.defaultImage = None self.postAspectChange.append(self.showAspectChanged) self.__timer = eTimer() self.__timer.callback.append(self.__seekToPosition) self.__image = None self.__position = None self.__firstStart = True self["genre"] = Label() # load meta info from json file provided by Kodi Enigma2Player try: meta = json.load(open(KODIEXTIN, "r")) except Exception as e: self.logger.error("failed to load meta from %s: %s", KODIEXTIN, str(e)) meta = {} self.__image = Meta(meta).getImage() self["image"] = WebPixmap(self.__image, caching=True) self.genre = str(", ".join(Meta(meta).getGenre())) self.plot = Meta(meta).getPlot() self["genre"].setText(self.genre) # set title, image if provided self.title_ref = Meta(meta).getTitle() # set start position if provided self.setStartPosition(Meta(meta).getStartTime()) self["directionActions"] = HelpableActionMap( self, "DirectionActions", { "downUp": (playlistCallback, _("Show playlist")), "upUp": (playlistCallback, _("Show playlist")) }) self["okCancelActions"] = HelpableActionMap(self, "OkCancelActions", {"cancel": self.close}) self["actions"] = HelpableActionMap( self, "KodiPlayerActions", { "menuPressed": (menuCallback, _("Show playback menu")), "infoPressed": (infoCallback, _("Show playback info")), "nextPressed": (nextItemCallback, _("Skip to next item in playlist")), "prevPressed": (prevItemCallback, _("Skip to previous item in playlist")), "seekFwdManual": self.keyr, "seekBackManual": self.keyl }) self.eventTracker = ServiceEventTracker( self, { iPlayableService.evStart: self.__evStart, }) assert KodiVideoPlayer.instance is None, "class KodiVideoPlayer is a singleton class and just one instance of this class is allowed!" KodiVideoPlayer.instance = self self.onClose.append( boundFunction(self.session.deleteDialog, self.statusScreen)) self.onClose.append( boundFunction(Notifications.RemovePopup, self.RESUME_POPUP_ID)) self.onClose.append(self.__timer.stop)
def __init__(self, session, service, restoreService=True, infoCallback=None, getNextService=None, getPrevService=None, stopCallback=None, pauseCallback=None, streamMode=False, askBeforeLeaving=True): Screen.__init__(self, session) InfoBarBase.__init__(self) InfoBarSeek.__init__(self) InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) InfoBarCueSheetSupport.__init__(self) InfoBarServiceErrorPopupSupport.__init__(self) InfoBarExtensions.__init__(self) InfoBarPlugins.__init__(self) InfoBarNotifications.__init__(self) #TODO FIX THIS HACK # currently we just want to be able to resume playback (if supported by e2), # for now we don't care about cutting or jumpmarks or anything like that... del self["CueSheetActions"] self.session = session self.service = service self.infoCallback = infoCallback self.getNextServiceCB = getNextService self.getPrevServiceCB = getPrevService self.stopCB = stopCallback self.pauseCB = pauseCallback self.callback = None self.screen_timeout = 5000 self.nextservice = None self.is_closing = False if not restoreService: # lastservice is handled by PlayerBase which is inherited by InfoBarSeek # take care... when a zap timer want to zap to a service the player is closed and lastservice is changed in onClose callback of PlayerBase! self.lastservice = None self.streamMode = streamMode self["actions"] = ActionMap( [ "OkCancelActions", "InfobarSeekActions", "MediaPlayerActions", "MovieSelectionActions" ], { "cancel": self.leavePlayer, "stop": self.leavePlayer, "playpauseService": self.playpause, "previous": self.playPrev, "next": self.playNext, "showEventInfo": self.showVideoInfo, }, -2) self.returning = False self._askBeforeLeaving = askBeforeLeaving self.onFirstExecBegin.append(self.play) self.onClose.append(self.__onClose)
def __init__(self, session, dvd_device=None, dvd_filelist=[], args=None): Screen.__init__(self, session) InfoBarBase.__init__(self) InfoBarNotifications.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap="MediaPlayerCueSheetActions") InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) self.save_infobar_seek_config() self.change_infobar_seek_config() InfoBarSeek.__init__(self) InfoBarPVRState.__init__(self) self.oldService = self.session.nav.getCurrentlyPlayingServiceOrGroup() self.dvdScreen = None self.session.nav.stopService() self["audioLabel"] = Label("n/a") self["subtitleLabel"] = Label("") self["angleLabel"] = Label("") self["chapterLabel"] = Label("") self["anglePix"] = Pixmap() self["anglePix"].hide() self.last_audioTuple = None self.last_subtitleTuple = None self.last_angleTuple = None self.totalChapters = 0 self.currentChapter = 0 self.totalTitles = 0 self.currentTitle = 0 self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evEnd: self.__serviceStopped, iPlayableService.evStopped: self.__serviceStopped, iPlayableService.evUser: self.__timeUpdated, iPlayableService.evUser + 1: self.__statePlay, iPlayableService.evUser + 2: self.__statePause, iPlayableService.evUser + 3: self.__osdFFwdInfoAvail, iPlayableService.evUser + 4: self.__osdFBwdInfoAvail, iPlayableService.evUser + 5: self.__osdStringAvail, iPlayableService.evUser + 6: self.__osdAudioInfoAvail, iPlayableService.evUser + 7: self.__osdSubtitleInfoAvail, iPlayableService.evUser + 8: self.__chapterUpdated, iPlayableService.evUser + 9: self.__titleUpdated, iPlayableService.evUser + 11: self.__menuOpened, iPlayableService.evUser + 12: self.__menuClosed, iPlayableService.evUser + 13: self.__osdAngleInfoAvail }) self["DVDPlayerDirectionActions"] = ActionMap( ["DirectionActions"], { #MENU KEY DOWN ACTIONS "left": self.keyLeft, "right": self.keyRight, "up": self.keyUp, "down": self.keyDown, #MENU KEY REPEATED ACTIONS "leftRepeated": self.doNothing, "rightRepeated": self.doNothing, "upRepeated": self.doNothing, "downRepeated": self.doNothing, #MENU KEY UP ACTIONS "leftUp": self.doNothing, "rightUp": self.doNothing, "upUp": self.doNothing, "downUp": self.doNothing, }) self["OkCancelActions"] = ActionMap(["OkCancelActions"], { "ok": self.keyOk, "cancel": self.keyCancel, }, -2) self["DVDPlayerPlaybackActions"] = HelpableActionMap( self, ["DVDPlayerActions"], { #PLAYER ACTIONS "dvdMenu": (self.enterDVDMenu, _("show DVD main menu")), "toggleInfo": (self.toggleInfo, _("toggle time, chapter, audio, subtitle info")), "nextChapter": (self.nextChapter, _("forward to the next chapter")), "prevChapter": (self.prevChapter, _("rewind to the previous chapter")), "nextTitle": (self.nextTitle, _("jump forward to the next title")), "prevTitle": (self.prevTitle, _("jump back to the previous title")), "tv": (self.askLeavePlayer, _("exit DVD player or return to file browser")), "dvdAudioMenu": (self.enterDVDAudioMenu, _("(show optional DVD audio menu)")), "AudioSelection": (self.enterAudioSelection, _("Select audio track")), "nextAudioTrack": (self.nextAudioTrack, _("switch to the next audio track")), "nextSubtitleTrack": (self.nextSubtitleTrack, _("switch to the next subtitle language")), "nextAngle": (self.nextAngle, _("switch to the next angle")), "seekBeginning": self.seekBeginning, }, -2) self["DVDPlayerColorActions"] = HelpableActionMap( self, ["ColorActions"], { "blue": (self.chapterZap, _("jump to chapter by number")), }, -2) self.onClose.append(self.__onClose) try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except: pass self.autoplay = dvd_device or dvd_filelist if dvd_device: self.physicalDVD = True else: self.scanHotplug() self.dvd_filelist = dvd_filelist self.onFirstExecBegin.append(self.opened) self.service = None self.in_menu = False if fileExists("/proc/stb/fb/dst_left"): self.left = open("/proc/stb/fb/dst_left", "r").read() self.width = open("/proc/stb/fb/dst_width", "r").read() self.top = open("/proc/stb/fb/dst_top", "r").read() self.height = open("/proc/stb/fb/dst_height", "r").read() if self.left != "00000000" or self.top != "00000000" or self.width != "000002d0" or self.height != "0000000240": open("/proc/stb/fb/dst_left", "w").write("00000000") open("/proc/stb/fb/dst_width", "w").write("000002d0") open("/proc/stb/fb/dst_top", "w").write("00000000") open("/proc/stb/fb/dst_height", "w").write("0000000240") self.onClose.append(self.__restoreOSDSize)
def __init__(self, session, ref = "", args = None): Screen.__init__(self, session) InfoBarBase.__init__(self) InfoBarNotifications.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions") InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) InfoBarSeek.__init__(self) InfoBarPVRState.__init__(self) self.skinName = ["MC_MoviePlayer", "DVDPlayer"] self.oldService = self.session.nav.getCurrentlyPlayingServiceReference() self.session.nav.stopService() self["audioLabel"] = Label("n/a") self["subtitleLabel"] = Label("None") self.__event_tracker = ServiceEventTracker(screen=self, eventmap= { iPlayableService.evStopped: self.__serviceStopped, iPlayableService.evStart: self.__serviceStarted, iPlayableService.evUpdatedInfo: self.__UpdatedInfo, }) self["MoviePlayerDirectionActions"] = ActionMap(["DirectionActions"], { #MENU KEY DOWN ACTIONS #"left": self.keyLeft, #"right": self.keyRight, #"up": self.keyUp, #"down": self.keyDown, #MENU KEY REPEATED ACTIONS "leftRepeated": self.doNothing, "rightRepeated": self.doNothing, "upRepeated": self.doNothing, "downRepeated": self.doNothing, #MENU KEY UP ACTIONS "leftUp": self.doNothing, "rightUp": self.doNothing, "upUp": self.doNothing, "downUp": self.doNothing, }) self["OkCancelActions"] = ActionMap(["OkCancelActions"], { "ok": self.keyOk, "cancel": self.keyCancel, }) self["MC_MoviePlayerActions"] = HelpableActionMap(self, "MC_MoviePlayerActions", { #OWN ACTIONS "ok": (self.keyOk, _("Toggle info")), "stop": (self.stop, _("Stop Playback")), "keyMenu": (self.menu, _("Show menu options")), "seekTotime": (self.seekTotime, _("switch to the next angle")), "seekFwdinput": (self.seekFwdInput, _("Seek forward with input box")), "seekBwdinput": (self.seekBwdInput, _("Seek backward with input box")), "subtitles": (self.subtitleSelection, _("Subtitle selection")), #Actions linked to inforbarseek "playpause": (self.playpauseService, _("Pause / Resume")), "toggleInfo": (self.toggleShow, _("toggle time, chapter, audio, subtitle info")), "seekFwd": (self.seekFwd, _("Seek forward")), "seekBwd": (self.seekBack, _("Seek backward")), #Actions from Inforbaraudioselection "AudioSelection": (self.audioSelection, _("Select audio track")), }, -2) self["NumberActions"] = NumberActionMap( [ "NumberActions"], { "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, "4": self.keyNumberGlobal, "5": self.keyNumberGlobal, "6": self.keyNumberGlobal, "7": self.keyNumberGlobal, "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal, }) self.onClose.append(self.__onClose) self.ref = ref self.onFirstExecBegin.append(self.Start) self.service = None
def __init__(self, session, dvd_device = None, dvd_filelist = [], args = None): Screen.__init__(self, session) InfoBarBase.__init__(self) InfoBarNotifications.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap='MediaPlayerCueSheetActions') InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) self.save_infobar_seek_config() self.change_infobar_seek_config() InfoBarSeek.__init__(self) InfoBarPVRState.__init__(self) self.oldService = self.session.nav.getCurrentlyPlayingServiceOrGroup() self.dvdScreen = None self.session.nav.stopService() self['audioLabel'] = Label('n/a') self['subtitleLabel'] = Label('') self['angleLabel'] = Label('') self['chapterLabel'] = Label('') self['anglePix'] = Pixmap() self['anglePix'].hide() self.last_audioTuple = None self.last_subtitleTuple = None self.last_angleTuple = None self.totalChapters = 0 self.currentChapter = 0 self.totalTitles = 0 self.currentTitle = 0 self.__event_tracker = ServiceEventTracker(screen=self, eventmap={iPlayableService.evEnd: self.__serviceStopped, iPlayableService.evStopped: self.__serviceStopped, iPlayableService.evUser: self.__timeUpdated, iPlayableService.evUser + 1: self.__statePlay, iPlayableService.evUser + 2: self.__statePause, iPlayableService.evUser + 3: self.__osdFFwdInfoAvail, iPlayableService.evUser + 4: self.__osdFBwdInfoAvail, iPlayableService.evUser + 5: self.__osdStringAvail, iPlayableService.evUser + 6: self.__osdAudioInfoAvail, iPlayableService.evUser + 7: self.__osdSubtitleInfoAvail, iPlayableService.evUser + 8: self.__chapterUpdated, iPlayableService.evUser + 9: self.__titleUpdated, iPlayableService.evUser + 11: self.__menuOpened, iPlayableService.evUser + 12: self.__menuClosed, iPlayableService.evUser + 13: self.__osdAngleInfoAvail}) self['DVDPlayerDirectionActions'] = ActionMap(['DirectionActions'], {'left': self.keyLeft, 'right': self.keyRight, 'up': self.keyUp, 'down': self.keyDown, 'leftRepeated': self.doNothing, 'rightRepeated': self.doNothing, 'upRepeated': self.doNothing, 'downRepeated': self.doNothing, 'leftUp': self.doNothing, 'rightUp': self.doNothing, 'upUp': self.doNothing, 'downUp': self.doNothing}) self['OkCancelActions'] = ActionMap(['OkCancelActions'], {'ok': self.keyOk, 'cancel': self.keyCancel}, -2) self['DVDPlayerPlaybackActions'] = HelpableActionMap(self, 'DVDPlayerActions', {'dvdMenu': (self.enterDVDMenu, _('show DVD main menu')), 'toggleInfo': (self.toggleInfo, _('toggle time, chapter, audio, subtitle info')), 'nextChapter': (self.nextChapter, _('forward to the next chapter')), 'prevChapter': (self.prevChapter, _('rewind to the previous chapter')), 'nextTitle': (self.nextTitle, _('jump forward to the next title')), 'prevTitle': (self.prevTitle, _('jump back to the previous title')), 'tv': (self.askLeavePlayer, _('exit DVD player or return to file browser')), 'dvdAudioMenu': (self.enterDVDAudioMenu, _('(show optional DVD audio menu)')), 'AudioSelection': (self.enterAudioSelection, _('Select audio track')), 'nextAudioTrack': (self.nextAudioTrack, _('switch to the next audio track')), 'nextSubtitleTrack': (self.nextSubtitleTrack, _('switch to the next subtitle language')), 'nextAngle': (self.nextAngle, _('switch to the next angle')), 'seekBeginning': self.seekBeginning}, -2) self['DVDPlayerColorActions'] = HelpableActionMap(self, 'ColorActions', {'blue': (self.chapterZap, _('jump to chapter by number'))}, -2) self.onClose.append(self.__onClose) try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except: pass self.autoplay = dvd_device or dvd_filelist if dvd_device: self.physicalDVD = True else: self.scanHotplug() self.dvd_filelist = dvd_filelist self.onFirstExecBegin.append(self.opened) self.service = None self.in_menu = False if fileExists('/proc/stb/fb/dst_left'): self.left = open('/proc/stb/fb/dst_left', 'r').read() self.width = open('/proc/stb/fb/dst_width', 'r').read() self.top = open('/proc/stb/fb/dst_top', 'r').read() self.height = open('/proc/stb/fb/dst_height', 'r').read() if self.left != '00000000' or self.top != '00000000' or self.width != '000002d0' or self.height != '0000000240': open('/proc/stb/fb/dst_left', 'w').write('00000000') open('/proc/stb/fb/dst_width', 'w').write('000002d0') open('/proc/stb/fb/dst_top', 'w').write('00000000') open('/proc/stb/fb/dst_height', 'w').write('0000000240') self.onClose.append(self.__restoreOSDSize)