def __init__(self, session, api, user="******"): Screen.__init__(self, session) HelpableScreen.__init__(self) InfoBarNotifications.__init__(self) self.api = api self.user = user self["list"] = List() self["key_red"] = StaticText(_("Close")) self["key_green"] = StaticText() self["key_yellow"] = StaticText(_("Change user")) self["key_blue"] = StaticText(_("User history")) self["albumviewActions"] = HelpableActionMap( self, "EcasaAlbumviewActions", { "select": (self.select, _("show album")), "exit": (self.close, _("Close")), "users": (self.users, _("Change user")), "history": (self.history, _("User history")), }, -1, ) self.acquireAlbumsForUser(user) self.onLayoutFinish.append(self.layoutFinished)
def __init__(self, session, api, user='******'): Screen.__init__(self, session) HelpableScreen.__init__(self) InfoBarNotifications.__init__(self) self.api = api self.user = user self['list'] = List() self['key_red'] = StaticText(_("Close")) self['key_green'] = StaticText() self['key_yellow'] = StaticText(_("Change user")) self['key_blue'] = StaticText(_("User history")) self["albumviewActions"] = HelpableActionMap( self, "EcasaAlbumviewActions", { "select": (self.select, _("Show album")), "exit": (self.close, _("Close")), "users": (self.users, _("Change user")), "history": (self.history, _("User history")), }, prio=-1) self.acquireAlbumsForUser(user) self.onLayoutFinish.append(self.layoutFinished)
def __init__(self, session, service): Screen.__init__(self, session) if dwidth == 1280: self.skin = ALAJREStream.skinhd else: self.skin = ALAJREStream.skinfhd InfoBarNotifications.__init__(self) self.session = session self.service = service self.screen_timeout = 1000 self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, iPlayableService.evStart: self.__serviceStarted, iPlayableService.evEOF: self.__evEOF }) self['actions'] = ActionMap( [ 'OkCancelActions', 'InfobarSeekActions', 'ColorActions', 'MediaPlayerActions', 'MovieSelectionActions' ], { 'ok': self.leavePlayer, 'cancel': self.leavePlayer, 'stop': self.leavePlayer }, -2) self['pauseplay'] = Label(_('Play')) self.hidetimer = eTimer() self.repeter = True self.state = self.STATE_PLAYING self.onPlayStateChanged = [] self.play() self.onClose.append(self.__onClose)
def __init__(self, session, api=None): Screen.__init__(self, session) HelpableScreen.__init__(self) InfoBarNotifications.__init__(self) if api is None: if config.plugins.ecasa.last_backend.value == 'picasa': self.api = PicasaApi(cache=config.plugins.ecasa.cache.value) else: self.api = FlickrApi(config.plugins.ecasa.flickr_api_key.value, cache=config.plugins.ecasa.cache.value) try: self.api.setCredentials( config.plugins.ecasa.google_username.value, config.plugins.ecasa.google_password.value ) except Exception as e: AddPopup( _("Unable to authenticate with Google: %s.") % (e.message), MessageBox.TYPE_ERROR, 5, id=AUTHENTICATION_ERROR_ID, ) else: self.api = api self["key_red"] = StaticText(_("Close")) self["key_green"] = StaticText(_("Albums")) self["key_yellow"] = StaticText() self["key_blue"] = StaticText(_("Search")) for i in xrange(self.PICS_PER_PAGE): self['image%d' % i] = Pixmap() self['title%d' % i] = StaticText() self["highlight"] = MovingPixmap() self["waitingtext"] = Label(_("Please wait... Loading list...")) self["overviewActions"] = HelpableActionMap(self, "EcasaOverviewActions", { "up": self.up, "down": self.down, "left": self.left, "right": self.right, "nextPage": (self.nextPage, _("show next page")), "prevPage": (self.prevPage, _("show previous page")), "select": self.select, "exit":self.close, "albums":(self.albums, _("show your albums (if logged in)")), "search":(self.search, _("start a new search")), "contextMenu":(self.contextMenu, _("open context menu")), }, -1) self.offset = 0 self.__highlighted = 0 self.pictures = () # thumbnail loader self.picload = ePicLoad() self.picload.PictureData.get().append(self.gotPicture) self.currentphoto = None self.queue = deque() self.onLayoutFinish.append(self.layoutFinished)
def __init__(self, session, service, lastservice): Screen.__init__(self, session) InfoBarNotifications.__init__(self) self.session = session self.service = service self.lastservice = lastservice self["actions"] = ActionMap(["OkCancelActions", "InfobarSeekActions", "MediaPlayerActions", "MovieSelectionActions"], { "ok": self.doInfoAction, "cancel": self.doExit, "stop": self.doExit, "playpauseService": self.playpauseService, }, -2) self["sidebar"] = Label(_("/")) self.__event_tracker = ServiceEventTracker(screen = self, eventmap = { iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, iPlayableService.evStart: self.__serviceStarted, iPlayableService.evEOF: self.__evEOF, }) self.hidetimer = eTimer() self.hidetimer.timeout.get().append(self.doInfoAction) self.state = self.PLAYER_PLAYING self.lastseekstate = self.PLAYER_PLAYING self.__seekableStatusChanged() self.onClose.append(self.__onClose) self.doPlay()
def __init__(self, session, service, mediatype): Screen.__init__(self, session) self.skinName = "MoviePlayer" InfoBarNotifications.__init__(self) if mediatype == 'rtl': InfoBarSeek.__init__(self) self.session = session self.service = service self.screen_timeout = 3000 self.mediatype = mediatype self.__event_tracker = ServiceEventTracker(screen = self, eventmap = { iPlayableService.evStart: self.__serviceStarted, iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, iPlayableService.evEOF: self.__evEOF, }) self["actions"] = ActionMap(["OkCancelActions", "InfobarSeekActions", "MediaPlayerActions", "MovieSelectionActions"], { "ok": self.ok, "cancel": self.leavePlayer, "stop": self.handleLeave, "showEventInfo": self.showVideoInfo, }, -2) self.hidetimer = eTimer() self.hidetimer.timeout.get().append(self.ok) self.returning = False self.state = self.STATE_PLAYING self.lastseekstate = self.STATE_PLAYING self.onPlayStateChanged = [ ] self.play() self.onClose.append(self.__onClose)
def __init__(self, session, args = None): Screen.__init__(self, session) InfoBarAudioSelection.__init__(self) InfoBarAspectSelection.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions") InfoBarNotifications.__init__(self) InfoBarBase.__init__(self) InfoBarScreenSaver.__init__(self) InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) InfoBarResolutionSelection.__init__(self) self.summary = None self.oldService = self.session.nav.getCurrentlyPlayingServiceReference() self.session.nav.stopService() self.playlistparsers = {} self.addPlaylistParser(PlaylistIOM3U, "m3u") self.addPlaylistParser(PlaylistIOPLS, "pls") self.addPlaylistParser(PlaylistIOInternal, "e2pls") # 'None' is magic to start at the list of mountpoints try: defaultDir = config.mediaplayer.defaultDir.value except: Load_defaults() defaultDir = config.mediaplayer.defaultDir.value self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|trp|mts|m2ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|flv|mov|dts|3gp|3g2|asf|wmv|wma|webm)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls") self["filelist"] = self.filelist self.playlist = MyPlayList() self.is_closing = False self.hiding = False self.delname = "" self.playlistname = "" self["playlist"] = self.playlist self["PositionGauge"] = ServicePositionGauge(self.session.nav) self["currenttext"] = Label("") self["artisttext"] = Label(_("Artist")+':') self["artist"] = Label("") self["titletext"] = Label(_("Title")+':') self["title"] = Label("") self["albumtext"] = Label(_("Album")+':') self["album"] = Label("") self["yeartext"] = Label(_("Year")+':') self["year"] = Label("") self["genretext"] = Label(_("Genre")+':') self["genre"] = Label("") self["coverArt"] = MediaPixmap() self["repeat"] = MultiPixmap() self.seek_target = None try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except Exception, ex: print "[MediaPlayer] No hotplug support", ex
def __init__(self, session, service, mediatype): Screen.__init__(self, session) self.skinName = "MoviePlayer" InfoBarNotifications.__init__(self) if mediatype == 'rtl': InfoBarSeek.__init__(self) self.session = session self.service = service self.screen_timeout = 3000 self.mediatype = mediatype self.__event_tracker = ServiceEventTracker(screen = self, eventmap = { iPlayableService.evStart: self.__serviceStarted, iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, iPlayableService.evEOF: self.__evEOF, }) self["actions"] = ActionMap(["OkCancelActions", "InfobarSeekActions", "MediaPlayerActions", "MovieSelectionActions"], { "ok": self.ok, "cancel": self.leavePlayer, "stop": self.leavePlayer, "showEventInfo": self.showVideoInfo, }, -2) self.hidetimer = eTimer() self.hidetimer.timeout.get().append(self.ok) self.returning = False self.state = self.STATE_PLAYING self.lastseekstate = self.STATE_PLAYING self.onPlayStateChanged = [ ] self.play() self.onClose.append(self.__onClose)
def __init__(self, session, args=None): Screen.__init__(self, session) InfoBarAudioSelection.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap="MediaPlayerCueSheetActions") InfoBarNotifications.__init__(self) InfoBarBase.__init__(self) InfoBarScreenSaver.__init__(self) InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) self.summary = None self.oldService = self.session.nav.getCurrentlyPlayingServiceReference( ) self.session.nav.stopService() self.playlistparsers = {} self.addPlaylistParser(PlaylistIOM3U, "m3u") self.addPlaylistParser(PlaylistIOPLS, "pls") self.addPlaylistParser(PlaylistIOInternal, "e2pls") # 'None' is magic to start at the list of mountpoints defaultDir = config.mediaplayer.defaultDir.getValue() self.filelist = FileList( defaultDir, matchingPattern= "(?i)^.*\.(mp2|mp3|ogg|ts|mts|m2ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|flv|mov|dts|3gp|3g2|asf|wmv|wma)", useServiceRef=True, additionalExtensions="4098:m3u 4098:e2pls 4098:pls") self["filelist"] = self.filelist self.playlist = MyPlayList() self.is_closing = False self.delname = "" self.playlistname = "" self["playlist"] = self.playlist self["PositionGauge"] = ServicePositionGauge(self.session.nav) self["currenttext"] = Label("") self["artisttext"] = Label(_("Artist") + ':') self["artist"] = Label("") self["titletext"] = Label(_("Title") + ':') self["title"] = Label("") self["albumtext"] = Label(_("Album") + ':') self["album"] = Label("") self["yeartext"] = Label(_("Year") + ':') self["year"] = Label("") self["genretext"] = Label(_("Genre") + ':') self["genre"] = Label("") self["coverArt"] = MediaPixmap() self["repeat"] = MultiPixmap() self.seek_target = None try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except Exception, ex: print "[MediaPlayer] No hotplug support", ex
def __init__(self, session, service, cbServiceCommand, chName, chURL, chIcon): Screen.__init__(self, session) InfoBarNotifications.__init__(self) isEmpty = lambda x: x is None or len(x) == 0 or x == "None" if isEmpty(chName): chName = "Unknown" if isEmpty(chURL): chURL = "Unknown" if isEmpty(chIcon): chIcon = "default.png" chIcon = "%s/icons/%s" % (PLUGIN_PATH, chIcon) self.session = session self.service = service self.cbServiceCommand = cbServiceCommand self["actions"] = ActionMap( ["OkCancelActions", "InfobarSeekActions", "MediaPlayerActions", "MovieSelectionActions"], { "ok": self.doInfoAction, "cancel": self.doExit, "stop": self.doExit, "playpauseService": self.playpauseService, }, -2, ) self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, iPlayableService.evStart: self.__serviceStarted, iPlayableService.evEOF: self.__evEOF, }, ) self.hidetimer = eTimer() self.hidetimer.timeout.get().append(self.doInfoAction) self.state = self.PLAYER_PLAYING self.lastseekstate = self.PLAYER_PLAYING self.__seekableStatusChanged() self.onClose.append(self.__onClose) self.doPlay() self["channel_icon"] = Pixmap() self["channel_name"] = Label(chName) self["channel_uri"] = Label(chURL) self.picload = ePicLoad() self.scale = AVSwitch().getFramebufferScale() self.picload.PictureData.get().append(self.cbDrawChannelIcon) print self.scale[0] print self.scale[1] self.picload.setPara((35, 35, self.scale[0], self.scale[1], False, 0, "#00000000")) self.picload.startDecode(chIcon) self.bypassExit = False self.cbServiceCommand(("docommand", self.doCommand))
def __init__(self, session, service, cbServiceCommand, chName, chURL, chIcon): Screen.__init__(self, session) InfoBarNotifications.__init__(self) isEmpty = lambda x: x is None or len(x) == 0 or x == 'None' if isEmpty(chName): chName = 'Unknown' if isEmpty(chURL): chURL = 'Unknown' if isEmpty(chIcon): chIcon = 'default.png' chIcon = '%s/icons/%s' % (PLUGIN_PATH, chIcon) self.session = session self.service = service self.cbServiceCommand = cbServiceCommand self["actions"] = ActionMap( [ "OkCancelActions", "InfobarSeekActions", "MediaPlayerActions", "MovieSelectionActions" ], { "ok": self.doInfoAction, "cancel": self.doExit, "stop": self.doExit, "playpauseService": self.playpauseService, }, -2) self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, iPlayableService.evStart: self.__serviceStarted, iPlayableService.evEOF: self.__evEOF, }) self.hidetimer = eTimer() self.hidetimer.timeout.get().append(self.doInfoAction) self.state = self.PLAYER_PLAYING self.lastseekstate = self.PLAYER_PLAYING self.__seekableStatusChanged() self.onClose.append(self.__onClose) self.doPlay() self['channel_icon'] = Pixmap() self['channel_name'] = Label(chName) self['channel_uri'] = Label(chURL) self.picload = ePicLoad() self.scale = AVSwitch().getFramebufferScale() self.picload.PictureData.get().append(self.cbDrawChannelIcon) print self.scale[0] print self.scale[1] self.picload.setPara( (35, 35, self.scale[0], self.scale[1], False, 0, "#00000000")) self.picload.startDecode(chIcon) self.bypassExit = False self.cbServiceCommand(('docommand', self.doCommand))
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 checkNotifications(self): InfoBarNotifications.checkNotifications(self, immediate=True) pending = Notifications.notificationQueue.getPending("JobMananger") if pending: print("[JobView] have pending JobMananger Notification(s):", pending) elif self.settings.afterEvent.getValue( ) == "close" and self.job.status == self.job.FAILED: self.close(False)
def __init__(self, session, job, parent=None, cancelable=True, backgroundable=True, afterEventChangeable=True): from Components.Sources.StaticText import StaticText from Components.Sources.Progress import Progress from Components.Sources.Boolean import Boolean from Components.ActionMap import ActionMap Screen.__init__(self, session, parent) InfoBarNotifications.__init__(self) ConfigListScreen.__init__(self, []) self.parent = parent self.job = job self["pixmap"] = Pixmap() self["job_name"] = StaticText(job.name) self["job_progress"] = Progress() self["job_task"] = StaticText() self["summary_job_name"] = StaticText(job.name) self["summary_job_progress"] = Progress() self["summary_job_task"] = StaticText() self["job_status"] = StaticText() self["finished"] = Boolean() self["cancelable"] = Boolean(cancelable) self["backgroundable"] = Boolean(backgroundable) self["key_blue"] = StaticText(_("Background")) self.onShow.append(self.windowShow) self.onHide.append(self.windowHide) self["setupActions"] = ActionMap( ["ColorActions", "SetupActions"], { "green": self.ok, "red": self.abort, "blue": self.background, "cancel": self.ok, "ok": self.ok, }, -2) self.settings = ConfigSubsection() if SystemInfo["DeepstandbySupport"]: shutdownString = _("go to standby") else: shutdownString = _("shut down") self.settings.afterEvent = ConfigSelection(choices=[ ("nothing", _("do nothing")), ("close", _("Close")), ("standby", _("go to idle mode")), ("deepstandby", shutdownString) ], default=self.job.afterEvent or "nothing") self.job.afterEvent = self.settings.afterEvent.getValue() self.afterEventChangeable = afterEventChangeable self.setupList() self.state_changed()
def __init__(self, session, service, lastservice, infoCallback=None, nextCallback=None, prevCallback=None): Screen.__init__(self, session) InfoBarNotifications.__init__(self) InfoBarSeek.__init__(self) self.session = session self.service = service self.infoCallback = infoCallback self.nextCallback = nextCallback self.prevCallback = prevCallback self.screen_timeout = 5000 self.nextservice = None print "evEOF=%d" % iPlayableService.evEOF self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, iPlayableService.evStart: self.__serviceStarted, iPlayableService.evEOF: self.__evEOF, }) self["actions"] = ActionMap( [ "OkCancelActions", "InfobarSeekActions", "MediaPlayerActions", "MovieSelectionActions" ], { "ok": self.ok, "cancel": self.leavePlayer, "stop": self.leavePlayer, "playpauseService": self.playpauseService, "seekFwd": self.playNextFile, "seekBack": self.playPrevFile, "showEventInfo": self.showVideoInfo, }, -2) self.lastservice = lastservice self.hidetimer = eTimer() self.hidetimer_conn = self.hidetimer.timeout.connect(self.ok) self.returning = False self.state = self.STATE_PLAYING self.lastseekstate = self.STATE_PLAYING self.onPlayStateChanged = [] self.__seekableStatusChanged() self.play() self.onClose.append(self.__onClose)
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, 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, 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, photo, api=None, prevFunc=None, nextFunc=None): size_w = getDesktop(0).size().width() size_h = getDesktop(0).size().height() self.skin = """<screen position="0,0" size="{size_w},{size_h}" flags="wfNoBorder"> <widget name="pixmap" position="0,0" size="{size_w},{size_h}" backgroundColor="black" zPosition="2"/> <widget source="title" render="Label" position="25,20" zPosition="1" size="{labelwidth},40" valign="center" halign="left" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1"/> <widget source="summary" render="Label" position="25,60" zPosition="1" size="{labelwidth},100" valign="top" halign="left" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1"/> <widget source="keywords" render="Label" position="25,160" zPosition="1" size="{labelwidth},40" valign="center" halign="left" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1"/> <widget source="camera" render="Label" position="25,180" zPosition="1" size="{labelwidth},40" valign="center" halign="left" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1"/> </screen>""".format( size_w=size_w, size_h=size_h, labelwidth=size_w - 50 ) Screen.__init__(self, session) HelpableScreen.__init__(self) InfoBarNotifications.__init__(self) self.api = api self.page = self.PAGE_PICTURE self.prevFunc = prevFunc self.nextFunc = nextFunc self.nextPhoto = None self["pixmap"] = Pixmap() self["camera"] = StaticText() self["title"] = StaticText() self["summary"] = StaticText() self["keywords"] = StaticText() self["pictureActions"] = HelpableActionMap( self, "EcasaPictureActions", { "info": (self.info, _("show metadata")), "exit": (self.close, _("Close")), "contextMenu": (self.contextMenu, _("open context menu")), }, -1, ) if prevFunc and nextFunc: self["directionActions"] = HelpableActionMap( self, "DirectionActions", {"left": self.previous, "right": self.next}, -2 ) self.picload = ePicLoad() self.picload.PictureData.get().append(self.gotPicture) self.timer = eTimer() self.timer.callback.append(self.timerFired) # populate with data, initiate download self.reloadData(photo) self.onClose.append(self.__onClose)
def __init__(self, session, photo, api=None, prevFunc=None, nextFunc=None): size_w = getDesktop(0).size().width() size_h = getDesktop(0).size().height() self.skin = """<screen position="0,0" size="{size_w},{size_h}" flags="wfNoBorder"> <widget name="pixmap" position="0,0" size="{size_w},{size_h}" backgroundColor="black" zPosition="2"/> <widget source="title" render="Label" position="25,20" zPosition="1" size="{labelwidth},40" valign="center" halign="left" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1"/> <widget source="summary" render="Label" position="25,60" zPosition="1" size="{labelwidth},100" valign="top" halign="left" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1"/> <widget source="keywords" render="Label" position="25,160" zPosition="1" size="{labelwidth},40" valign="center" halign="left" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1"/> <widget source="camera" render="Label" position="25,180" zPosition="1" size="{labelwidth},40" valign="center" halign="left" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1"/> </screen>""".format(size_w=size_w, size_h=size_h, labelwidth=size_w - 50) Screen.__init__(self, session) HelpableScreen.__init__(self) InfoBarNotifications.__init__(self) self.api = api self.page = self.PAGE_PICTURE self.prevFunc = prevFunc self.nextFunc = nextFunc self.nextPhoto = None self['pixmap'] = Pixmap() self['camera'] = StaticText() self['title'] = StaticText() self['summary'] = StaticText() self['keywords'] = StaticText() self["pictureActions"] = HelpableActionMap( self, "EcasaPictureActions", { "info": (self.info, _("Show metadata")), "exit": (self.close, _("Close")), "contextMenu": (self.contextMenu, _("Open context menu")), }, prio=-1) if prevFunc and nextFunc: self["directionActions"] = HelpableActionMap( self, "DirectionActions", { "left": self.previous, "right": self.next, }, prio=-2) self.picload = ePicLoad() self.picload.PictureData.get().append(self.gotPicture) self.timer = eTimer() self.timer.callback.append(self.timerFired) # populate with data, initiate download self.reloadData(photo) self.onClose.append(self.__onClose)
def __init__(self, session, service, stopPlayer, chName, chURL, chIcon): Screen.__init__(self, session) InfoBarAudioSelection.__init__(self) InfoBarNotifications.__init__(self) isEmpty = lambda x: x is None or len(x) == 0 or x == 'None' if isEmpty(chName): chName = 'Unknown' if isEmpty(chURL): chURL = 'Unknown' if isEmpty(chIcon): chIcon = 'default.png' chIcon = '%s/icons/%s' % (PLUGIN_PATH, chIcon) self.session = session self.service = service self.stopPlayer = stopPlayer self.setTitle(chName) self['actions'] = ActionMap( [ 'OkCancelActions', 'InfobarSeekActions', 'MediaPlayerActions', 'MovieSelectionActions' ], { 'ok': self.doInfoAction, 'cancel': self.doExit, 'stop': self.doExit, 'playpauseService': self.playpauseService }, -2) self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, iPlayableService.evStart: self.__serviceStarted, iPlayableService.evEOF: self.__evEOF, iPlayableService.evUser + 10: self.__evAudioDecodeError, iPlayableService.evUser + 11: self.__evVideoDecodeError, iPlayableService.evUser + 12: self.__evPluginError }) self.hidetimer = eTimer() self.hidetimer.timeout.get().append(self.doInfoAction) self.state = self.PLAYER_IDLE self.__seekableStatusChanged() self.onClose.append(self.__onClose) self.doPlay() self['channel_icon'] = Pixmap() self['channel_name'] = Label(chName) self['channel_uri'] = Label(chURL) self.picload = ePicLoad() self.scale = AVSwitch().getFramebufferScale() self.picload.PictureData.get().append(self.cbDrawChannelIcon) self.picload.setPara( (35, 35, self.scale[0], self.scale[1], False, 0, '#00000000')) self.picload.startDecode(chIcon)
def __init__(self, session, job, parent = None, cancelable = True, backgroundable = True, afterEventChangeable = True): from Components.Sources.StaticText import StaticText from Components.Sources.Progress import Progress from Components.Sources.Boolean import Boolean from Components.ActionMap import ActionMap Screen.__init__(self, session, parent) InfoBarNotifications.__init__(self) ConfigListScreen.__init__(self, []) self.parent = parent self.session = session try: txt=open("/tmp/filesize").read() self.size="Size "+str(int(txt)/(1024*1024))+"MB" except: self.size="000" self.job = job self['pixmap'] = Pixmap() self['job_name'] = StaticText(job.name) self['job_progress'] = Progress() self['job_task'] = StaticText() self['summary_job_name'] = StaticText(job.name) self['summary_job_progress'] = Progress() self['summary_job_task'] = StaticText() self['job_status'] = StaticText(job.name) self['finished'] = Boolean() self['cancelable'] = Boolean(cancelable) self['cancelable'].boolean = True self['backgroundable'] = Boolean(backgroundable) self['key_blue'] = StaticText(_('Background')) self.onShow.append(self.windowShow) self.onHide.append(self.windowHide) self['setupActions'] = ActionMap(['ColorActions', 'SetupActions'], {'green': self.ok, 'red': self.abort, 'blue': self.background, 'cancel': self.ok, 'ok': self.ok}, -2) self.settings = ConfigSubsection() if SystemInfo['DeepstandbySupport']: shutdownString = _('go to standby') else: shutdownString = _('shut down') self.settings.afterEvent = ConfigSelection(choices=[('nothing', _('do nothing')), ('close', _('Close')), ('standby', _('go to idle mode')), ('deepstandby', shutdownString)], default=self.job.afterEvent or 'nothing') self.job.afterEvent = self.settings.afterEvent.getValue() self.afterEventChangeable = afterEventChangeable self.setupList() self.state_changed()
def __init__(self, session, service, stopPlayer, chName, chURL, chIcon): Screen.__init__(self, session) InfoBarAudioSelection.__init__(self) InfoBarNotifications.__init__(self) isEmpty = lambda x: x is None or len(x) == 0 or x == "None" if isEmpty(chName): chName = "Unknown" if isEmpty(chURL): chURL = "Unknown" if isEmpty(chIcon): chIcon = "default.png" chIcon = "%s/icons/%s" % (PLUGIN_PATH, chIcon) self.session = session self.service = service self.stopPlayer = stopPlayer self.setTitle(chName) self["actions"] = ActionMap(["OkCancelActions", "InfobarSeekActions", "MediaPlayerActions", "MovieSelectionActions"], { "ok": self.doInfoAction, "cancel": self.doExit, "stop": self.doExit, "playpauseService": self.playpauseService, }, -2) self.__event_tracker = ServiceEventTracker(screen = self, eventmap = { iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, iPlayableService.evStart: self.__serviceStarted, iPlayableService.evEOF: self.__evEOF, iPlayableService.evUser + 10: self.__evAudioDecodeError, iPlayableService.evUser + 11: self.__evVideoDecodeError, iPlayableService.evUser + 12: self.__evPluginError, }) self.hidetimer = eTimer() self.hidetimer.timeout.get().append(self.doInfoAction) self.state = self.PLAYER_IDLE self.__seekableStatusChanged() self.onClose.append(self.__onClose) self.doPlay() self["channel_icon"] = Pixmap() self["channel_name"] = Label(chName) self["channel_uri"] = Label(chURL) self.picload = ePicLoad() self.scale = AVSwitch().getFramebufferScale() self.picload.PictureData.get().append(self.cbDrawChannelIcon) self.picload.setPara((35, 35, self.scale[0], self.scale[1], False, 0, "#00000000")) self.picload.startDecode(chIcon)
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, stopPlayer, chName, chURL, chIcon): Screen.__init__(self, session) InfoBarAudioSelection.__init__(self) InfoBarNotifications.__init__(self) isEmpty = lambda x: x is None or len(x) == 0 or x == 'None' if isEmpty(chName): chName = 'Unknown' if isEmpty(chURL): chURL = 'Unknown' if isEmpty(chIcon): chIcon = 'default.png' chIcon = '%s/icons/%s' % (PLUGIN_PATH, chIcon) self.session = session self.service = service self.stopPlayer = stopPlayer self.setTitle(chName) self['actions'] = ActionMap(['OkCancelActions', 'InfobarSeekActions', 'MediaPlayerActions', 'MovieSelectionActions'], {'ok': self.doInfoAction, 'cancel': self.doExit, 'stop': self.doExit, 'playpauseService': self.playpauseService}, -2) self.__event_tracker = ServiceEventTracker(screen=self, eventmap={iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, iPlayableService.evStart: self.__serviceStarted, iPlayableService.evEOF: self.__evEOF, iPlayableService.evUser + 10: self.__evAudioDecodeError, iPlayableService.evUser + 11: self.__evVideoDecodeError, iPlayableService.evUser + 12: self.__evPluginError}) self.hidetimer = eTimer() self.hidetimer.timeout.get().append(self.doInfoAction) self.state = self.PLAYER_IDLE self.__seekableStatusChanged() self.onClose.append(self.__onClose) self.doPlay() self['channel_icon'] = Pixmap() self['channel_name'] = Label(chName) self['channel_uri'] = Label(chURL) self.picload = ePicLoad() self.scale = AVSwitch().getFramebufferScale() self.picload.PictureData.get().append(self.cbDrawChannelIcon) self.picload.setPara((35, 35, self.scale[0], self.scale[1], False, 0, '#00000000')) self.picload.startDecode(chIcon)
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, master): MediaGUI.__init__(self, session, master) InfoBarNotifications.__init__(self) InfoBarSeek.__init__(self) self.setTitle(_("UPnP/DLNA Audio Player")) self["artist"] = Label("") self["title"] = Label("") self["album"] = Label("") self["year"] = Label("") self["genre"] = Label("") self["coverArt"] = MediaPixmap() self.__event_tracker = ServiceEventTracker(screen=self, eventmap= { iPlayableService.evUser + 13: self["coverArt"].embeddedCoverArt })
def __init__(self, session, service, lastservice, infoCallback = None, nextCallback = None, prevCallback = None): Screen.__init__(self, session) InfoBarNotifications.__init__(self) InfoBarSeek.__init__(self) self.session = session self.service = service self.infoCallback = infoCallback self.nextCallback = nextCallback self.prevCallback = prevCallback self.screen_timeout = 5000 self.nextservice = None print "evEOF=%d" % iPlayableService.evEOF self.__event_tracker = ServiceEventTracker(screen = self, eventmap = { iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, iPlayableService.evStart: self.__serviceStarted, iPlayableService.evEOF: self.__evEOF, }) self["actions"] = ActionMap(["OkCancelActions", "InfobarSeekActions", "MediaPlayerActions", "MovieSelectionActions"], { "ok": self.ok, "cancel": self.leavePlayer, "stop": self.leavePlayer, "playpauseService": self.playpauseService, "seekFwd": self.playNextFile, "seekBack": self.playPrevFile, "showEventInfo": self.showVideoInfo, }, -2) self.lastservice = lastservice self.hidetimer = eTimer() self.hidetimer_conn = self.hidetimer.timeout.connect(self.ok) self.returning = False self.state = self.STATE_PLAYING self.lastseekstate = self.STATE_PLAYING self.onPlayStateChanged = [ ] self.__seekableStatusChanged() self.play() self.onClose.append(self.__onClose)
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, xmlnode, args=0): self.xmlnode = xmlnode screen_x = 736 screen_y = 576 size_x = 350 size_y = 250 pos_x = (screen_x / 2) - (size_x / 2) pos_y = (screen_y / 2) - (size_y / 2) skin = """ <screen position="%i,%i" size="%i,%i" title="%s"> <widget name="menu" position="1,1" size="%i,%i" scrollbarMode="showOnDemand"/> </screen>""" % (pos_x, pos_y, size_x, size_y, myname, size_x, size_y) self.skin = skin Screen.__init__(self, session) InfoBarNotifications.__init__(self) self.filelist = List(self.getMenuData()) self["menu"] = self.filelist self["actions"] = ActionMap(["WizardActions", "DirectionActions"], { "ok": self.go, "back": self.close, }, -1) self.onLayoutFinish.append(self.settingTitle)
def __init__(self, session, name, url): Screen.__init__(self, session) self.skinName = 'MoviePlayer' title = 'Play Stream' self['list'] = MenuList([]) InfoBarMenu.__init__(self) InfoBarNotifications.__init__(self) InfoBarBase.__init__(self, steal_current_service=True) TvInfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) # InfoBarSubtitleSupport.__init__(self) self['actions'] = ActionMap( [ 'WizardActions', 'MoviePlayerActions', 'MovieSelectionActions', 'MediaPlayerActions', 'EPGSelectActions', 'MediaPlayerSeekActions', 'SetupActions', 'ColorActions', 'InfobarShowHideActions', 'InfobarActions', 'InfobarSeekActions' ], { 'leavePlayer': self.cancel, 'epg': self.showIMDB, 'info': self.showIMDB, 'stop': self.leavePlayer, 'cancel': self.cancel, 'back': self.cancel }, -1) self.allowPiP = False self.service = None service = None InfoBarSeek.__init__(self, actionmap='InfobarSeekActions') url = url.replace(':', '%3a') self.url = url self.name = name # self.srefOld = self.session.nav.getCurrentlyPlayingServiceReference() self.state = self.STATE_PLAYING self.onLayoutFinish.append(self.openPlay) self.onClose.append(self.cancel)
def __init__(self, session,xmlnode, args = 0): self.xmlnode = xmlnode screen_x = 736 screen_y = 576 size_x = 350 size_y = 250 pos_x = (screen_x/2)-(size_x/2) pos_y = (screen_y/2)-(size_y/2) skin = """ <screen position="%i,%i" size="%i,%i" title="%s"> <widget name="menu" position="1,1" size="%i,%i" scrollbarMode="showOnDemand"/> </screen>""" % (pos_x,pos_y,size_x,size_y,myname,size_x,size_y) self.skin = skin Screen.__init__(self, session) InfoBarNotifications.__init__(self) self.filelist = List(self.getMenuData()) self["menu"] = self.filelist self["actions"] = ActionMap(["WizardActions", "DirectionActions"], { "ok": self.go, "back": self.close, }, -1) self.onLayoutFinish.append(self.settingTitle)
def __init__(self, session, args = None): Screen.__init__(self, session) InfoBarAudioSelection.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions") InfoBarNotifications.__init__(self) InfoBarBase.__init__(self) InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) self.summary = None self.oldService = self.session.nav.getCurrentlyPlayingServiceReference() self.session.nav.stopService() self.playlistparsers = {} self.addPlaylistParser(PlaylistIOM3U, "m3u") self.addPlaylistParser(PlaylistIOPLS, "pls") self.addPlaylistParser(PlaylistIOInternal, "e2pls") # 'None' is magic to start at the list of mountpoints defaultDir = config.mediaplayer.defaultDir.getValue() self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|mov)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls") self["filelist"] = self.filelist self.playlist = MyPlayList() self.is_closing = False self.delname = "" self["playlist"] = self.playlist self["PositionGauge"] = ServicePositionGauge(self.session.nav) self["currenttext"] = Label("") self["artisttext"] = Label(_("Artist")+':') self["artist"] = Label("") self["titletext"] = Label(_("Title")+':') self["title"] = Label("") self["albumtext"] = Label(_("Album")+':') self["album"] = Label("") self["yeartext"] = Label(_("Year")+':') self["year"] = Label("") self["genretext"] = Label(_("Genre")+':') self["genre"] = Label("") self["coverArt"] = MediaPixmap() self["repeat"] = MultiPixmap() self.seek_target = None from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) class MoviePlayerActionMap(NumberActionMap): def __init__(self, player, contexts = [ ], actions = { }, prio=0): NumberActionMap.__init__(self, contexts, actions, prio) self.player = player def action(self, contexts, action): self.player.show() return NumberActionMap.action(self, contexts, action) self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", { "ok": (self.ok, _("add file to playlist")), "cancel": (self.exit, _("exit mediaplayer")), }, -2) self["MediaPlayerActions"] = HelpableActionMap(self, "MediaPlayerActions", { "play": (self.xplayEntry, _("play entry")), "pause": (self.pauseEntry, _("pause")), "stop": (self.stopEntry, _("stop entry")), "previous": (self.previousMarkOrEntry, _("play from previous mark or playlist entry")), "next": (self.nextMarkOrEntry, _("play from next mark or playlist entry")), "menu": (self.showMenu, _("menu")), "skipListbegin": (self.skip_listbegin, _("jump to listbegin")), "skipListend": (self.skip_listend, _("jump to listend")), "prevBouquet": (self.switchToPlayList, _("switch to playlist")), "nextBouquet": (self.switchToFileList, _("switch to filelist")), "delete": (self.deletePlaylistEntry, _("delete playlist entry")), "shift_stop": (self.clear_playlist, _("clear playlist")), "shift_record": (self.playlist.PlayListShuffle, _("shuffle playlist")), "subtitles": (self.subtitleSelection, _("Subtitle selection")), }, -2) self["InfobarEPGActions"] = HelpableActionMap(self, "InfobarEPGActions", { "showEventInfo": (self.showEventInformation, _("show event details")), }) self["actions"] = MoviePlayerActionMap(self, ["DirectionActions"], { "right": self.rightDown, "rightRepeated": self.doNothing, "rightUp": self.rightUp, "left": self.leftDown, "leftRepeated": self.doNothing, "leftUp": self.leftUp, "up": self.up, "upRepeated": self.up, "upUp": self.doNothing, "down": self.down, "downRepeated": self.down, "downUp": self.doNothing, }, -2) InfoBarSeek.__init__(self, actionmap = "MediaPlayerSeekActions") self.onClose.append(self.delMPTimer) self.onClose.append(self.__onClose) self.righttimer = False self.rightKeyTimer = eTimer() self.rightKeyTimer.callback.append(self.rightTimerFire) self.lefttimer = False self.leftKeyTimer = eTimer() self.leftKeyTimer.callback.append(self.leftTimerFire) self.currList = "filelist" self.isAudioCD = False self.AudioCD_albuminfo = {} self.cdAudioTrackFiles = [] self.onShown.append(self.applySettings) self.playlistIOInternal = PlaylistIOInternal() list = self.playlistIOInternal.open(resolveFilename(SCOPE_CONFIG, "playlist.e2pls")) if list: for x in list: self.playlist.addFile(x.ref) self.playlist.updateList() self.__event_tracker = ServiceEventTracker(screen=self, eventmap= { iPlayableService.evUpdatedInfo: self.__evUpdatedInfo, iPlayableService.evUser+10: self.__evAudioDecodeError, iPlayableService.evUser+11: self.__evVideoDecodeError, iPlayableService.evUser+12: self.__evPluginError, iPlayableService.evUser+13: self["coverArt"].embeddedCoverArt })
def __init__(self, session): Screen.__init__(self, session) HelpableScreen.__init__(self) InfoBarNotifications.__init__(self) self.ftpclient = None self.queueManagerInstance = None self.file = None self.queue = None self.currlist = "local" # # NOTE: having self.checkNotifications in onExecBegin might make our gui # disappear, so let's move it to onShow self.onExecBegin.remove(self.checkNotifications) self.onShow.append(self.checkNotifications) # Init what we need for dl progress self.currentLength = 0 self.lastLength = 0 self.lastTime = 0 self.lastApprox = 0 self.fileSize = 0 self["localText"] = StaticText(_("Local")) self["local"] = FileList("/media/hdd/", showMountpoints=False) self["remoteText"] = StaticText(_("Remote (not connected)")) self["remote"] = FTPFileList() self["eta"] = StaticText("") self["speed"] = StaticText("") self["progress"] = VariableProgressSource() self["key_red"] = StaticText(_("Exit")) self["key_green"] = StaticText(_("Rename")) self["key_yellow"] = StaticText(_("Delete")) self["key_blue"] = StaticText(_("Upload")) self.server = None self["ftpbrowserBaseActions"] = HelpableActionMap( self, "ftpbrowserBaseActions", { "ok": (self.ok, _("enter directory/get file/put file")), "cancel": (self.cancel, _("close")), "menu": (self.menu, _("open menu")), }, -2) self["ftpbrowserListActions"] = HelpableActionMap( self, "ftpbrowserListActions", { "channelUp": (self.setLocal, _("Select local file list")), "channelDown": (self.setRemote, _("Select remote file list")), }) self["actions"] = ActionMap( ["ftpbrowserDirectionActions", "ColorActions"], { "up": self.up, "down": self.down, "left": self.left, "right": self.right, "green": self.rename, "yellow": self.delete, "blue": self.transfer, }, -2) self.onExecBegin.append(self.reinitialize)
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, playlist): PlaylistPlayer.__init__(self, session, "audio", MediaCore.TYPE_AUDIO) InfoBarNotifications.__init__(self) self._playlist = None self._initPlaylist(config.plugins.mediacenter.audio.last_playlist_id.value) self.seekState = self.SEEK_STATE_IDLE self._repeat = Playlist.REPEAT_NONE self._browser = None self["artisttext"] = Label(_("Artist") + ':') self["artist"] = Label("") self["titletext"] = Label(_("Title") + ':') self["title"] = Label("") self["albumtext"] = Label(_("Album") + ':') self["album"] = Label("") self["yeartext"] = Label(_("Year") + ':') self["year"] = Label("") self["genretext"] = Label(_("Genre") + ':') self["genre"] = Label("") self["coverArt"] = MediaPixmap() self["coverBack"] = MediaPixmap() self["red"] = Label(_("Remove")) self["green"] = Label(_("Add")) self["yellow"] = Label(_("Shuffle - Off")) self["blue"] = Label(_("Repeat - None")) self._summary_list = StaticText("") self["summary_list"] = self._summary_list self.__event_tracker = ServiceEventTracker(screen=self, eventmap= { iPlayableService.evUpdatedInfo: self._evUpdatedInfo, iPlayableService.evEOF: self._evEOF, iPlayableService.evUser + 10: self._evAudioDecodeError, iPlayableService.evUser + 11: self._evVideoDecodeError, iPlayableService.evUser + 12: self._evPluginError, iPlayableService.evUser + 13: self._embeddedCoverArt, }) self["MediaCenterActions"] = HelpableActionMap(self, "MediaCenterActions", { "menu" : (self._showMenu, _("Open Menu")), "ok" : (self.play, _("Play Selected Entry")), "cancel" : (self._close, _("Close MediaCenter Audioplayer")), "red" : (self._removeSelectedPlaylistEntry, _("Remove Selected Entry From Playlist")), "green" : (self.editPlaylist, _("Add file(s) to Playlist")), "yellow" : (self._toggleShuffle, _("Toggle Shuffle")), "blue" : (self._toggleRepeat, _("Toggle Repeat-Modes (None / All / Single)")), "playpause": (self.playpause, _("Play/Pause")), "stop": (self.stop, _("Stop Playback")), "next": (self.playNext, _("Play Next Entry")), "previous": (self.playPrev, _("Play Previous Entry")), "moveUp": self._moveUp, "moveDown" : self._moveDown, "pageUp": self._pageUp, "pageDown": self._pageDown, "channelUp": (self._moveSelectedUp, _("Move selected item up")), "channelDown": (self._moveSelectedDown, _("Move selected item down")), }, -2); if playlist != None: self.addAllToPlaylist(playlist)
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, *args, **kwargs): OriginalPluginBrowser.__init__(self, *args, **kwargs) if self.skinName == "NotifiablePluginBrowser": self.skinName = "PluginBrowser" InfoBarNotifications.__init__(self)
def __init__(self, session): Screen.__init__(self, session) HelpableScreen.__init__(self) InfoBarNotifications.__init__(self) self.ftpclient = None self.queueManagerInstance = None self.file = None self.queue = None self.currlist = "local" # # NOTE: having self.checkNotifications in onExecBegin might make our gui # disappear, so let's move it to onShow self.onExecBegin.remove(self.checkNotifications) self.onShow.append(self.checkNotifications) # Init what we need for dl progress self.currentLength = 0 self.lastLength = 0 self.lastTime = 0 self.lastApprox = 0 self.fileSize = 0 self["localText"] = StaticText(_("Local")) self["local"] = FileList("/media/hdd/", showMountpoints = False) self["remoteText"] = StaticText(_("Remote (not connected)")) self["remote"] = FTPFileList() self["eta"] = StaticText("") self["speed"] = StaticText("") self["progress"] = VariableProgressSource() self["key_red"] = StaticText(_("Exit")) self["key_green"] = StaticText(_("Rename")) self["key_yellow"] = StaticText(_("Delete")) self["key_blue"] = StaticText(_("Upload")) self.server = None self["ftpbrowserBaseActions"] = HelpableActionMap(self, "ftpbrowserBaseActions", { "ok": (self.ok, _("enter directory/get file/put file")), "cancel": (self.cancel , _("close")), "menu": (self.menu, _("open menu")), }, -2) self["ftpbrowserListActions"] = HelpableActionMap(self, "ftpbrowserListActions", { "channelUp": (self.setLocal, _("Select local file list")), "channelDown": (self.setRemote, _("Select remote file list")), }) self["actions"] = ActionMap(["ftpbrowserDirectionActions", "ColorActions"], { "up": self.up, "down": self.down, "left": self.left, "right": self.right, "green": self.rename, "yellow": self.delete, "blue": self.transfer, }, -2) self.onExecBegin.append(self.reinitialize)
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, *args, **kwargs): OriginalPluginBrowser.__init__(self, *args, **kwargs) #if self.skinName in ("NotifiablePluginBrowser", "OriginalPluginBrowser"): # self.skinName = "PluginBrowser" InfoBarNotifications.__init__(self)
def __init__(self, session, args = None): Screen.__init__(self, session) InfoBarAudioSelection.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions") InfoBarNotifications.__init__(self) InfoBarBase.__init__(self) InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) self.summary = None self.oldService = self.session.nav.getCurrentlyPlayingServiceReference() self.session.nav.stopService() self.playlistparsers = {} self.addPlaylistParser(PlaylistIOM3U, "m3u") self.addPlaylistParser(PlaylistIOPLS, "pls") self.addPlaylistParser(PlaylistIOInternal, "e2pls") # 'None' is magic to start at the list of mountpoints defaultDir = config.mediaplayer.defaultDir.getValue() self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|mov|m2ts|flv|dts|3gp|3g2|mts|wmv|asf|wma)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls") self["filelist"] = self.filelist self.playlist = MyPlayList() self.is_closing = False self.delname = "" self["playlist"] = self.playlist self["PositionGauge"] = ServicePositionGauge(self.session.nav) self["currenttext"] = Label("") self["artisttext"] = Label(_("Artist")+':') self["artist"] = Label("") self["titletext"] = Label(_("Title")+':') self["title"] = Label("") self["albumtext"] = Label(_("Album")+':') self["album"] = Label("") self["yeartext"] = Label(_("Year")+':') self["year"] = Label("") self["genretext"] = Label(_("Genre")+':') self["genre"] = Label("") self["coverArt"] = MediaPixmap() self["repeat"] = MultiPixmap() self.seek_target = None # ikseong # from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier # hotplugNotifier.append(self.hotplugCB) class MoviePlayerActionMap(NumberActionMap): def __init__(self, player, contexts = [ ], actions = { }, prio=0): NumberActionMap.__init__(self, contexts, actions, prio) self.player = player def action(self, contexts, action): self.player.show() return NumberActionMap.action(self, contexts, action) self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", { "ok": (self.ok, _("add file to playlist")), "cancel": (self.exit, _("exit mediaplayer")), }, -2) self["MediaPlayerActions"] = HelpableActionMap(self, "MediaPlayerActions", { "play": (self.xplayEntry, _("play entry")), "pause": (self.pauseEntry, _("pause")), "stop": (self.stopEntry, _("stop entry")), "previous": (self.previousMarkOrEntry, _("play from previous mark or playlist entry")), "next": (self.nextMarkOrEntry, _("play from next mark or playlist entry")), "menu": (self.showMenu, _("menu")), "skipListbegin": (self.skip_listbegin, _("jump to listbegin")), "skipListend": (self.skip_listend, _("jump to listend")), "prevBouquet": (self.switchToPlayList, _("switch to playlist")), "nextBouquet": (self.switchToFileList, _("switch to filelist")), "delete": (self.deletePlaylistEntry, _("delete playlist entry")), #ikseong # "shift_stop": (self.clear_playlist, _("clear playlist")), # "shift_record": (self.playlist.PlayListShuffle, _("shuffle playlist")), "shift_stop": self.clear_playlist, "shift_record": self.playlist.PlayListShuffle, "subtitles": (self.subtitleSelection, _("Subtitle selection")), }, -2) self["InfobarEPGActions"] = HelpableActionMap(self, "InfobarEPGActions", { "showEventInfo": (self.showEventInformation, _("show event details")), }) self["actions"] = MoviePlayerActionMap(self, ["DirectionActions"], { "right": self.rightDown, "rightRepeated": self.doNothing, "rightUp": self.rightUp, "left": self.leftDown, "leftRepeated": self.doNothing, "leftUp": self.leftUp, "up": self.up, "upRepeated": self.up, "upUp": self.doNothing, "down": self.down, "downRepeated": self.down, "downUp": self.doNothing, }, -2) InfoBarSeek.__init__(self, actionmap = "MediaPlayerSeekActions") self.onClose.append(self.delMPTimer) self.onClose.append(self.__onClose) self.righttimer = False self.rightKeyTimer = eTimer() self.rightKeyTimer.callback.append(self.rightTimerFire) self.lefttimer = False self.leftKeyTimer = eTimer() self.leftKeyTimer.callback.append(self.leftTimerFire) self.currList = "filelist" self.isAudioCD = False self.AudioCD_albuminfo = {} self.cdAudioTrackFiles = [] self.onShown.append(self.applySettings) self.playlistIOInternal = PlaylistIOInternal() list = self.playlistIOInternal.open(resolveFilename(SCOPE_CONFIG, "playlist.e2pls")) if list: for x in list: self.playlist.addFile(x.ref) self.playlist.updateList() self.__event_tracker = ServiceEventTracker(screen=self, eventmap= { iPlayableService.evUpdatedInfo: self.__evUpdatedInfo, iPlayableService.evUser+10: self.__evAudioDecodeError, iPlayableService.evUser+11: self.__evVideoDecodeError, iPlayableService.evUser+12: self.__evPluginError, iPlayableService.evUser+13: self["coverArt"].embeddedCoverArt })
def __init__(self, session, server, currentList): Screen.__init__(self, session) InfoBarNotifications.__init__(self) InfoBarAudioSelection.__init__(self) self.server = server self.currentList = currentList self.skinName = "MoviePlayer" self.state = self.STATE_IDLE self.oldservice = self.session.screen["CurrentService"] self.oldNavService = self.session.nav.getCurrentlyPlayingServiceReference() self.session.nav.stopService() self.vlcservice = VlcService(self) self.session.screen["CurrentService"] = self.vlcservice self.hidetimer = eTimer() self.hidetimer.timeout.get().append(self.ok) self.onClose.append(self.__onClose) class VlcPlayerActionMap(ActionMap): def __init__(self, player, contexts = [ ], actions = { }, prio=0): ActionMap.__init__(self, contexts, actions, prio) self.player = player def action(self, contexts, action): if action[:5] == "seek:": time = int(action[5:]) self.player.seekRelative(time) return 1 elif action[:8] == "seekdef:": key = int(action[8:]) time = [-config.seek.selfdefined_13.value, False, config.seek.selfdefined_13.value, -config.seek.selfdefined_46.value, False, config.seek.selfdefined_46.value, -config.seek.selfdefined_79.value, False, config.seek.selfdefined_79.value][key-1] self.player.seekRelative(time) return 1 else: return ActionMap.action(self, contexts, action) self["actions"] = VlcPlayerActionMap(self, ["OkCancelActions", "TvRadioActions", "InfobarSeekActions", "MediaPlayerActions"], { "ok": self.ok, "cancel": self.stop, "keyTV": self.stop, "pauseService": self.pause, "unPauseService": self.play, "play": self.play, "seekFwd": self.seekFwd, "seekBack": self.seekBack, "seekFwdDown": self.seekFwd, "seekBackDown": self.seekBack, "seekFwdManual": self.seekManual, "seekBackManual": self.seekManual, "next": self.playNextFile, "previous": self.playPrevFile }, -2) print "[VLC] evEOF=%d" % iPlayableService.evEOF self.__event_tracker = ServiceEventTracker(screen = self, eventmap = { iPlayableService.evEOF: self.__evEOF, iPlayableService.evSOF: self.__evSOF })
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, mrl, title, currentList, contextMenuEntries, infoCallback, name): Screen.__init__(self, session) InfoBarNotifications.__init__(self) self.contextMenuEntries = contextMenuEntries self.infoCallback = infoCallback self.name = name self.skinName = "MoviePlayer" self.session = session self.service = eServiceReference(4097, 0, mrl) self.service.setName(title) self.currentList = currentList self.infoCallback = infoCallback self.screen_timeout = 5000 class DirectYouTubePlayerActionMap(ActionMap): def __init__(self, player, contexts=[], actions={}, prio=0): ActionMap.__init__(self, contexts, actions, prio) self.player = player def action(self, contexts, action): if action[:5] == "seek:": time = int(action[5:]) self.player.seekRelative(time * 90000) return 1 elif action[:8] == "seekdef:": key = int(action[8:]) time = [ -config.seek.selfdefined_13.value, False, config.seek.selfdefined_13.value, -config.seek.selfdefined_46.value, False, config.seek.selfdefined_46.value, -config.seek.selfdefined_79.value, False, config.seek.selfdefined_79.value ][key - 1] self.player.seekRelative(time * 90000) return 1 else: return ActionMap.action(self, contexts, action) self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, iPlayableService.evStart: self.__serviceStarted, iPlayableService.evEOF: self.__evEOF }) self["actions"] = DirectYouTubePlayerActionMap( self, [ "OkCancelActions", "TvRadioActions", "InfobarSeekActions", "MediaPlayerActions", "YouTubePlayerScreenActions" ], { "ok": self.ok, "cancel": self.close, "keyTV": self.close, "pauseService": self.playpauseService, "unPauseService": self.playpauseService, "play": self.play, # "seekFwd": self.seekFwd, # "seekBack": self.seekBack, # "seekFwdDown": self.seekFwd, # "seekBackDown": self.seekBack, # "seekFwdManual": self.seekManual, # "seekBackManual": self.seekManual, "next": self.playNextFile, "previous": self.playPrevFile, "menu": self.openContextMenu, "info": self.showVideoInfo, }, -2) self.oldservice = self.session.screen["CurrentService"] self.oldNavService = session.nav.getCurrentlyPlayingServiceReference() self.hidetimer = eTimer() self.hidetimer.timeout.get().append(self.ok) self.returning = False self.state = self.STATE_PLAYING self.lastseekstate = self.STATE_PLAYING self.onPlayStateChanged = [] self.__seekableStatusChanged() self.onClose.append(self.__onClose) self.play()
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 __init__(self, session, mrl, title, currentList, contextMenuEntries, infoCallback, name): Screen.__init__(self, session) InfoBarNotifications.__init__(self) self.contextMenuEntries = contextMenuEntries self.infoCallback = infoCallback self.name = name self.skinName = "MoviePlayer" self.session = session self.service = eServiceReference(4097, 0, mrl) self.service.setName(title) self.currentList = currentList self.infoCallback = infoCallback self.screen_timeout = 5000 class DirectYouTubePlayerActionMap(ActionMap): def __init__(self, player, contexts = [ ], actions = { }, prio=0): ActionMap.__init__(self, contexts, actions, prio) self.player = player def action(self, contexts, action): if action[:5] == "seek:": time = int(action[5:]) self.player.seekRelative(time * 90000) return 1 elif action[:8] == "seekdef:": key = int(action[8:]) time = [-config.seek.selfdefined_13.value, False, config.seek.selfdefined_13.value, -config.seek.selfdefined_46.value, False, config.seek.selfdefined_46.value, -config.seek.selfdefined_79.value, False, config.seek.selfdefined_79.value][key-1] self.player.seekRelative(time * 90000) return 1 else: return ActionMap.action(self, contexts, action) self.__event_tracker = ServiceEventTracker(screen = self, eventmap = { iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged, iPlayableService.evStart: self.__serviceStarted, iPlayableService.evEOF: self.__evEOF }) self["actions"] = DirectYouTubePlayerActionMap(self, ["OkCancelActions", "TvRadioActions", "InfobarSeekActions", "MediaPlayerActions", "YouTubePlayerScreenActions"], { "ok": self.ok, "cancel": self.close, "keyTV": self.close, "pauseService": self.playpauseService, "unPauseService": self.playpauseService, "play": self.play, # "seekFwd": self.seekFwd, # "seekBack": self.seekBack, # "seekFwdDown": self.seekFwd, # "seekBackDown": self.seekBack, # "seekFwdManual": self.seekManual, # "seekBackManual": self.seekManual, "next": self.playNextFile, "previous": self.playPrevFile, "menu" : self.openContextMenu, "info" : self.showVideoInfo, }, -2) self.oldservice = self.session.screen["CurrentService"] self.oldNavService = session.nav.getCurrentlyPlayingServiceReference() self.hidetimer = eTimer() self.hidetimer_conn = self.hidetimer.timeout.connect(self.ok) self.returning = False self.state = self.STATE_PLAYING self.lastseekstate = self.STATE_PLAYING self.onPlayStateChanged = [ ] self.__seekableStatusChanged() self.onClose.append(self.__onClose) self.play()
def __init__(self, session): Screen.__init__(self, session) HelpableScreen.__init__(self) InfoBarNotifications.__init__(self) InfoBarBase.__init__(self) InfoBarSeek.__init__(self, actionmap="MediaPlayerSeekActions") self.isVisible = True self.oldService = self.session.nav.getCurrentlyPlayingServiceReference() self.session.nav.stopService() self.playlistparsers = {} self.addPlaylistParser(PlaylistIOM3U, "m3u") self.playlist = MyPlayList() self["fileinfo"] = Label() self["key_red"] = Button(_("Delete")) self["key_green"] = Button(_("")) self["key_yellow"] = Button("Favorites") self["key_blue"] = Button(_("Settings")) self["currentfolder"] = Label("") self["currentfavname"] = Label("") self.currList = "filelist" self.curfavfolder = -1 self["actions"] = HelpableActionMap( self, "EVOMC_VideoPlayerActions", { "ok": (self.KeyOk, "Play selected file"), "left": (self.leftUp, "List Top"), "right": (self.rightDown, "List Bottom"), "up": (self.up, "List up"), "down": (self.down, "List down"), "menu": (self.KeyMenu, "File / Folder Options"), "video": (self.visibility, "Show / Hide Player"), "nextBouquet": (self.NextFavFolder, "Next Favorite Folder"), "prevBouquet": (self.PrevFavFolder, "Previous Favorite Folder"), "stop": (self.StopPlayback, "Stop Playback"), "red": (self.deleteFile, "Delete File"), "yellow": (self.FavoriteFolders, "Favorite Folders"), # "green": (self.showPreview, "Preview"), "blue": (self.KeySettings, "Settings"), }, -2, ) self["InfobarShowHideActions"] = HelpableActionMap( self, "InfobarShowHideActions", {"toggleShow": (self.showFileInfo, "Show File Info")}, -2 ) self["OkCancelActions"] = HelpableActionMap( self, "OkCancelActions", {"cancel": (self.Exit, "Exit Video Player")}, -2 ) self.aspect = getAspect() currDir = config.plugins.EVOMC_vp.lastDir.value if not pathExists(currDir): currDir = "/" self["currentfolder"].setText(str(currDir)) if pathExists("/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer") is True: self.filelist = FileList( currDir, useServiceRef=True, showDirectories=True, showFiles=True, matchingPattern="(?i)^.*\.(mp4|ts|trp|wmv|mpg|vob|avi|mkv|dat|flac|m2ts|trp|flv)", ) else: self.filelist = FileList( currDir, useServiceRef=True, showDirectories=True, showFiles=True, matchingPattern="(?i)^.*\.(mp4|ts|trp|wmv|mpg|vob|avi|mkv|dat|flac|m2ts|trp|flv)", ) self["filelist"] = self.filelist self["thumbnail"] = Pixmap() evfd.getInstance().vfd_write_string("EVO-VIDEOPLAYER") # self.filelist.refresh() # self.ThumbTimer = eTimer() # self.ThumbTimer.callback.append(self.showThumb) # self.ThumbTimer.start(config.plugins.EVOMC_vp.preview_delay.getValue() * 1000, True) # self.filelistTimer = eTimer() # self.filelistTimer.callback.append(self.filelist.refresh()) # self.filelistTimer.start(60, True) self.DimmerTimer = eTimer() self.DimmerTimer.callback.append(self.showDimmer) self.DimmerTimer.start(config.plugins.EVOMC_all.dimmer_delay.getValue() * 1000, True) self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evUser + 11: self.__evDecodeError, iPlayableService.evUser + 12: self.__evPluginError, }, )
def checkNotifications(self): InfoBarNotifications.checkNotifications(self) if not Notifications.notifications: if self.settings.afterEvent.value == "close" and self.job.status == self.job.FAILED: self.close(False)
def __init__(self, session, args = None): Screen.__init__(self, session) InfoBarAudioSelection.__init__(self) InfoBarAspectSelection.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions") InfoBarNotifications.__init__(self) InfoBarBase.__init__(self) InfoBarScreenSaver.__init__(self) InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) self.summary = None self.oldService = self.session.nav.getCurrentlyPlayingServiceOrGroup() self.session.nav.stopService() self.setTitle(_("Media player")) self.playlistparsers = {} self.addPlaylistParser(PlaylistIOM3U, "m3u") self.addPlaylistParser(PlaylistIOPLS, "pls") self.addPlaylistParser(PlaylistIOInternal, "e2pls") # 'None' is magic to start at the list of mountpoints defaultDir = config.mediaplayer.defaultDir.getValue() self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(dts|mp3|wav|wave|wv|oga|ogg|flac|m4a|mp2|m2a|wma|ac3|mka|aac|ape|alac|mpg|vob|m4v|mkv|avi|divx|dat|flv|mp4|mov|wmv|asf|3gp|3g2|mpeg|mpe|rm|rmvb|ogm|ogv|m2ts|mts|ts|m3u|e2pls|pls|amr|au|mid|pva|wtv)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls") self["filelist"] = self.filelist self.playlist = MyPlayList() self.is_closing = False self.delname = "" self.playlistname = "" self["playlist"] = self.playlist self["PositionGauge"] = ServicePositionGauge(self.session.nav) self["currenttext"] = Label("") self["artisttext"] = Label(_("Artist")+':') self["artist"] = Label("") self["titletext"] = Label(_("Title")+':') self["title"] = Label("") self["albumtext"] = Label(_("Album")+':') self["album"] = Label("") self["yeartext"] = Label(_("Year")+':') self["year"] = Label("") self["genretext"] = Label(_("Genre")+':') self["genre"] = Label("") self["coverArt"] = MediaPixmap() self["repeat"] = MultiPixmap() self.seek_target = None try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except Exception as ex: print("[MediaPlayer] No hotplug support", ex) class MoviePlayerActionMap(NumberActionMap): def __init__(self, player, contexts = [ ], actions = { }, prio=0): NumberActionMap.__init__(self, contexts, actions, prio) self.player = player def action(self, contexts, action): self.player.show() return NumberActionMap.action(self, contexts, action) self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", { "ok": (self.ok, _("Add file to playlist")), "cancel": (self.exit, _("Exit mediaplayer")), }, -2) self["MediaPlayerActions"] = HelpableActionMap(self, "MediaPlayerActions", { "play": (self.xplayEntry, _("Play entry")), "pause": (self.pauseEntry, _("Pause")), "stop": (self.stopEntry, _("Stop entry")), "previous": (self.previousMarkOrEntry, _("Play from previous mark or playlist entry")), "next": (self.nextMarkOrEntry, _("Play from next mark or playlist entry")), "menu": (self.showMenu, _("Menu")), "skipListbegin": (self.skip_listbegin, _("Jump to beginning of list")), "skipListend": (self.skip_listend, _("Jump to end of list")), "prevBouquet": (self.prevBouquet, self.prevBouquetHelpText), "nextBouquet": (self.nextBouquet, self.nextBouquetHelptext), "delete": (self.deletePlaylistEntry, _("Delete playlist entry")), "shift_stop": (self.clear_playlist, _("Clear playlist")), "shift_record": (self.playlist.PlayListShuffle, _("Shuffle playlist")), "subtitles": (self.subtitleSelection, _("Subtitle selection")), }, -2) self["InfobarEPGActions"] = HelpableActionMap(self, "InfobarEPGActions", { "showEventInfo": (self.showEventInformation, _("show event details")), }) self["actions"] = MoviePlayerActionMap(self, ["DirectionActions"], { "right": self.rightDown, "rightRepeated": self.doNothing, "rightUp": self.rightUp, "left": self.leftDown, "leftRepeated": self.doNothing, "leftUp": self.leftUp, "up": self.up, "upRepeated": self.up, "upUp": self.doNothing, "down": self.down, "downRepeated": self.down, "downUp": self.doNothing, }, -2) InfoBarSeek.__init__(self, actionmap = "MediaPlayerSeekActions") self.mediaPlayerInfoBar = self.session.instantiateDialog(MediaPlayerInfoBar) self.onClose.append(self.delMPTimer) self.onClose.append(self.__onClose) self.onShow.append(self.timerHideMediaPlayerInfoBar) self.righttimer = False self.rightKeyTimer = eTimer() self.rightKeyTimer.callback.append(self.rightTimerFire) self.lefttimer = False self.leftKeyTimer = eTimer() self.leftKeyTimer.callback.append(self.leftTimerFire) self.hideMediaPlayerInfoBar = eTimer() self.hideMediaPlayerInfoBar.callback.append(self.timerHideMediaPlayerInfoBar) self.currList = "filelist" self.isAudioCD = False self.ext = None self.AudioCD_albuminfo = {} self.cdAudioTrackFiles = [] self.onShown.append(self.applySettings) self.playlistIOInternal = PlaylistIOInternal() list = self.playlistIOInternal.open(resolveFilename(SCOPE_CONFIG, "playlist.e2pls")) if list: for x in list: self.playlist.addFile(x.ref) self.playlist.updateList() self.__event_tracker = ServiceEventTracker(screen=self, eventmap= { iPlayableService.evUpdatedInfo: self.__evUpdatedInfo, iPlayableService.evUser+10: self.__evAudioDecodeError, iPlayableService.evUser+11: self.__evVideoDecodeError, iPlayableService.evUser+12: self.__evPluginError, iPlayableService.evUser+13: self["coverArt"].embeddedCoverArt }) self.servicelist = None self.pipZapAvailable = False if InfoBar.instance is not None: self.servicelist = InfoBar.instance.servicelist if self.servicelist and hasattr(self.servicelist, 'dopipzap'): self.pipZapAvailable = SystemInfo.get("NumVideoDecoders", 1) > 1
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