def dmesg_cleared(self, answer): self.container.appClosed.remove(self.dmesg_cleared) self.msgbox = self.session.open( MessageBox, _("Please disconnect all USB devices from your Dreambox and (re-)attach the target USB stick (minimum size is 64 MB) now!" ), MessageBox.TYPE_INFO) hotplugNotifier.append(self.hotplugCB)
def __init__(self, session): Screen.__init__(self, session) self["key_red"] = StaticText(_("Exit")) self["key_green"] = StaticText(_("Update")) self["key_yellow"] = StaticText() self["space_label"] = StaticText() self["space_bar"] = Progress() self.mediuminfo = [] self.formattable = False self["details"] = ScrollLabel() self["info"] = StaticText() self["toolboxactions"] = ActionMap( ["ColorActions", "DVDToolbox", "OkCancelActions"], { "red": self.exit, "green": self.update, "yellow": self.format, "cancel": self.exit, "pageUp": self.pageUp, "pageDown": self.pageDown }) self.update() hotplugNotifier.append(self.update) self.onLayoutFinish.append(self.layoutFinished)
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): Screen.__init__(self, session) self["key_red"] = StaticText(_("Exit")) self["key_green"] = StaticText(_("Update")) self["key_yellow"] = StaticText() self["space_label"] = StaticText() self["space_bar"] = Progress() self.mediuminfo = [] self.formattable = False self["details"] = ScrollLabel() self["info"] = StaticText() self["toolboxactions"] = ActionMap( ["ColorActions", "DVDToolbox", "OkCancelActions"], { "red": self.exit, "green": self.update, "yellow": self.format, "cancel": self.exit, "pageUp": self.pageUp, "pageDown": self.pageDown, }, ) self.update() hotplugNotifier.append(self.update) self.onLayoutFinish.append(self.layoutFinished)
def __init__(self, session): global DisplayType self.session = session self.onClose = [] self.timer = eTimer() self.timer.callback.append(self.timerEvent) if DisplayType: self.record = False self.dir = None self.mount = None self.usb = 0 self.hddUsed = 0 self.isMuted = 0 self.__event_tracker = ServiceEventTracker(screen = self,eventmap = { iPlayableService.evUpdatedInfo: self.UpdatedInfo, iPlayableService.evVideoSizeChanged: self.__evVideoSizeChanged, iPlayableService.evSeekableStatusChanged: self.__evSeekableStatusChanged, iPlayableService.evTunedIn: self.__evTunedIn, iPlayableService.evTuneFailed: self.__evTuneFailed, }) config.misc.standbyCounter.addNotifier(self.onEnterStandby, initial_call = False) session.nav.record_event.append(self.gotRecordEvent) try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except: pass else: self.__event_tracker = ServiceEventTracker(screen = self,eventmap = { iPlayableService.evStart: self.WriteName, })
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): self.session = session self.onClose = [] print('[pace7241VFD] Start') self.tuned = False self.play = False self.record = False self.timeshift = False self.standby = False self.usb = 0 self.dolbyAvailable = False self.mp3Available = False # self.DTSAvailable = False self.display = 'vfd' self.timer = eTimer() self.timer.callback.append(self.timerEvent) self.timer.start(60000, False) # start one minute timer if self.display == 'vfd': Console().ePopen("fp_control -i 22 0") b = str(config.plugins.vfdicon.ledbright.value) Console().ePopen("fp_control -led " + b) global DisplayType print('[pace7241VFD] Hardware displaytype:', DisplayType) print('[pace7241VFD] VFD displaytype :', DisplayTypevfd) if DisplayType == 19: self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ iPlayableService.evUpdatedInfo: self.UpdatedInfo, iPlayableService.evUpdatedEventInfo: self.__evUpdatedEventInfo, iPlayableService.evVideoSizeChanged: self.__evVideoSizeChanged, iPlayableService.evSeekableStatusChanged: self.__evSeekableStatusChanged, iPlayableService.evTunedIn: self.__evTunedIn, iPlayableService.evTuneFailed: self.__evTuneFailed, iPlayableService.evStart: self.__evStart }) config.misc.standbyCounter.addNotifier(self.onEnterStandby, initial_call=False) session.nav.record_event.append(self.gotRecordEvent) if self.display == 'vfd': try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except: pass else: self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ iPlayableService.evStart: self.writeName, }) print('[pace7241VFD] Set text scrolling option') if config.plugins.vfdicon.textscroll.value is not None: evfd.getInstance().vfd_set_SCROLL(int(config.plugins.vfdicon.textscroll.value)) else: evfd.getInstance().vfd_set_SCROLL(1) evfd.getInstance().vfd_set_CENTER(False) if self.display == 'vfd': print("[pace7241VFD] Set text centering option") if config.plugins.vfdicon.textcenter.value == "1": evfd.getInstance().vfd_set_CENTER(True) print('[pace7241VFD] End initialisation')
def __init__( self, session, startdir, message="", showDirectories=True, showFiles=True, showMountpoints=True, matchingPattern="", useServiceRef=False, inhibitDirs=False, inhibitMounts=False, isTop=False, enableWrapAround=False, additionalExtensions=None, ): Screen.__init__(self, session) HelpableScreen.__init__(self) Screen.setTitle(self, _("Please select medium")) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText() self["message"] = StaticText(message) self.filelist = FileList( startdir, showDirectories=showDirectories, showFiles=showFiles, showMountpoints=showMountpoints, matchingPattern=matchingPattern, useServiceRef=useServiceRef, inhibitDirs=inhibitDirs, inhibitMounts=inhibitMounts, isTop=isTop, enableWrapAround=enableWrapAround, additionalExtensions=additionalExtensions, ) self["filelist"] = self.filelist self["FilelistActions"] = ActionMap( ["SetupActions", "ColorActions"], {"green": self.use, "red": self.exit, "ok": self.ok, "cancel": self.exit} ) hotplugNotifier.append(self.hotplugCB) self.onShown.append(self.updateButton) self.onClose.append(self.removeHotplug)
def __init__(self, session, startdir, message="", showDirectories=True, showFiles=True, showMountpoints=True, matchingPattern="", useServiceRef=False, inhibitDirs=False, inhibitMounts=False, isTop=False, enableWrapAround=False, additionalExtensions=None): Screen.__init__(self, session) HelpableScreen.__init__(self) Screen.setTitle(self, _("Please select medium")) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText() self["message"] = StaticText(message) self.filelist = FileList(startdir, showDirectories=showDirectories, showFiles=showFiles, showMountpoints=showMountpoints, matchingPattern=matchingPattern, useServiceRef=useServiceRef, inhibitDirs=inhibitDirs, inhibitMounts=inhibitMounts, isTop=isTop, enableWrapAround=enableWrapAround, additionalExtensions=additionalExtensions) self["filelist"] = self.filelist self["FilelistActions"] = ActionMap( ["SetupActions", "ColorActions"], { "green": self.use, "red": self.exit, "ok": self.ok, "cancel": self.exit }) hotplugNotifier.append(self.hotplugCB) self.onShown.append(self.updateButton) self.onClose.append(self.removeHotplug)
def __init__(self, session, startdir, message = '', showDirectories = True, showFiles = True, showMountpoints = True, matchingPattern = '', useServiceRef = False, inhibitDirs = False, inhibitMounts = False, isTop = False, enableWrapAround = False, additionalExtensions = None): Screen.__init__(self, session) HelpableScreen.__init__(self) Screen.setTitle(self, _('Please select medium')) #edit lululla # self['key_red'] = StaticText(_('Cancel')) # self['key_green'] = StaticText() # self['message'] = StaticText(message) self['key_green'] = Label(_('')) self['key_red'] = Label(_('Cancel')) self['message'] = Label(_('')) self['message'].setText(message) ############## self.filelist = FileList(startdir, showDirectories=showDirectories, showFiles=showFiles, showMountpoints=showMountpoints, matchingPattern=matchingPattern, useServiceRef=useServiceRef, inhibitDirs=inhibitDirs, inhibitMounts=inhibitMounts, isTop=isTop, enableWrapAround=enableWrapAround, additionalExtensions=additionalExtensions) self['filelist'] = self.filelist self['FilelistActions'] = ActionMap(['SetupActions', 'ColorActions'], {'green': self.use, 'red': self.exit, 'ok': self.ok, 'cancel': self.exit}) hotplugNotifier.append(self.hotplugCB) self.onShown.append(self.updateButton) self.onClose.append(self.removeHotplug)
def __init__(self, session): global DisplayType self.session = session self.onClose = [] self.timer = eTimer() self.timer.callback.append(self.timerEvent) if DisplayType: self.record = False self.dir = None self.mount = None self.usb = 0 self.hddUsed = 0 self.isMuted = 0 self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evUpdatedInfo: self.UpdatedInfo, iPlayableService.evVideoSizeChanged: self.__evVideoSizeChanged, iPlayableService.evSeekableStatusChanged: self.__evSeekableStatusChanged, iPlayableService.evTunedIn: self.__evTunedIn, iPlayableService.evTuneFailed: self.__evTuneFailed, }) config.misc.standbyCounter.addNotifier(self.onEnterStandby, initial_call=False) session.nav.record_event.append(self.gotRecordEvent) try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except: pass else: self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evStart: self.WriteName, })
def __init__(self, session, dvd_device = None, dvd_filelist = [], args = None): Screen.__init__(self, session) InfoBarBase.__init__(self) InfoBarNotifications.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap='MediaPlayerCueSheetActions') InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) self.save_infobar_seek_config() self.change_infobar_seek_config() InfoBarSeek.__init__(self) InfoBarPVRState.__init__(self) self.oldService = self.session.nav.getCurrentlyPlayingServiceOrGroup() self.dvdScreen = None self.session.nav.stopService() self['audioLabel'] = Label('n/a') self['subtitleLabel'] = Label('') self['angleLabel'] = Label('') self['chapterLabel'] = Label('') self['anglePix'] = Pixmap() self['anglePix'].hide() self.last_audioTuple = None self.last_subtitleTuple = None self.last_angleTuple = None self.totalChapters = 0 self.currentChapter = 0 self.totalTitles = 0 self.currentTitle = 0 self.__event_tracker = ServiceEventTracker(screen=self, eventmap={iPlayableService.evEnd: self.__serviceStopped, iPlayableService.evStopped: self.__serviceStopped, iPlayableService.evUser: self.__timeUpdated, iPlayableService.evUser + 1: self.__statePlay, iPlayableService.evUser + 2: self.__statePause, iPlayableService.evUser + 3: self.__osdFFwdInfoAvail, iPlayableService.evUser + 4: self.__osdFBwdInfoAvail, iPlayableService.evUser + 5: self.__osdStringAvail, iPlayableService.evUser + 6: self.__osdAudioInfoAvail, iPlayableService.evUser + 7: self.__osdSubtitleInfoAvail, iPlayableService.evUser + 8: self.__chapterUpdated, iPlayableService.evUser + 9: self.__titleUpdated, iPlayableService.evUser + 11: self.__menuOpened, iPlayableService.evUser + 12: self.__menuClosed, iPlayableService.evUser + 13: self.__osdAngleInfoAvail}) self['DVDPlayerDirectionActions'] = ActionMap(['DirectionActions'], {'left': self.keyLeft, 'right': self.keyRight, 'up': self.keyUp, 'down': self.keyDown, 'leftRepeated': self.doNothing, 'rightRepeated': self.doNothing, 'upRepeated': self.doNothing, 'downRepeated': self.doNothing, 'leftUp': self.doNothing, 'rightUp': self.doNothing, 'upUp': self.doNothing, 'downUp': self.doNothing}) self['OkCancelActions'] = ActionMap(['OkCancelActions'], {'ok': self.keyOk, 'cancel': self.keyCancel}, -2) self['DVDPlayerPlaybackActions'] = HelpableActionMap(self, 'DVDPlayerActions', {'dvdMenu': (self.enterDVDMenu, _('show DVD main menu')), 'toggleInfo': (self.toggleInfo, _('toggle time, chapter, audio, subtitle info')), 'nextChapter': (self.nextChapter, _('forward to the next chapter')), 'prevChapter': (self.prevChapter, _('rewind to the previous chapter')), 'nextTitle': (self.nextTitle, _('jump forward to the next title')), 'prevTitle': (self.prevTitle, _('jump back to the previous title')), 'tv': (self.askLeavePlayer, _('exit DVD player or return to file browser')), 'dvdAudioMenu': (self.enterDVDAudioMenu, _('(show optional DVD audio menu)')), 'AudioSelection': (self.enterAudioSelection, _('Select audio track')), 'nextAudioTrack': (self.nextAudioTrack, _('switch to the next audio track')), 'nextSubtitleTrack': (self.nextSubtitleTrack, _('switch to the next subtitle language')), 'nextAngle': (self.nextAngle, _('switch to the next angle')), 'seekBeginning': self.seekBeginning}, -2) self['DVDPlayerColorActions'] = HelpableActionMap(self, 'ColorActions', {'blue': (self.chapterZap, _('jump to chapter by number'))}, -2) self.onClose.append(self.__onClose) try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except: pass self.autoplay = dvd_device or dvd_filelist if dvd_device: self.physicalDVD = True else: self.scanHotplug() self.dvd_filelist = dvd_filelist self.onFirstExecBegin.append(self.opened) self.service = None self.in_menu = False if fileExists('/proc/stb/fb/dst_left'): self.left = open('/proc/stb/fb/dst_left', 'r').read() self.width = open('/proc/stb/fb/dst_width', 'r').read() self.top = open('/proc/stb/fb/dst_top', 'r').read() self.height = open('/proc/stb/fb/dst_height', 'r').read() if self.left != '00000000' or self.top != '00000000' or self.width != '000002d0' or self.height != '0000000240': open('/proc/stb/fb/dst_left', 'w').write('00000000') open('/proc/stb/fb/dst_width', 'w').write('000002d0') open('/proc/stb/fb/dst_top', 'w').write('00000000') open('/proc/stb/fb/dst_height', 'w').write('0000000240') self.onClose.append(self.__restoreOSDSize)
def addHotplugNotifier(self): from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier if not self.hotplugNotifier in hotplugNotifier: print "add hotplugNotifier" hotplugNotifier.append(self.hotplugNotifier)
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, 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, dvd_device=None, dvd_filelist=None, args=None): if not dvd_filelist: dvd_filelist = [] Screen.__init__(self, session) InfoBarBase.__init__(self) InfoBarNotifications.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap="MediaPlayerCueSheetActions") InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) self.save_infobar_seek_config() self.change_infobar_seek_config() InfoBarSeek.__init__(self) InfoBarPVRState.__init__(self) InfoBarLongKeyDetection.__init__(self) self.oldService = self.session.nav.getCurrentlyPlayingServiceOrGroup() self.session.nav.stopService() self["audioLabel"] = Label("n/a") self["subtitleLabel"] = Label("") self["angleLabel"] = Label("") self["chapterLabel"] = Label("") self["anglePix"] = Pixmap() self["anglePix"].hide() self.last_audioTuple = None self.last_subtitleTuple = None self.last_angleTuple = None self.totalChapters = 0 self.currentChapter = 0 self.totalTitles = 0 self.currentTitle = 0 self.__event_tracker = ServiceEventTracker(screen=self, eventmap= { iPlayableService.evStopped: self.__serviceStopped, iPlayableService.evUser: self.__timeUpdated, iPlayableService.evUser+1: self.__statePlay, iPlayableService.evUser+2: self.__statePause, iPlayableService.evUser+3: self.__osdFFwdInfoAvail, iPlayableService.evUser+4: self.__osdFBwdInfoAvail, iPlayableService.evUser+5: self.__osdStringAvail, iPlayableService.evUser+6: self.__osdAudioInfoAvail, iPlayableService.evUser+7: self.__osdSubtitleInfoAvail, iPlayableService.evUser+8: self.__chapterUpdated, iPlayableService.evUser+9: self.__titleUpdated, iPlayableService.evUser+11: self.__menuOpened, iPlayableService.evUser+12: self.__menuClosed, iPlayableService.evUser+13: self.__osdAngleInfoAvail }) self["DVDPlayerDirectionActions"] = ActionMap(["DirectionActions"], { #MENU KEY DOWN ACTIONS "left": self.keyLeft, "right": self.keyRight, "up": self.keyUp, "down": self.keyDown, #MENU KEY REPEATED ACTIONS "leftRepeated": self.doNothing, "rightRepeated": self.doNothing, "upRepeated": self.doNothing, "downRepeated": self.doNothing, #MENU KEY UP ACTIONS "leftUp": self.doNothing, "rightUp": self.doNothing, "upUp": self.doNothing, "downUp": self.doNothing, }) self["OkCancelActions"] = ActionMap(["OkCancelActions"], { "ok": self.keyOk, "cancel": self.keyCancel, }) self["DVDPlayerPlaybackActions"] = HelpableActionMap(self, "DVDPlayerActions", { #PLAYER ACTIONS "dvdMenu": (self.enterDVDMenu, _("Show DVD main menu")), "toggleInfo": (self.toggleInfo, _("Toggle time, chapter, audio, subtitle info")), "nextChapter": (self.nextChapter, _("Forward to the next chapter")), "prevChapter": (self.prevChapter, _("Rewind to the previous chapter")), "nextTitle": (self.nextTitle, _("Jump forward to the next title")), "prevTitle": (self.prevTitle, _("Jump back to the previous title")), "tv": (self.askLeavePlayer, _("Exit DVD player or return to file browser")), "dvdAudioMenu": (self.enterDVDAudioMenu, _("(Show optional DVD audio menu)")), "AudioSelection": (self.enterAudioSelection, _("Select audio track")), "nextAudioTrack": (self.nextAudioTrack, _("Switch to the next audio track")), "nextSubtitleTrack": (self.nextSubtitleTrack, _("Switch to the next subtitle language")), "nextAngle": (self.nextAngle, _("Switch to the next angle")), "seekBeginning": (self.seekBeginning, _("Jump back to the start")) }, prio=-2) self["NumberActions"] = NumberActionMap(["NumberActions"], { "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, "4": self.keyNumberGlobal, "5": self.keyNumberGlobal, "6": self.keyNumberGlobal, "7": self.keyNumberGlobal, "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal, }) self.onClose.append(self.__onClose) try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except: pass self.autoplay = dvd_device or dvd_filelist if dvd_device: self.physicalDVD = True else: self.scanHotplug() self.dvd_filelist = dvd_filelist self.onFirstExecBegin.append(self.opened) self.service = None self.in_menu = False
def __init__(self, session): self.session = session self.onClose = [] print('[sparkVFD] Start') self.VFD = False self.play = False self.record = False self.mp3Available = False self.standby = False global DisplayType if DisplayType == 8: self.VFD = True self.tuned = False self.timeshift = False self.isMuted = False self.usb = 0 self.isMuted = False self.usb = 0 self.timer = eTimer() self.timer.callback.append(self.timerEvent) self.timer.start(59998, False) # start one minute timer global dot dot = 0 print('[sparkVFD] Hardware displaytype:', DisplayType) print('[sparkVFD] VFD displaytype :', DisplayTypevfd) if DisplayType == 4: self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evUpdatedInfo: self.UpdatedInfo, iPlayableService.evUpdatedEventInfo: self.__evUpdatedEventInfo, iPlayableService.evStart: self.__evStart }) config.misc.standbyCounter.addNotifier(self.onEnterStandby, initial_call=False) session.nav.record_event.append(self.gotRecordEvent) elif DisplayType == 8: self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evUpdatedInfo: self.UpdatedInfo, iPlayableService.evUpdatedEventInfo: self.__evUpdatedEventInfo, iPlayableService.evVideoSizeChanged: self.__evVideoSizeChanged, iPlayableService.evSeekableStatusChanged: self.__evSeekableStatusChanged, iPlayableService.evTunedIn: self.__evTunedIn, iPlayableService.evTuneFailed: self.__evTuneFailed, iPlayableService.evStart: self.__evStart }) config.misc.standbyCounter.addNotifier(self.onEnterStandby, initial_call=False) session.nav.record_event.append(self.gotRecordEvent) try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except: pass self.dir = None self.mount = None self.firstmount = -1 global hddUsed hddUsed = -1 self.SetMount() if self.mount: self.firstmount = self.mount if self.standby == False: self.displayHddUsed() else: self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evStart: self.writeName, }) print('[sparkVFD] Set text scrolling option') if config.plugins.vfdicon.textscroll.value is not None: evfd.getInstance().vfd_set_SCROLL( int(config.plugins.vfdicon.textscroll.value)) else: evfd.getInstance().vfd_set_SCROLL(1) print('[sparkVFD] End initialisation')
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, 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, dvd_device=None, dvd_filelist=[], args=None): Screen.__init__(self, session) InfoBarBase.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap="MediaPlayerCueSheetActions") InfoBarShowHide.__init__(self) InfoBarAudioSelection.__init__(self) InfoBarSubtitleSupport.__init__(self) self.subtitle_window.real_hide = self.subtitle_window.hide self.subtitle_window.hide = self.SubtitleWindowFakeHide InfoBarExtensions.__init__(self) InfoBarPlugins.__init__(self) InfoBarNotifications.__init__(self) HelpableScreen.__init__(self) self.save_infobar_seek_config() self.change_infobar_seek_config() InfoBarSeek.__init__(self) InfoBarPVRState.__init__(self) self.dvdScreen = self.session.instantiateDialog(DVDOverlay) self.oldService = self.session.nav.getCurrentlyPlayingServiceReference( ) self.session.nav.stopService() self["audioLabel"] = Label("n/a") self["subtitleLabel"] = Label("") self["angleLabel"] = Label("") self["chapterLabel"] = Label("") self["anglePix"] = Pixmap() self["anglePix"].hide() self.last_audioString = None self.last_subtitleString = None self.last_angleTuple = None self.totalChapters = 0 self.currentChapter = 0 self.totalTitles = 0 self.currentTitle = 0 self._subs_enabled = False self.__event_tracker = ServiceEventTracker( screen=self, eventmap={ iPlayableService.evEnd: self.__serviceStopped, iPlayableService.evStopped: self.__serviceStopped, iPlayableService.evAudioListChanged: self.__osdAudioInfoAvail, iPlayableService.evSubtitleListChanged: self.__osdSubtitleInfoAvail, iPlayableService.evUser + 1: self.__statePlay, iPlayableService.evUser + 2: self.__statePause, iPlayableService.evUser + 3: self.__osdFFwdInfoAvail, iPlayableService.evUser + 4: self.__osdFBwdInfoAvail, iPlayableService.evUser + 5: self.__osdStringAvail, iPlayableService.evUser + 6: self.__osdAngleInfoAvail, iPlayableService.evUser + 7: self.__chapterUpdated, iPlayableService.evUser + 8: self.__titleUpdated, iPlayableService.evUser + 9: self.__menuOpened, iPlayableService.evUser + 10: self.__menuClosed }) self["DVDPlayerDirectionActions"] = ActionMap( ["DirectionActions"], { #MENU KEY DOWN ACTIONS "left": self.keyLeft, "right": self.keyRight, "up": self.keyUp, "down": self.keyDown, #MENU KEY REPEATED ACTIONS "leftRepeated": self.doNothing, "rightRepeated": self.doNothing, "upRepeated": self.doNothing, "downRepeated": self.doNothing, #MENU KEY UP ACTIONS "leftUp": self.doNothing, "rightUp": self.doNothing, "upUp": self.doNothing, "downUp": self.doNothing, }) self["OkCancelActions"] = ActionMap(["OkCancelActions"], { "ok": self.keyOk, "cancel": self.keyCancel, }) self["DVDPlayerPlaybackActions"] = HelpableActionMap( self, "DVDPlayerActions", { #PLAYER ACTIONS "dvdMenu": (self.enterDVDMenu, _("show DVD main menu")), "toggleInfo": (self.toggleInfo, _("toggle time, chapter, audio, subtitle info")), "nextChapter": (self.nextChapter, _("forward to the next chapter")), "prevChapter": (self.prevChapter, _("rewind to the previous chapter")), "nextTitle": (self.nextTitle, _("jump forward to the next title")), "prevTitle": (self.prevTitle, _("jump back to the previous title")), "tv": (self.askLeavePlayer, _("exit DVD player or return to file browser")), "dvdAudioMenu": (self.enterDVDAudioMenu, _("(show optional DVD audio menu)")), "AudioSelection": (self.enterAudioSelection, _("Select audio track")), "nextAudioTrack": (self.nextAudioTrack, _("switch to the next audio track")), "nextSubtitleTrack": (self.nextSubtitleTrack, _("switch to the next subtitle language")), "nextAngle": (self.nextAngle, _("switch to the next angle")), "seekBeginning": self.seekBeginning, }, -2) self["NumberActions"] = NumberActionMap( ["NumberActions"], { "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, "4": self.keyNumberGlobal, "5": self.keyNumberGlobal, "6": self.keyNumberGlobal, "7": self.keyNumberGlobal, "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal, }) self.onClose.append(self.__onClose) from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) self.autoplay = dvd_device or dvd_filelist if dvd_device: self.physicalDVD = True else: self.scanHotplug() self.dvd_filelist = dvd_filelist self.onFirstExecBegin.append(self.opened) self.service = None self.in_menu = False
def dmesg_cleared(self, answer): self.container.appClosed.remove(self.dmesg_cleared) self.msgbox = self.session.open(MessageBox, _("Please disconnect all USB devices from your Dreambox and (re-)attach the target USB stick (minimum size is 64 MB) now!"), MessageBox.TYPE_INFO) hotplugNotifier.append(self.hotplugCB)
def __init__(self, session): Screen.__init__(self, session) self.session = session self.thread = None self.startEntry = 1 self.selectedEntry = 3 self.selectedEntryID = 'id_mainmenu_tv' self.entrys = [(_('Plugins'), 'id_mainmenu_plugins', boundFunction(self.openDialog, PluginBrowser)), (_('Photos'), 'id_mainmenu_photos', boundFunction(self.openPicturePlayer)), (_('Music'), 'id_mainmenu_music', boundFunction(self.openMediaPlayer)), (_('TV / RADIO'), 'id_mainmenu_tv', boundFunction(self.openChannelSelection)), (_('Videos'), 'id_mainmenu_movies', boundFunction(self.openRecordings)), (_('Sources'), 'id_mainmenu_source', boundFunction(self.openMediaScanner)), (_('Setup'), 'id_mainmenu_tasks', boundFunction(self.openGeneralSetup))] self.pos = {} self.pos['id_mainmenu_plugins'] = [(12, 120), (190, 120), (368, 120), (546, 120), (724, 120), (902, 120), (1080, 120)] self.pos['id_mainmenu_photos'] = [(12, 120), (190, 120), (368, 120), (546, 120), (724, 120), (902, 120), (1080, 120)] self.pos['id_mainmenu_music'] = [(12, 120), (190, 120), (368, 120), (546, 120), (724, 120), (902, 120), (1080, 120)] self.pos['id_mainmenu_tv'] = [(12, 120), (190, 120), (368, 120), (546, 120), (724, 120), (902, 120), (1080, 120)] self.pos['id_mainmenu_movies'] = [(12, 95), (190, 95), (368, 95), (546, 95), (724, 95), (902, 95), (1080, 95)] self.pos['id_mainmenu_source'] = [(12, 120), (190, 120), (368, 120), (546, 120), (724, 120), (902, 120), (1080, 120)] self.pos['id_mainmenu_tasks'] = [(12, 120), (190, 120), (368, 120), (546, 120), (724, 120), (902, 120), (1080, 120)] self.startSubEntry = {} self.selectedSubEntry = {} self.selectedExtEntry = {} for key in self.pos.keys(): self.startSubEntry[key] = 0 self.selectedSubEntry[key] = -1 self.selectedExtEntry[key] = eval('config.gmenu.ext_sel_%s' % key).value if self.selectedExtEntry[key] == -1: self.selectedExtEntry[key] = 0 self.subentrys = self.getSubEntrys() self['title'] = MultiColorLabel() self.exttitle = {} self.exttitle['id_mainmenu_plugins'] = '' self.exttitle['id_mainmenu_photos'] = '' self.exttitle['id_mainmenu_music'] = '' self.exttitle['id_mainmenu_tv'] = '' self.exttitle['id_mainmenu_movies'] = '' self.exttitle['id_mainmenu_source'] = '' self.exttitle['id_mainmenu_tasks'] = '' self.extframe = {} self.extframe['id_mainmenu_plugins'] = LoadPixmap(cached=True, path=resolveFilename(SCOPE_ACTIVE_SKIN, 'easy-skin-hd/gmenu/gmenu_plugin_sl.png')) self.extframe['id_mainmenu_photos'] = LoadPixmap(cached=True, path=resolveFilename(SCOPE_ACTIVE_SKIN, 'easy-skin-hd/gmenu/gmenu_photo_sl.png')) self.extframe['id_mainmenu_music'] = LoadPixmap(cached=True, path=resolveFilename(SCOPE_ACTIVE_SKIN, 'easy-skin-hd/gmenu/gmenu_music_sl.png')) self.extframe['id_mainmenu_tv'] = LoadPixmap(cached=True, path=resolveFilename(SCOPE_ACTIVE_SKIN, 'easy-skin-hd/gmenu/gmenu_tv_sl.png')) self.extframe['id_mainmenu_movies'] = LoadPixmap(cached=True, path=resolveFilename(SCOPE_ACTIVE_SKIN, 'easy-skin-hd/gmenu/gmenu_movie_sl.png')) self.extframe['id_mainmenu_source'] = LoadPixmap(cached=True, path=resolveFilename(SCOPE_ACTIVE_SKIN, 'easy-skin-hd/gmenu/gmenu_source_sl.png')) self.extframe['id_mainmenu_tasks'] = LoadPixmap(cached=True, path=resolveFilename(SCOPE_ACTIVE_SKIN, 'easy-skin-hd/gmenu/gmenu_task_sl.png')) self.mainmenu_ext = {} self.mainmenu_ext['id_mainmenu_plugins'] = 'gmenu_plugin' self.mainmenu_ext['id_mainmenu_photos'] = 'gmenu_photo' self.mainmenu_ext['id_mainmenu_music'] = 'gmenu_music' self.mainmenu_ext['id_mainmenu_tv'] = 'gmenu_tv' self.mainmenu_ext['id_mainmenu_movies'] = 'gmenu_movie' self.mainmenu_ext['id_mainmenu_source'] = 'gmenu_source' self.mainmenu_ext['id_mainmenu_tasks'] = 'gmenu_task' self['id_mainmenu_ext'] = StaticText() self['id_mainmenu_plugins_tumb_ext_0'] = StaticText() self['id_mainmenu_plugins_tumb_ext_1'] = StaticText() self['id_mainmenu_plugins_tumb_ext_2'] = StaticText() self['id_mainmenu_plugins_tumb_ext_3'] = StaticText() self['id_mainmenu_plugins_tumb_ext_4'] = StaticText() self['id_mainmenu_plugins_tumb_ext_5'] = StaticText() self['id_mainmenu_plugins_tumb_ext_6'] = StaticText() self['id_mainmenu_photos_tumb_ext_0'] = StaticText() self['id_mainmenu_photos_tumb_ext_1'] = StaticText() self['id_mainmenu_photos_tumb_ext_2'] = StaticText() self['id_mainmenu_photos_tumb_ext_3'] = StaticText() self['id_mainmenu_photos_tumb_ext_4'] = StaticText() self['id_mainmenu_photos_tumb_ext_5'] = StaticText() self['id_mainmenu_photos_tumb_ext_6'] = StaticText() self['id_mainmenu_music_tumb_ext_0'] = StaticText() self['id_mainmenu_music_tumb_ext_1'] = StaticText() self['id_mainmenu_music_tumb_ext_2'] = StaticText() self['id_mainmenu_music_tumb_ext_3'] = StaticText() self['id_mainmenu_music_tumb_ext_4'] = StaticText() self['id_mainmenu_music_tumb_ext_5'] = StaticText() self['id_mainmenu_music_tumb_ext_6'] = StaticText() self['id_mainmenu_tv_tumb_ext_0'] = StaticText() self['id_mainmenu_tv_tumb_ext_1'] = StaticText() self['id_mainmenu_tv_tumb_ext_2'] = StaticText() self['id_mainmenu_tv_tumb_ext_3'] = StaticText() self['id_mainmenu_tv_tumb_ext_4'] = StaticText() self['id_mainmenu_tv_tumb_ext_5'] = StaticText() self['id_mainmenu_tv_tumb_ext_6'] = StaticText() self['id_mainmenu_movies_tumb_ext_0'] = StaticText() self['id_mainmenu_movies_tumb_ext_1'] = StaticText() self['id_mainmenu_movies_tumb_ext_2'] = StaticText() self['id_mainmenu_movies_tumb_ext_3'] = StaticText() self['id_mainmenu_movies_tumb_ext_4'] = StaticText() self['id_mainmenu_movies_tumb_ext_5'] = StaticText() self['id_mainmenu_movies_tumb_ext_6'] = StaticText() self['id_mainmenu_source_tumb_ext_0'] = StaticText() self['id_mainmenu_source_tumb_ext_1'] = StaticText() self['id_mainmenu_source_tumb_ext_2'] = StaticText() self['id_mainmenu_source_tumb_ext_3'] = StaticText() self['id_mainmenu_source_tumb_ext_4'] = StaticText() self['id_mainmenu_source_tumb_ext_5'] = StaticText() self['id_mainmenu_source_tumb_ext_6'] = StaticText() self['id_mainmenu_tasks_tumb_ext_0'] = StaticText() self['id_mainmenu_tasks_tumb_ext_1'] = StaticText() self['id_mainmenu_tasks_tumb_ext_2'] = StaticText() self['id_mainmenu_tasks_tumb_ext_3'] = StaticText() self['id_mainmenu_tasks_tumb_ext_4'] = StaticText() self['id_mainmenu_tasks_tumb_ext_5'] = StaticText() self['id_mainmenu_tasks_tumb_ext_6'] = StaticText() self['list'] = GeneralMenuList([]) self['list_sub_0'] = GeneralSubMenuList([]) self['list_sub_1'] = GeneralSubMenuList([]) self['list_sub_2'] = GeneralSubMenuList([]) self['list_sub_3'] = GeneralSubMenuList([]) self['list_sub_4'] = GeneralSubMenuList([]) self['up_sub_0'] = Pixmap() self['up_sub_1'] = Pixmap() self['up_sub_2'] = Pixmap() self['up_sub_3'] = Pixmap() self['up_sub_4'] = Pixmap() self['down_sub_0'] = Pixmap() self['down_sub_1'] = Pixmap() self['down_sub_2'] = Pixmap() self['down_sub_3'] = Pixmap() self['down_sub_4'] = Pixmap() self['up_sub_0'].hide() self['up_sub_1'].hide() self['up_sub_2'].hide() self['up_sub_3'].hide() self['up_sub_4'].hide() self['down_sub_0'].hide() self['down_sub_1'].hide() self['down_sub_2'].hide() self['down_sub_3'].hide() self['down_sub_4'].hide() self['frame'] = MovingPixmap() self['frame'].hide() self['actions'] = ActionMap(['OkCancelActions', 'DirectionActions'], {'ok': self.keyOK, 'cancel': self.hideMenuIfServiceRunning, 'up': self.up, 'upRepeated': self.up, 'down': self.down, 'downRepeated': self.down, 'left': self.left, 'leftRepeated': self.left, 'right': self.right, 'rightRepeated': self.right}, -2) from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) self.onFirstExecBegin.append(self.__onFirstExecBegin) self.onShow.append(self.__onShow) 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) 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, args=None): Screen.__init__(self, session) InfoBarAudioSelection.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap="MediaPlayerCueSheetActions") InfoBarNotifications.__init__(self) InfoBarBase.__init__(self) SubsSupport.__init__(self) #InfoBarSubtitleSupport.__init__(self) HelpableScreen.__init__(self) self.summary = None self.oldService = self.session.nav.getCurrentlyPlayingServiceReference() self.session.nav.stopService() self.title = "MediaPlayer2_AB" 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.plugins.mediaplayer2.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)", 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) def setWindowTitle(self): self.setTitle(self.title) 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", { "csfd": (self.csfd, _("show csfd info")), "aspectratio": (self.aspectChange, _("changing aspect")), "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, 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): self.session = session self.onClose = [] print '[fs9000VFD] Start' self.tuned = False self.play = False self.record = False self.timeshift = False self.standby = False self.usb = 0 self.dolbyAvailable = False self.mp3Available = False self.DTSAvailable = False self.timer = eTimer() self.timer.callback.append(self.timerEvent) self.timer.start(60000, False) # start one minute timer Console().ePopen("fp_control -i 40 0") b = str(config.plugins.vfdicon.ledbright.value) c = str(config.plugins.vfdicon.crossbright.value) Console().ePopen("fp_control -l 0 0 -l 1 " + b + " -l 4 " + c + " -l 5 " + c + " -l 6 " + c + " -l 7 " + c) global DisplayType print '[fs9000VFD] Hardware displaytype:', DisplayType print '[fs9000VFD] VFD displaytype :', DisplayTypevfd if DisplayType == 6: self.__event_tracker = ServiceEventTracker(screen = self,eventmap = { iPlayableService.evUpdatedInfo: self.UpdatedInfo, iPlayableService.evUpdatedEventInfo: self.__evUpdatedEventInfo, iPlayableService.evVideoSizeChanged: self.__evVideoSizeChanged, iPlayableService.evSeekableStatusChanged: self.__evSeekableStatusChanged, iPlayableService.evTunedIn: self.__evTunedIn, iPlayableService.evTuneFailed: self.__evTuneFailed, iPlayableService.evStart: self.__evStart }) config.misc.standbyCounter.addNotifier(self.onEnterStandby, initial_call = False) session.nav.record_event.append(self.gotRecordEvent) try: from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) except: pass self.dir = None self.mount = None self.firstmount = -1 global hddUsed hddUsed = -1 self.SetMount() if self.mount: self.firstmount = self.mount if self.standby == False: self.displayHddUsed() else: self.__event_tracker = ServiceEventTracker(screen = self,eventmap = { iPlayableService.evStart: self.writeName, }) print '[fs9000VFD] Set text scrolling option' if config.plugins.vfdicon.textscroll.value is not None: evfd.getInstance().vfd_set_SCROLL(int(config.plugins.vfdicon.textscroll.value)) else: evfd.getInstance().vfd_set_SCROLL(1) print "[fs9000VFD] Set text centering option" if config.plugins.vfdicon.textcenter.value == "1": evfd.getInstance().vfd_set_CENTER(True) else: evfd.getInstance().vfd_set_CENTER(False) print '[fs9000VFD] End initialisation'