Пример #1
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
Пример #2
0
    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)
Пример #3
0
	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)
Пример #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"],
			{
				#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
Пример #5
0
    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
Пример #6
0
    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 __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
Пример #8
0
	def __init__(self, session, args = None):
		Screen.__init__(self, session)
		InfoBarAudioSelection.__init__(self)
		InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions")
		InfoBarNotifications.__init__(self)
		InfoBarBase.__init__(self)
		InfoBarSubtitleSupport.__init__(self)
		HelpableScreen.__init__(self)
		self.summary = None
		self.oldService = self.session.nav.getCurrentlyPlayingServiceReference()
		self.session.nav.stopService()

		self.playlistparsers = {}
		self.addPlaylistParser(PlaylistIOM3U, "m3u")
		self.addPlaylistParser(PlaylistIOPLS, "pls")
		self.addPlaylistParser(PlaylistIOInternal, "e2pls")

		# 'None' is magic to start at the list of mountpoints
		defaultDir = config.mediaplayer.defaultDir.getValue()
		self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|mov|m2ts|flv|dts|3gp|3g2|mts|wmv|asf|wma)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
		self["filelist"] = self.filelist

		self.playlist = MyPlayList()
		self.is_closing = False
		self.delname = ""
		self["playlist"] = self.playlist

		self["PositionGauge"] = ServicePositionGauge(self.session.nav)

		self["currenttext"] = Label("")

		self["artisttext"] = Label(_("Artist")+':')
		self["artist"] = Label("")
		self["titletext"] = Label(_("Title")+':')
		self["title"] = Label("")
		self["albumtext"] = Label(_("Album")+':')
		self["album"] = Label("")
		self["yeartext"] = Label(_("Year")+':')
		self["year"] = Label("")
		self["genretext"] = Label(_("Genre")+':')
		self["genre"] = Label("")
		self["coverArt"] = MediaPixmap()
		self["repeat"] = MultiPixmap()

		self.seek_target = None

#		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")),
				"shift_stop": self.clear_playlist,
				"shift_record": self.playlist.PlayListShuffle,
				"subtitles": (self.subtitleSelection, _("Subtitle selection")),
			}, -2)

		self["InfobarEPGActions"] = HelpableActionMap(self, "InfobarEPGActions", 
			{
				"showEventInfo": (self.showEventInformation, _("show event details")),
			})

		self["actions"] = MoviePlayerActionMap(self, ["DirectionActions"], 
		{
			"right": self.rightDown,
			"rightRepeated": self.doNothing,
			"rightUp": self.rightUp,
			"left": self.leftDown,
			"leftRepeated": self.doNothing,
			"leftUp": self.leftUp,

			"up": self.up,
			"upRepeated": self.up,
			"upUp": self.doNothing,
			"down": self.down,
			"downRepeated": self.down,
			"downUp": self.doNothing,
		}, -2)

		InfoBarSeek.__init__(self, actionmap = "MediaPlayerSeekActions")

		InfoBarPVRState.__init__(self)
		self.__hideTimer = eTimer()
		self.__hideTimer.callback.append(self.__hideMediaPlayerState)

		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, ref = "", args = None):

		Screen.__init__(self, session)
		InfoBarBase.__init__(self)
		InfoBarNotifications.__init__(self)
		InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions")
		InfoBarShowHide.__init__(self)
		InfoBarAudioSelection.__init__(self)
		InfoBarSubtitleSupport.__init__(self)
		HelpableScreen.__init__(self)
		self.save_infobar_seek_config()
		self.change_infobar_seek_config()
		InfoBarSeek.__init__(self)
		InfoBarPVRState.__init__(self)

		self.skinName = ["MRUAPlayer", "DVDPlayer" ]

		self.oldService = self.session.nav.getCurrentlyPlayingServiceReference()
		self.session.nav.stopService()
		self["audioLabel"] = Label("n/a")
		self["subtitleLabel"] = Label("")
		self["angleLabel"] = Label("")
		self["chapterLabel"] = Label("")
		self["anglePix"] = Pixmap()
		self["anglePix"].hide()
		self.last_audioTuple = None
		self.last_subtitleTuple = None
		self.last_angleTuple = None
		self.totalChapters = 0
		self.currentChapter = 0
		self.totalTitles = 0
		self.currentTitle = 0

		self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
			{
				iPlayableService.evStopped: self.__serviceStopped,
				iPlayableService.evStart: self.__serviceStarted,
				iPlayableService.evUser+1: self.__statePlay,
				iPlayableService.evUser+2: self.__statePause,
				iPlayableService.evUser+3: self.__osdStringAvail,
				iPlayableService.evUser+4: self.__osdAudioInfoAvail,
				iPlayableService.evUser+5: self.__osdSubtitleInfoAvail
			})

		self["MRUAPlayerDirectionActions"] = ActionMap(["DirectionActions"],
			{
				#MENU KEY DOWN ACTIONS
				"left": self.keyLeft,
				"right": self.keyRight,
				#"up": self.keyUp,
				#"down": self.keyDown,
				
				#MENU KEY REPEATED ACTIONS
				"leftRepeated": self.doNothing,
				"rightRepeated": self.doNothing,
				"upRepeated": self.doNothing,
				"downRepeated": self.doNothing,
				
				#MENU KEY UP ACTIONS
				"leftUp": self.doNothing,
				"rightUp": self.doNothing,
				"upUp": self.doNothing,
				"downUp": self.doNothing,
			})

		self["OkCancelActions"] = ActionMap(["OkCancelActions"],
			{
				"ok": self.keyOk,
				"cancel": self.keyCancel,
			})

		self["DVDPlayerPlaybackActions"] = HelpableActionMap(self, "MRUAPlayerActions",
			{
				#MRUAPLAYER'S OWN ACTIONS
				"stop": (self.stop, _("Stop Playback")),
				"keyMenu": (self.menu, _("Show menu options")),
				"seekTotime": (self.seekTotime, _("switch to the next angle")),
				"seekFwdinput": (self.seekFwdInput, _("Seek forward with input box")),
				"seekBwdinput": (self.seekBwdInput, _("Seek backward with input box")),
				"subtitles": (self.subtitleSelection, _("Subtitle selection")),
				
				#Actions linked to inforbarseek
				"playpause": (self.playpauseService, _("Pause / Resume")),
				"toggleInfo": (self.toggleShow, _("toggle time, chapter, audio, subtitle info")),
				#"seekFwd": (self.seekFwd, _("Seek forward")),
				#"seekBwd": (self.seekBack, _("Seek backward")),
				
				#Actions from Inforbaraudioselection
				"AudioSelection": (self.audioSelection, _("Select audio track")),
			}, -2)

		self["NumberActions"] = NumberActionMap( [ "NumberActions"],
			{
				"1": self.keyNumberGlobal,
				"2": self.keyNumberGlobal,
				"3": self.keyNumberGlobal,
				"4": self.keyNumberGlobal,
				"5": self.keyNumberGlobal,
				"6": self.keyNumberGlobal,
				"7": self.keyNumberGlobal,
				"8": self.keyNumberGlobal,
				"9": self.keyNumberGlobal,
				"0": self.keyNumberGlobal,
			})

		self.onClose.append(self.__onClose)

		config.plugins.mc_mrua.screenres.value = str(config.av.videomode[config.av.videoport.value].value)[:-1]
		#print config.plugins.mc_mrua.sreenres.value

		#Tmp Hack added to disable RTC while playing through mrua
		os.system("echo 0 > /tmp/zerortc")
		os.system("mount -o bind /tmp/zerortc /proc/stb/fp/rtc")

		self.ref = ref
		self.onFirstExecBegin.append(self.Start)
		self.service = None
		self.in_menu = False
	def __init__(self, session, ref = "", args = None):

		Screen.__init__(self, session)
		InfoBarBase.__init__(self)
		InfoBarNotifications.__init__(self)
		InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions")
		InfoBarShowHide.__init__(self)
		InfoBarAudioSelection.__init__(self)
		InfoBarSubtitleSupport.__init__(self)
		HelpableScreen.__init__(self)
		InfoBarSeek.__init__(self)
		InfoBarPVRState.__init__(self)

		self.skinName = ["MC_MoviePlayer", "DVDPlayer"]

		self.oldService = self.session.nav.getCurrentlyPlayingServiceReference()
		self.session.nav.stopService()
		self["audioLabel"] = Label("n/a")
		self["subtitleLabel"] = Label("None")

		self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
			{
				iPlayableService.evStopped: self.__serviceStopped,
				iPlayableService.evStart: self.__serviceStarted,
				iPlayableService.evUpdatedInfo: self.__UpdatedInfo,
			})

		self["MoviePlayerDirectionActions"] = ActionMap(["DirectionActions"],
			{
				#MENU KEY DOWN ACTIONS
				#"left": self.keyLeft,
				#"right": self.keyRight,
				#"up": self.keyUp,
				#"down": self.keyDown,
				
				#MENU KEY REPEATED ACTIONS
				"leftRepeated": self.doNothing,
				"rightRepeated": self.doNothing,
				"upRepeated": self.doNothing,
				"downRepeated": self.doNothing,
				
				#MENU KEY UP ACTIONS
				"leftUp": self.doNothing,
				"rightUp": self.doNothing,
				"upUp": self.doNothing,
				"downUp": self.doNothing,
			})

		self["OkCancelActions"] = ActionMap(["OkCancelActions"],
			{
				"ok": self.keyOk,
				"cancel": self.keyCancel,
			})

		self["MC_MoviePlayerActions"] = HelpableActionMap(self, "MC_MoviePlayerActions",
			{
				#OWN ACTIONS
				"ok": (self.keyOk, _("Toggle info")),
				"stop": (self.stop, _("Stop Playback")),
				"keyMenu": (self.menu, _("Show menu options")),
				"seekTotime": (self.seekTotime, _("switch to the next angle")),
				"seekFwdinput": (self.seekFwdInput, _("Seek forward with input box")),
				"seekBwdinput": (self.seekBwdInput, _("Seek backward with input box")),
				"subtitles": (self.subtitleSelection, _("Subtitle selection")),
				
				#Actions linked to inforbarseek
				"playpause": (self.playpauseService, _("Pause / Resume")),
				"toggleInfo": (self.toggleShow, _("toggle time, chapter, audio, subtitle info")),
				"seekFwd": (self.seekFwd, _("Seek forward")),
				"seekBwd": (self.seekBack, _("Seek backward")),
				
				#Actions from Inforbaraudioselection
				"AudioSelection": (self.audioSelection, _("Select audio track")),
			}, -2)

		self["NumberActions"] = NumberActionMap( [ "NumberActions"],
			{
				"1": self.keyNumberGlobal,
				"2": self.keyNumberGlobal,
				"3": self.keyNumberGlobal,
				"4": self.keyNumberGlobal,
				"5": self.keyNumberGlobal,
				"6": self.keyNumberGlobal,
				"7": self.keyNumberGlobal,
				"8": self.keyNumberGlobal,
				"9": self.keyNumberGlobal,
				"0": self.keyNumberGlobal,
			})

		self.onClose.append(self.__onClose)

		self.ref = ref
		self.onFirstExecBegin.append(self.Start)
		self.service = None
Пример #11
0
    def __init__(self, session, args=None):
        Screen.__init__(self, session)
        InfoBarAudioSelection.__init__(self)
        InfoBarCueSheetSupport.__init__(self,
                                        actionmap="MediaPlayerCueSheetActions")
        InfoBarNotifications.__init__(self)
        InfoBarBase.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        HelpableScreen.__init__(self)
        self.summary = None
        self.oldService = self.session.nav.getCurrentlyPlayingServiceReference(
        )
        self.session.nav.stopService()

        self.playlistparsers = {}
        self.addPlaylistParser(PlaylistIOM3U, "m3u")
        self.addPlaylistParser(PlaylistIOPLS, "pls")
        self.addPlaylistParser(PlaylistIOInternal, "e2pls")

        # 'None' is magic to start at the list of mountpoints
        defaultDir = config.mediaplayer.defaultDir.getValue()
        self.filelist = FileList(
            defaultDir,
            matchingPattern=
            "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|mov|m2ts|flv|dts|3gp|3g2|mts|wmv|asf|wma)",
            useServiceRef=True,
            additionalExtensions="4098:m3u 4098:e2pls 4098:pls")
        self["filelist"] = self.filelist

        self.playlist = MyPlayList()
        self.is_closing = False
        self.delname = ""
        self["playlist"] = self.playlist

        self["PositionGauge"] = ServicePositionGauge(self.session.nav)

        self["currenttext"] = Label("")

        self["artisttext"] = Label(_("Artist") + ':')
        self["artist"] = Label("")
        self["titletext"] = Label(_("Title") + ':')
        self["title"] = Label("")
        self["albumtext"] = Label(_("Album") + ':')
        self["album"] = Label("")
        self["yeartext"] = Label(_("Year") + ':')
        self["year"] = Label("")
        self["genretext"] = Label(_("Genre") + ':')
        self["genre"] = Label("")
        self["coverArt"] = MediaPixmap()
        self["repeat"] = MultiPixmap()

        self.seek_target = None

        #		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")),
                "shift_stop":
                self.clear_playlist,
                "shift_record":
                self.playlist.PlayListShuffle,
                "subtitles": (self.subtitleSelection, _("Subtitle selection")),
            },
            -2)

        self["InfobarEPGActions"] = HelpableActionMap(
            self, "InfobarEPGActions", {
                "showEventInfo":
                (self.showEventInformation, _("show event details")),
            })

        self["actions"] = MoviePlayerActionMap(
            self, ["DirectionActions"], {
                "right": self.rightDown,
                "rightRepeated": self.doNothing,
                "rightUp": self.rightUp,
                "left": self.leftDown,
                "leftRepeated": self.doNothing,
                "leftUp": self.leftUp,
                "up": self.up,
                "upRepeated": self.up,
                "upUp": self.doNothing,
                "down": self.down,
                "downRepeated": self.down,
                "downUp": self.doNothing,
            }, -2)

        InfoBarSeek.__init__(self, actionmap="MediaPlayerSeekActions")

        InfoBarPVRState.__init__(self)
        self.__hideTimer = eTimer()
        self.__hideTimer.callback.append(self.__hideMediaPlayerState)

        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
            })