コード例 #1
0
ファイル: DVD.py プロジェクト: kingvuplus/boom
    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
コード例 #2
0
    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
        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)
コード例 #3
0
ファイル: DVD.py プロジェクト: popazerty/beyonwiz-4.1
	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
コード例 #4
0
    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