Ejemplo n.º 1
0
 def __init__(self, session, service, slist=None, lastservice=None):
     Screen.__init__(self, session)
     InfoBarSubtitleSupport.__init__(self)
     InfoBarAudioSelection.__init__(self)
     InfoBarSeek.__init__(self, actionmap="MediaCenterSeekActions")
     self["actions"] = HelpableActionMap(
         self, "MoviePlayerActions",
         {"leavePlayer": (self.leavePlayer, "leave movie player...")})
     self["MediaPlayerActions"] = HelpableActionMap(
         self, "MediaPlayerActions", {
             "subtitles": (self.subtitleSelection, "Subtitle selection"),
             "prevBouquet": (self.previousMarkOrEntry,
                             "play from previous mark or playlist entry"),
             "nextBouquet": (self.nextMarkOrEntry,
                             "play from next mark or playlist entry"),
             "play": (self.showPlaylist, "show playlist"),
         }, -2)
     self["actions"] = HelpableActionMap(self, "MC_BonkelPlayerActions", {
         "leavePlayer": (self.leavePlayer, "leave movie player..."),
     }, -2)
     self["ColorActions"] = HelpableActionMap(self, "ColorActions", {
         "yellow": (self.audioSelection, "Audio Menu"),
     })
     for x in HelpableScreen, InfoBarShowHide, InfoBarSeek, InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarMoviePlayerSummarySupport, InfoBarSubtitleSupport, InfoBarTeletextPlugin, InfoBarServiceErrorPopupSupport:
         x.__init__(self)
     self.session.nav.playService(service)
     self.returning = False
Ejemplo n.º 2
0
	def __init__(self, session, service, slist = None, lastservice = None):
		Screen.__init__(self, session)
		InfoBarSubtitleSupport.__init__(self)
		InfoBarAudioSelection.__init__(self)
		InfoBarSeek.__init__(self, actionmap = "MediaCenterSeekActions")
		self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
			{
				"leavePlayer": (self.leavePlayer, "leave movie player...")
			})
		self["MediaPlayerActions"] = HelpableActionMap(self, "MediaPlayerActions",
			{
				"subtitles": (self.subtitleSelection, "Subtitle selection"),
				"prevBouquet": (self.previousMarkOrEntry, "play from previous mark or playlist entry"),
				"nextBouquet": (self.nextMarkOrEntry, "play from next mark or playlist entry"),
				"play": (self.showPlaylist, "show playlist"),
			}, -2)
		self["actions"] = HelpableActionMap(self, "MC_BonkelPlayerActions", 
			{
				"leavePlayer": (self.leavePlayer, "leave movie player..."),
			}, -2)
		self["ColorActions"] = HelpableActionMap(self, "ColorActions",
			{
				"yellow": (self.audioSelection, "Audio Menu"),				
			})
		for x in HelpableScreen, InfoBarShowHide, InfoBarSeek, InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarMoviePlayerSummarySupport, InfoBarSubtitleSupport, InfoBarTeletextPlugin, InfoBarServiceErrorPopupSupport:
			x.__init__(self)
		self.session.nav.playService(service)
		self.returning = False
Ejemplo n.º 3
0
 def __init__(self, session, service):
     Screen.__init__(self, session)
     InfoBarSubtitleSupport.__init__(self)
     InfoBarAudioSelection.__init__(self)
     self["actions"] = HelpableActionMap(
         self, "MoviePlayerActions",
         {"leavePlayer": (self.leavePlayer, _("leave movie player..."))})
     self["MediaPlayerActions"] = HelpableActionMap(
         self, "MediaPlayerActions", {
             "previous": (self.previousMarkOrEntry,
                          _("play from previous mark or playlist entry")),
             "next": (self.nextMarkOrEntry,
                      _("play from next mark or playlist entry")),
             "subtitles": (self.subtitleSelection, _("Subtitle selection")),
         }, -2)
     self["ColorActions"] = HelpableActionMap(
         self, "ColorActions", {
             "blue": (self.sleepTimer, _("Sleep Timer")),
             "red": (self.change_ratio, _("Change Ratio old")),
         })
     for x in HelpableScreen, InfoBarShowHide, \
       InfoBarSeek, \
       InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \
       InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport,\
       InfoBarMoviePlayerSummarySupport, InfoBarSubtitleSupport, \
       InfoBarTeletextPlugin, InfoBarServiceErrorPopupSupport:
         x.__init__(self)
     self.session.nav.playService(service)
     self.returning = False
Ejemplo n.º 4
0
 def __init__(self):
     # workaround for VTI image which needs access to this attributes :/
     # TODO use own audioselection screen, to avoid problems with different
     # images
     self.selected_subtitle = None
     self.subtitles_enabled = False
     InfoBarAudioSelection.__init__(self)
Ejemplo n.º 5
0
	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
Ejemplo n.º 6
0
 def __init__(self):
     # workaround for VTI image which needs access to this attributes :/
     # TODO use own audioselection screen, to avoid problems with different
     # images
     self.selected_subtitle = None
     self.subtitles_enabled = False
     InfoBarAudioSelection.__init__(self)
Ejemplo n.º 7
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)
        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
Ejemplo n.º 8
0
    def __init__(self, session, streamurl, servicetype):
        Screen.__init__(self, session)

        self.session = session

        InfoBarBase.__init__(self)
        InfoBarMoviePlayerSummarySupport.__init__(self)
        InfoBarServiceNotifications.__init__(self)
        IPTVInfoBarShowHide.__init__(self)
        InfoBarSeek.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        IPTVInfoBarPVRState.__init__(self, PVRState, True)
        InfoBarInstantRecord.__init__(self)

        self.streamurl = streamurl
        self.servicetype = servicetype

        skin = skin_path + 'streamplayer.xml'

        self["epg_description"] = StaticText()
        self["nowchannel"] = StaticText()
        self["nowtitle"] = StaticText()
        self["nexttitle"] = StaticText()
        self["nowtime"] = StaticText()
        self["nexttime"] = StaticText()
        self["streamcat"] = StaticText()
        self["streamtype"] = StaticText()
        self["extension"] = StaticText()
        self["progress"] = ProgressBar()
        self["progress"].hide()
        self["epg_picon"] = Pixmap()

        self["eventname"] = Label()
        self["state"] = Label()
        self["speed"] = Label()
        self["statusicon"] = MultiPixmap()

        self["PTSSeekBack"] = Pixmap()
        self["PTSSeekPointer"] = Pixmap()

        with open(skin, 'r') as f:
            self.skin = f.read()

        self.setup_title = _('TV')

        self['actions'] = ActionMap(
            ["XStreamityActions"], {
                'cancel': self.back,
                'tv': self.toggleStreamType,
                "channelUp": self.next,
                "channelDown": self.prev,
                "up": self.prev,
                "down": self.next,
                "stop": self.back,
                "rec": self.IPTVstartInstantRecording,
            }, -2)

        self.onLayoutFinish.append(self.__layoutFinished)
Ejemplo n.º 9
0
    def __init__(self, session, service, slist=None, lastservice=None):
        Screen.__init__(self, session)
        InfoBarAspectSelection.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarSimpleEventView.__init__(self)
        self.pts_pvrStateDialog = ""

        self["key_yellow"] = Label()
        self["key_blue"] = Label()
        self["key_green"] = Label()

        self["eventname"] = Label()
        self["state"] = Label()
        self["speed"] = Label()
        self["statusicon"] = MultiPixmap()

        self["actions"] = HelpableActionMap(
            self, "MoviePlayerActions", {
                "leavePlayer": (self.leavePlayer, _("leave movie player...")),
                "leavePlayerOnExit":
                (self.leavePlayerOnExit, _("leave movie player..."))
            })

        self.allowPiP = True

        for x in HelpableScreen, InfoBarShowHide, InfoBarLongKeyDetection, InfoBarMenu, InfoBarEPG, \
          InfoBarBase, InfoBarSeek, InfoBarShowMovies, InfoBarInstantRecord, \
          InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \
          InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \
          InfoBarMoviePlayerSummarySupport, InfoBarSubtitleSupport, \
          InfoBarTeletextPlugin, InfoBarServiceErrorPopupSupport, InfoBarExtensions, \
          InfoBarPlugins, InfoBarPiP, InfoBarZoom, InfoBarButtonSetup:
            x.__init__(self)

#Blackhole
        self.oldeiconfig = config.misc.deliteeinfo.value
        config.misc.deliteeinfo.value = False
        #End

        self.onChangedEntry = []
        self.servicelist = slist
        self.lastservice = lastservice or session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        session.nav.playService(service)
        self.cur_service = service
        self.returning = False
        self.onClose.append(self.__onClose)
        self.onShow.append(self.doButtonsCheck)

        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={enigma.iPlayableService.evStart: self.__evStart})

        assert MoviePlayer.instance is None, "class InfoBar is a singleton class and just one instance of this class is allowed!"
        MoviePlayer.instance = self

        # is needed for every first call of MoviePlayer
        self.__evStart()
Ejemplo n.º 10
0
	def __init__(self, session, service, slist = None, lastservice = None):
		Screen.__init__(self, session)
		InfoBarAspectSelection.__init__(self)
		InfoBarAudioSelection.__init__(self)
		InfoBarSimpleEventView.__init__(self)
		self.pts_pvrStateDialog = ""

		self["key_yellow"] = Label()
		self["key_blue"] = Label()
		self["key_green"] = Label()

		self["eventname"] = Label()
		self["state"] = Label()
		self["speed"] = Label()
		self["statusicon"] = MultiPixmap()

		self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
			{
				"leavePlayer": (self.leavePlayer, _("leave movie player...")),
				"leavePlayerOnExit": (self.leavePlayerOnExit, _("leave movie player..."))
			})

		self.allowPiP = True

		for x in HelpableScreen, InfoBarShowHide, InfoBarLongKeyDetection, InfoBarMenu, InfoBarEPG, \
				InfoBarBase, InfoBarSeek, InfoBarShowMovies, InfoBarInstantRecord, \
				InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \
				InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \
				InfoBarMoviePlayerSummarySupport, InfoBarSubtitleSupport, \
				InfoBarTeletextPlugin, InfoBarServiceErrorPopupSupport, InfoBarExtensions, \
				InfoBarPlugins, InfoBarPiP, InfoBarZoom, InfoBarButtonSetup:
			x.__init__(self)

#Blackhole
		self.oldeiconfig = config.misc.deliteeinfo.value
		config.misc.deliteeinfo.value = False
#End

		self.onChangedEntry = [ ]
		self.servicelist = slist
		self.lastservice = lastservice or session.nav.getCurrentlyPlayingServiceOrGroup()
		session.nav.playService(service)
		self.cur_service = service
		self.returning = False
		self.onClose.append(self.__onClose)
		self.onShow.append(self.doButtonsCheck)

		self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
			{
				enigma.iPlayableService.evStart: self.__evStart
			})

		assert MoviePlayer.instance is None, "class InfoBar is a singleton class and just one instance of this class is allowed!"
		MoviePlayer.instance = self

		# is needed for every first call of MoviePlayer
		self.__evStart()
Ejemplo n.º 11
0
    def __init__(self, session, playlistCallback, nextItemCallback,
                 prevItemCallback, infoCallback, menuCallback):
        Screen.__init__(self, session)
        self.skinName = ['KodiVideoPlayer', 'MoviePlayer']
        statusScreen = self.session.instantiateDialog(StatusScreen)
        InfoBarBase.__init__(self, steal_current_service=True)
        SubsSupport.__init__(self, searchSupport=True, embeddedSupport=True)
        SubsSupportStatus.__init__(self)
        InfoBarSeek.__init__(self)
        InfoBarShowHide.__init__(self)
        InfoBarSubservicesSupport.__init__(self)
        InfoBarAspectChange.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarNotifications.__init__(self)
        HelpableScreen.__init__(self)
        self.playlistCallback = playlistCallback
        self.nextItemCallback = nextItemCallback
        self.prevItemCallback = prevItemCallback
        self.infoCallback = infoCallback
        self.menuCallback = menuCallback
        self.statusScreen = statusScreen
        self.defaultImage = None
        self.postAspectChange.append(self.showAspectChanged)
        self.__timer = eTimer()
        self.__timer.callback.append(self.__seekToPosition)
        self.__image = None
        self.__position = None
        self.__firstStart = True
        self["image"] = WebPixmap(self.defaultImage, caching=False)
        self["directionActions"] = HelpableActionMap(
            self, "DirectionActions", {
                "downUp": (playlistCallback, _("Show playlist")),
                "upUp": (playlistCallback, _("Show playlist")),
            })

        self["okCancelActions"] = HelpableActionMap(self, "OkCancelActions",
                                                    {"cancel": self.close})

        self["actions"] = HelpableActionMap(
            self, "KodiPlayerActions", {
                "menuPressed": (menuCallback, _("Show playback menu")),
                "infoPressed": (infoCallback, _("Show playback info")),
                "nextPressed":
                (nextItemCallback, _("Skip to next item in playlist")),
                "prevPressed":
                (prevItemCallback, _("Skip to previous item in playlist"))
            })

        self.eventTracker = ServiceEventTracker(
            self, {
                iPlayableService.evStart: self.__evStart,
            })
        self.onClose.append(
            boundFunction(self.session.deleteDialog, self.statusScreen))
        self.onClose.append(
            boundFunction(Notifications.RemovePopup, self.RESUME_POPUP_ID))
        self.onClose.append(self.__timer.stop)
Ejemplo n.º 12
0
    def __init__(self, session, streamurl, servicetype):
        Screen.__init__(self, session)

        self.session = session

        InfoBarBase.__init__(self)
        InfoBarMoviePlayerSummarySupport.__init__(self)
        InfoBarServiceNotifications.__init__(self)
        InfoBarShowHide.__init__(self)
        InfoBarSeek.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        IPTVInfoBarPVRState.__init__(self, PVRState, True)

        if cfg.subs.value is True:
            SubsSupport.__init__(self,
                                 searchSupport=True,
                                 embeddedSupport=True)
            SubsSupportStatus.__init__(self)

        self.streamurl = streamurl
        self.servicetype = servicetype

        skin = skin_path + 'catchupplayer.xml'
        self["epg_description"] = StaticText()
        self["streamcat"] = StaticText()
        self["streamtype"] = StaticText()
        self["extension"] = StaticText()
        self["epg_picon"] = Pixmap()

        self["eventname"] = Label()
        self["state"] = Label()
        self["speed"] = Label()
        self["statusicon"] = MultiPixmap()

        self["PTSSeekBack"] = Pixmap()
        self["PTSSeekPointer"] = Pixmap()

        with open(skin, 'r') as f:
            self.skin = f.read()

        self.setup_title = _('Catch Up')

        self['actions'] = ActionMap(
            ["XStreamityActions"], {
                'cancel': self.back,
                'red': self.back,
                'tv': self.toggleStreamType,
                'info': self.toggleStreamType,
                "stop": self.back,
            }, -2)

        self.onFirstExecBegin.append(
            boundFunction(self.playStream, self.servicetype, self.streamurl))
Ejemplo n.º 13
0
    def __init__(self, session, playlistCallback, nextItemCallback, prevItemCallback, infoCallback, menuCallback):
        Screen.__init__(self, session)
        self.skinName = ['KodiVideoPlayer', 'MoviePlayer']
        statusScreen = self.session.instantiateDialog(StatusScreen)
        InfoBarBase.__init__(self, steal_current_service=True)
        SubsSupport.__init__(self, searchSupport=True, embeddedSupport=True)
        SubsSupportStatus.__init__(self)
        InfoBarSeek.__init__(self)
        InfoBarShowHide.__init__(self)
        InfoBarSubservicesSupport.__init__(self)
        InfoBarAspectChange.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarNotifications.__init__(self)
        HelpableScreen.__init__(self)
        self.playlistCallback = playlistCallback
        self.nextItemCallback = nextItemCallback
        self.prevItemCallback = prevItemCallback
        self.infoCallback = infoCallback
        self.menuCallback = menuCallback
        self.statusScreen = statusScreen
        self.defaultImage = None
        self.postAspectChange.append(self.showAspectChanged)
        self.__timer = eTimer()
        self.__timer.callback.append(self.__seekToPosition)
        self.__image = None
        self.__position = None
        self.__firstStart = True
        self["image"] = WebPixmap(self.defaultImage, caching=False)
        self["directionActions"] = HelpableActionMap(self, "DirectionActions",
        {
            "downUp": (playlistCallback, _("Show playlist")),
            "upUp": (playlistCallback, _("Show playlist")),
         })

        self["okCancelActions"] = HelpableActionMap(self, "OkCancelActions",
        {
            "cancel": self.close
        })

        self["actions"] = HelpableActionMap(self, "KodiPlayerActions",
        {
            "menuPressed": (menuCallback, _("Show playback menu")),
            "infoPressed": (infoCallback, _("Show playback info")),
            "nextPressed": (nextItemCallback, _("Skip to next item in playlist")),
            "prevPressed": (prevItemCallback, _("Skip to previous item in playlist"))
        })

        self.eventTracker = ServiceEventTracker(self,
        {
            iPlayableService.evStart : self.__evStart,
        })
        self.onClose.append(boundFunction(self.session.deleteDialog, self.statusScreen))
        self.onClose.append(boundFunction(Notifications.RemovePopup, self.RESUME_POPUP_ID))
        self.onClose.append(self.__timer.stop)
Ejemplo n.º 14
0
    def __init__(self,
                 session,
                 service,
                 restoreService=True,
                 infoCallback=None,
                 getNextService=None,
                 getPrevService=None,
                 stopCallback=None,
                 pauseCallback=None):
        Screen.__init__(self, session)
        InfoBarNotifications.__init__(self)
        InfoBarSeek.__init__(self)
        InfoBarShowHide.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        InfoBarCueSheetSupport.__init__(self)
        #TODO FIX THIS HACK
        # currently we just want to be able to resume playback (if supported by e2),
        # for now we don't care about cutting or jumpmarks or anything like that...
        del self["CueSheetActions"]

        self.session = session
        self.service = service
        self.infoCallback = infoCallback
        self.getNextServiceCB = getNextService
        self.getPrevServiceCB = getPrevService
        self.stopCB = stopCallback
        self.pauseCB = pauseCallback
        self.callback = None
        self.screen_timeout = 5000
        self.nextservice = None
        self.is_closing = False
        self.restoreService = restoreService
        self.oldService = self.session.nav.getCurrentlyPlayingServiceReference(
        )

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "InfobarSeekActions", "MediaPlayerActions",
                "MovieSelectionActions"
            ], {
                "cancel": self.leavePlayer,
                "stop": self.leavePlayer,
                "playpauseService": self.playpause,
                "previous": self.playPrev,
                "next": self.playNext,
                "showEventInfo": self.showVideoInfo,
            }, -2)

        self.returning = False

        self.onShown.append(self.play)
        self.onClose.append(self.__onClose)
Ejemplo n.º 15
0
    def __init__(self, session, service, slist = None, lastservice = None):
        Screen.__init__(self, session)
        InfoBarAspectSelection.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarSimpleEventView.__init__(self)
        self.pts_pvrStateDialog = ''
        self['key_yellow'] = Label()
        self['key_blue'] = Label()
        self['key_green'] = Label()
        self['eventname'] = Label()
        self['state'] = Label()
        self['speed'] = Label()
        self['statusicon'] = MultiPixmap()
        self['actions'] = HelpableActionMap(self, 'MoviePlayerActions', {'leavePlayer': (self.leavePlayer, _('leave movie player...')),
         'leavePlayerOnExit': (self.leavePlayerOnExit, _('leave movie player...'))})
        self.allowPiP = True
        for x in (HelpableScreen,
         InfoBarShowHide,
         InfoBarLongKeyDetection,
         InfoBarMenu,
         InfoBarEPG,
         InfoBarBase,
         InfoBarSeek,
         InfoBarShowMovies,
         InfoBarInstantRecord,
         InfoBarAudioSelection,
         InfoBarNotifications,
         InfoBarSimpleEventView,
         InfoBarServiceNotifications,
         InfoBarPVRState,
         InfoBarCueSheetSupport,
         InfoBarMoviePlayerSummarySupport,
         InfoBarSubtitleSupport,
         InfoBarTeletextPlugin,
         InfoBarServiceErrorPopupSupport,
         InfoBarExtensions,
         InfoBarPlugins,
         InfoBarPiP,
         InfoBarZoom,
         InfoBarButtonSetup):
            x.__init__(self)

        self.onChangedEntry = []
        self.servicelist = slist
        self.lastservice = lastservice or session.nav.getCurrentlyPlayingServiceOrGroup()
        session.nav.playService(service)
        self.cur_service = service
        self.returning = False
        self.onClose.append(self.__onClose)
        self.onShow.append(self.doButtonsCheck)
        self.__event_tracker = ServiceEventTracker(screen=self, eventmap={enigma.iPlayableService.evStart: self.__evStart})
        MoviePlayer.instance = self
        self.__evStart()
Ejemplo n.º 16
0
 def __init__(self, session, service, stopPlayer, chName, chURL, chIcon):
     Screen.__init__(self, session)
     InfoBarAudioSelection.__init__(self)
     InfoBarNotifications.__init__(self)
     isEmpty = lambda x: x is None or len(x) == 0 or x == 'None'
     if isEmpty(chName):
         chName = 'Unknown'
     if isEmpty(chURL):
         chURL = 'Unknown'
     if isEmpty(chIcon):
         chIcon = 'default.png'
     chIcon = '%s/icons/%s' % (PLUGIN_PATH, chIcon)
     self.session = session
     self.service = service
     self.stopPlayer = stopPlayer
     self.setTitle(chName)
     self['actions'] = ActionMap(
         [
             'OkCancelActions', 'InfobarSeekActions', 'MediaPlayerActions',
             'MovieSelectionActions'
         ], {
             'ok': self.doInfoAction,
             'cancel': self.doExit,
             'stop': self.doExit,
             'playpauseService': self.playpauseService
         }, -2)
     self.__event_tracker = ServiceEventTracker(
         screen=self,
         eventmap={
             iPlayableService.evSeekableStatusChanged:
             self.__seekableStatusChanged,
             iPlayableService.evStart: self.__serviceStarted,
             iPlayableService.evEOF: self.__evEOF,
             iPlayableService.evUser + 10: self.__evAudioDecodeError,
             iPlayableService.evUser + 11: self.__evVideoDecodeError,
             iPlayableService.evUser + 12: self.__evPluginError
         })
     self.hidetimer = eTimer()
     self.hidetimer.timeout.get().append(self.doInfoAction)
     self.state = self.PLAYER_IDLE
     self.__seekableStatusChanged()
     self.onClose.append(self.__onClose)
     self.doPlay()
     self['channel_icon'] = Pixmap()
     self['channel_name'] = Label(chName)
     self['channel_uri'] = Label(chURL)
     self.picload = ePicLoad()
     self.scale = AVSwitch().getFramebufferScale()
     self.picload.PictureData.get().append(self.cbDrawChannelIcon)
     self.picload.setPara(
         (35, 35, self.scale[0], self.scale[1], False, 0, '#00000000'))
     self.picload.startDecode(chIcon)
Ejemplo n.º 17
0
    def __init__(self, session, service, stopPlayer, chName, chURL, chIcon):
        Screen.__init__(self, session)
        InfoBarAudioSelection.__init__(self)
        InfoBarNotifications.__init__(self)

        isEmpty = lambda x: x is None or len(x) == 0 or x == "None"
        if isEmpty(chName): chName = "Unknown"
        if isEmpty(chURL):  chURL  = "Unknown"
        if isEmpty(chIcon): chIcon = "default.png"
        chIcon = "%s/icons/%s" % (PLUGIN_PATH, chIcon)
        self.session = session
        self.service = service
        self.stopPlayer = stopPlayer

        self.setTitle(chName)

        self["actions"] = ActionMap(["OkCancelActions", "InfobarSeekActions",
                                     "MediaPlayerActions", "MovieSelectionActions"], {
            "ok": self.doInfoAction,
            "cancel": self.doExit,
            "stop": self.doExit,
            "playpauseService": self.playpauseService,
        }, -2)

        self.__event_tracker = ServiceEventTracker(screen = self, eventmap = {
            iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged,
            iPlayableService.evStart: self.__serviceStarted,
            iPlayableService.evEOF: self.__evEOF,
            iPlayableService.evUser + 10: self.__evAudioDecodeError,
            iPlayableService.evUser + 11: self.__evVideoDecodeError,
            iPlayableService.evUser + 12: self.__evPluginError,
        })

        self.hidetimer = eTimer()
        self.hidetimer.timeout.get().append(self.doInfoAction)

        self.state = self.PLAYER_IDLE
        self.__seekableStatusChanged()

        self.onClose.append(self.__onClose)
        self.doPlay()

        self["channel_icon"] = Pixmap()
        self["channel_name"] = Label(chName)
        self["channel_uri"]  = Label(chURL)

        self.picload = ePicLoad()
        self.scale   = AVSwitch().getFramebufferScale()
        self.picload.PictureData.get().append(self.cbDrawChannelIcon)
        self.picload.setPara((35, 35, self.scale[0], self.scale[1], False, 0, "#00000000"))
        self.picload.startDecode(chIcon)
Ejemplo n.º 18
0
	def __init__(self, session, master):
		MediaGUI.__init__(self, session, master)
		InfoBarNotifications.__init__(self)
		InfoBarSeek.__init__(self)
		InfoBarShowHide.__init__(self)
		InfoBarAudioSelection.__init__(self)
		InfoBarSubtitleSupport.__init__(self)
		InfoBarCueSheetSupport.__init__(self)
		self.skinName = "MoviePlayer"
		self.setTitle(_("UPnP/DLNA Video Player"))
		# TODO FIX THIS HACK
		# currently we just want to be able to resume playback (if supported by e2),
		# for now we don't care about cutting or jumpmarks or anything like that...
		del self["CueSheetActions"]
Ejemplo n.º 19
0
 def __init__(self, session, master):
     MediaGUI.__init__(self, session, master)
     InfoBarNotifications.__init__(self)
     InfoBarSeek.__init__(self)
     InfoBarShowHide.__init__(self)
     InfoBarAudioSelection.__init__(self)
     InfoBarSubtitleSupport.__init__(self)
     InfoBarCueSheetSupport.__init__(self)
     self.skinName = "MoviePlayer"
     self.setTitle(_("UPnP/DLNA Video Player"))
     # TODO FIX THIS HACK
     # currently we just want to be able to resume playback (if supported by e2),
     # for now we don't care about cutting or jumpmarks or anything like that...
     del self["CueSheetActions"]
Ejemplo n.º 20
0
 def __init__(self, session, service, stopPlayer, chName, chURL, chIcon):
     Screen.__init__(self, session)
     InfoBarAudioSelection.__init__(self)
     InfoBarNotifications.__init__(self)
     isEmpty = lambda x: x is None or len(x) == 0 or x == 'None'
     if isEmpty(chName):
         chName = 'Unknown'
     if isEmpty(chURL):
         chURL = 'Unknown'
     if isEmpty(chIcon):
         chIcon = 'default.png'
     chIcon = '%s/icons/%s' % (PLUGIN_PATH, chIcon)
     self.session = session
     self.service = service
     self.stopPlayer = stopPlayer
     self.setTitle(chName)
     self['actions'] = ActionMap(['OkCancelActions',
      'InfobarSeekActions',
      'MediaPlayerActions',
      'MovieSelectionActions'], {'ok': self.doInfoAction,
      'cancel': self.doExit,
      'stop': self.doExit,
      'playpauseService': self.playpauseService}, -2)
     self.__event_tracker = ServiceEventTracker(screen=self, eventmap={iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged,
      iPlayableService.evStart: self.__serviceStarted,
      iPlayableService.evEOF: self.__evEOF,
      iPlayableService.evUser + 10: self.__evAudioDecodeError,
      iPlayableService.evUser + 11: self.__evVideoDecodeError,
      iPlayableService.evUser + 12: self.__evPluginError})
     self.hidetimer = eTimer()
     self.hidetimer.timeout.get().append(self.doInfoAction)
     self.state = self.PLAYER_IDLE
     self.__seekableStatusChanged()
     self.onClose.append(self.__onClose)
     self.doPlay()
     self['channel_icon'] = Pixmap()
     self['channel_name'] = Label(chName)
     self['channel_uri'] = Label(chURL)
     self.picload = ePicLoad()
     self.scale = AVSwitch().getFramebufferScale()
     self.picload.PictureData.get().append(self.cbDrawChannelIcon)
     self.picload.setPara((35,
      35,
      self.scale[0],
      self.scale[1],
      False,
      0,
      '#00000000'))
     self.picload.startDecode(chIcon)
Ejemplo n.º 21
0
    def __init__(self,
                 session,
                 service,
                 config_plugins_plugin,
                 leave_on_eof=False):

        self.service = service
        self.leave_on_eof = leave_on_eof

        self.allowPiP = False
        self.allowPiPSwap = False

        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        self.skinName = getSkinName("CockpitPlayer")
        self["Service"] = COCCurrentService(session.nav, self)

        InfoBarShowHide.__init__(self)
        InfoBarBase.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarNotifications.__init__(self)
        CockpitPlayerAudio.__init__(self, session, config_plugins_plugin)
        CockpitPlayerSubtitles.__init__(self, config_plugins_plugin)
        CockpitCueSheet.__init__(self, service)
        CockpitSeek.__init__(self, service, config_plugins_plugin)
        CockpitPVRState.__init__(self)
        CutList.__init__(self)

        self["actions"] = HelpableActionMap(
            self, "CockpitActions", {
                "STOP": (self.leavePlayer, _("Stop playback")),
                "EXIT": (self.leavePlayer, _("Stop playback")),
                "POWER": (self.leavePlayer, _("Stop playback")),
                "CHANNELUP": (self.skipForward, _("Skip forward")),
                "CHANNELDOWN": (self.skipBackward, _("Skip backward")),
                "INFOS": (self.infoMovie, _("EPG Info")),
            }, -2)

        self._event_tracker = ServiceEventTracker(screen=self,
                                                  eventmap={
                                                      iPlayableService.evStart:
                                                      self.__serviceStarted,
                                                  })

        self.service_started = False
        self.cut_list = []
        self.resume_point = 0

        self.onShown.append(self.__onShow)
Ejemplo n.º 22
0
    def __init__(self, session, streamurl, servicetype):
        Screen.__init__(self, session)

        self.session = session

        InfoBarBase.__init__(self)
        InfoBarMoviePlayerSummarySupport.__init__(self)
        InfoBarServiceNotifications.__init__(self)
        InfoBarShowHide.__init__(self)
        InfoBarSeek.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        IPTVInfoBarPVRState.__init__(self, PVRState, True)
        SubsSupport.__init__(self, searchSupport=True, embeddedSupport=True)
        SubsSupportStatus.__init__(self)

        self.streamurl = streamurl
        self.servicetype = servicetype

        skin = skin_path + 'vodplayer.xml'

        self["streamcat"] = StaticText()
        self["streamtype"] = StaticText()
        self["extension"] = StaticText()
        self["cover"] = Pixmap()

        self["eventname"] = Label()
        self["state"] = Label()
        self["speed"] = Label()
        self["statusicon"] = MultiPixmap()

        with open(skin, 'r') as f:
            self.skin = f.read()

        self.setup_title = _('VOD')

        self['actions'] = ActionMap(
            ["XStreamityActions"], {
                'cancel': self.back,
                'tv': self.toggleStreamType,
                "channelUp": self.next,
                "channelDown": self.prev,
                "up": self.prev,
                "down": self.next,
                "stop": self.back,
            }, -2)

        self.onLayoutFinish.append(self.__layoutFinished)
Ejemplo n.º 23
0
    def __init__(self, session, service, slist=None, lastservice=None):
        Screen.__init__(self, session)
        InfoBarAspectSelection.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarSimpleEventView.__init__(self)
        self.pts_pvrStateDialog = ''
        self['key_yellow'] = Label()
        self['key_blue'] = Label()
        self['key_green'] = Label()
        self['eventname'] = Label()
        self['state'] = Label()
        self['speed'] = Label()
        self['statusicon'] = MultiPixmap()
        self['actions'] = HelpableActionMap(
            self, 'MoviePlayerActions', {
                'leavePlayer': (self.leavePlayer, _('leave movie player...')),
                'leavePlayerOnExit':
                (self.leavePlayerOnExit, _('leave movie player...'))
            })
        self.allowPiP = True
        for x in (HelpableScreen, InfoBarShowHide, InfoBarLongKeyDetection,
                  InfoBarMenu, InfoBarEPG, InfoBarBase, InfoBarSeek,
                  InfoBarShowMovies, InfoBarInstantRecord,
                  InfoBarAudioSelection, InfoBarNotifications,
                  InfoBarSimpleEventView, InfoBarServiceNotifications,
                  InfoBarPVRState, InfoBarCueSheetSupport,
                  InfoBarMoviePlayerSummarySupport, InfoBarSubtitleSupport,
                  InfoBarTeletextPlugin, InfoBarServiceErrorPopupSupport,
                  InfoBarExtensions, InfoBarPlugins, InfoBarPiP, InfoBarZoom,
                  InfoBarButtonSetup):
            x.__init__(self)

        self.onChangedEntry = []
        self.servicelist = slist
        self.lastservice = lastservice or session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        session.nav.playService(service)
        self.cur_service = service
        self.returning = False
        self.onClose.append(self.__onClose)
        self.onShow.append(self.doButtonsCheck)
        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={enigma.iPlayableService.evStart: self.__evStart})
        MoviePlayer.instance = self
        self.__evStart()
Ejemplo n.º 24
0
    def __init__(self, session, service, slist=None, lastservice=None):
        Screen.__init__(self, session)
        InfoBarAspectSelection.__init__(self)
        InfoBarAudioSelection.__init__(self)
        self.pts_pvrStateDialog = ""

        self["key_yellow"] = Label()
        self["key_blue"] = Label()
        self["key_green"] = Label()

        self["eventname"] = Label()
        self["state"] = Label()
        self["speed"] = Label()
        self["statusicon"] = MultiPixmap()

        self["actions"] = HelpableActionMap(
            self, "MoviePlayerActions", {
                "leavePlayer": (self.leavePlayer, _("leave movie player...")),
                "leavePlayerOnExit":
                (self.leavePlayerOnExit, _("leave movie player..."))
            })

        self.allowPiP = True

        for x in HelpableScreen, InfoBarShowHide, InfoBarMenu, InfoBarEPG, \
          InfoBarBase, InfoBarSeek, InfoBarShowMovies, \
          InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \
          InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \
          InfoBarMoviePlayerSummarySupport, InfoBarSubtitleSupport, \
          InfoBarTeletextPlugin, InfoBarServiceErrorPopupSupport, InfoBarExtensions, \
          InfoBarPlugins, InfoBarPiP, InfoBarZoom:
            x.__init__(self)

        self.onChangedEntry = []
        self.servicelist = slist
        self.lastservice = lastservice or session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        session.nav.playService(service)
        self.cur_service = service
        self.returning = False
        self.onClose.append(self.__onClose)
        self.onShow.append(self.doButtonsCheck)

        assert MoviePlayer.instance is None, "class InfoBar is a singleton class and just one instance of this class is allowed!"
        MoviePlayer.instance = self
Ejemplo n.º 25
0
	def __init__(self, session, service, restoreService=True, infoCallback=None, getNextService=None, getPrevService=None, stopCallback=None, pauseCallback=None, getMetadata=None):
		Screen.__init__(self, session)
		InfoBarNotifications.__init__(self)
		InfoBarSeek.__init__(self)
		InfoBarShowHide.__init__(self)
		InfoBarAudioSelection.__init__(self)
		InfoBarSubtitleSupport.__init__(self)
		InfoBarCueSheetSupport.__init__(self)
		# TODO FIX THIS HACK
		# currently we just want to be able to resume playback (if supported by e2),
		# for now we don't care about cutting or jumpmarks or anything like that...
		del self["CueSheetActions"]

		self.session = session
		self.service = service
		self.infoCallback = infoCallback
		self.getNextServiceCB = getNextService
		self.getPrevServiceCB = getPrevService
		self.stopCB = stopCallback
		self.pauseCB = pauseCallback
		self.callback = None
		self.screen_timeout = 5000
		self.nextservice = None
		self.is_closing = False
		self.restoreService = restoreService
		self.oldService = self.session.nav.getCurrentlyPlayingServiceReference()
		self.getMetadata = getMetadata

		self.__delayed_close_timer = eTimer()
		self.__delayed_close_timer.callback.append(self.close)

		self["actions"] = ActionMap(["OkCancelActions", "InfobarSeekActions", "MediaPlayerActions", "MovieSelectionActions"],
		{
				"cancel": self.leavePlayer,
				"stop": self.leavePlayer,
				"playpauseService": self.playpause,
				"previous":  self.playPrev,
				"next": self.playNext,
				"showEventInfo": self.showVideoInfo,
			}, -2)

		self.returning = False

		self.onShown.append(self.play)
		self.onClose.append(self.__onClose)
Ejemplo n.º 26
0
	def __init__(self, session, service, slist = None, lastservice = None):
		Screen.__init__(self, session)
		#InfoBarAspectSelection.__init__(self)
		InfoBarAudioSelection.__init__(self)
		#InfoBarSimpleEventView.__init__(self)
		#self.pts_pvrStateDialog = ""

		self["key_yellow"] = Label()
		self["key_blue"] = Label()
		self["key_green"] = Label()

		self["eventname"] = Label()
		self["state"] = Label()
		self["speed"] = Label()
		self["statusicon"] = MultiPixmap()

		self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
			{
				"leavePlayer": (self.leavePlayer, _("leave movie player...")),
				"leavePlayerOnExit": (self.leavePlayerOnExit, _("leave movie player..."))
			})

		self.allowPiP = True

		for x in InfoBarAspectSelection, HelpableScreen, InfoBarShowHide, InfoBarMenu, InfoBarEPG, \
				InfoBarBase, InfoBarSeek, InfoBarShowMovies, InfoBarInstantRecord, \
				InfoBarAudioSelection, InfoBarResolutionSelection, InfoBarNotifications, InfoBarLongKeyDetection, \
				InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \
				InfoBarMoviePlayerSummarySupport, InfoBarSubtitleSupport, \
				InfoBarTeletextPlugin, InfoBarServiceErrorPopupSupport, InfoBarExtensions, \
				InfoBarPlugins, InfoBarPiP, InfoBarZoom, InfoBarHotkey:
			x.__init__(self)

		self.onChangedEntry = [ ]
		self.servicelist = slist
		self.lastservice = lastservice or session.nav.getCurrentlyPlayingServiceOrGroup()
		session.nav.playService(service)
		self.cur_service = service
		self.returning = False
		self.onClose.append(self.__onClose)
		self.onShow.append(self.doButtonsCheck)

		assert MoviePlayer.instance is None, "class InfoBar is a singleton class and just one instance of this class is allowed!"
		MoviePlayer.instance = self
 def __init__(self, session, service):
     Screen.__init__(self, session)
     InfoBarSubtitleSupport.__init__(self)
     InfoBarAudioSelection.__init__(self)
     self["actions"] = HelpableActionMap(
         self, "MoviePlayerActions", {"leavePlayer": (self.leavePlayer, _("leave movie player..."))}
     )
     self["MediaPlayerActions"] = HelpableActionMap(
         self,
         "MediaPlayerActions",
         {
             "previous": (self.previousMarkOrEntry, _("play from previous mark or playlist entry")),
             "next": (self.nextMarkOrEntry, _("play from next mark or playlist entry")),
             "subtitles": (self.subtitleSelection, _("Subtitle selection")),
         },
         -2,
     )
     self["ColorActions"] = HelpableActionMap(
         self,
         "ColorActions",
         {"blue": (self.sleepTimer, _("Sleep Timer")), "red": (self.change_ratio, _("Change Ratio old"))},
     )
     for x in (
         HelpableScreen,
         InfoBarShowHide,
         InfoBarSeek,
         InfoBarAudioSelection,
         InfoBarNotifications,
         InfoBarSimpleEventView,
         InfoBarServiceNotifications,
         InfoBarPVRState,
         InfoBarCueSheetSupport,
         InfoBarMoviePlayerSummarySupport,
         InfoBarSubtitleSupport,
         InfoBarTeletextPlugin,
         InfoBarServiceErrorPopupSupport,
     ):
         x.__init__(self)
     self.session.nav.playService(service)
     self.returning = False
Ejemplo n.º 28
0
 def __init__(self, session, name, url):
     Screen.__init__(self, session)
     self.skinName = 'MoviePlayer'
     title = 'Play Stream'
     self['list'] = MenuList([])
     InfoBarMenu.__init__(self)
     InfoBarNotifications.__init__(self)
     InfoBarBase.__init__(self, steal_current_service=True)
     TvInfoBarShowHide.__init__(self)
     InfoBarAudioSelection.__init__(self)
     # InfoBarSubtitleSupport.__init__(self)
     self['actions'] = ActionMap(
         [
             'WizardActions', 'MoviePlayerActions', 'MovieSelectionActions',
             'MediaPlayerActions', 'EPGSelectActions',
             'MediaPlayerSeekActions', 'SetupActions', 'ColorActions',
             'InfobarShowHideActions', 'InfobarActions',
             'InfobarSeekActions'
         ], {
             'leavePlayer': self.cancel,
             'epg': self.showIMDB,
             'info': self.showIMDB,
             'stop': self.leavePlayer,
             'cancel': self.cancel,
             'back': self.cancel
         }, -1)
     self.allowPiP = False
     self.service = None
     service = None
     InfoBarSeek.__init__(self, actionmap='InfobarSeekActions')
     url = url.replace(':', '%3a')
     self.url = url
     self.name = name
     # self.srefOld = self.session.nav.getCurrentlyPlayingServiceReference()
     self.state = self.STATE_PLAYING
     self.onLayoutFinish.append(self.openPlay)
     self.onClose.append(self.cancel)
	def __init__(self, session, 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
Ejemplo n.º 30
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

#	ikseong
#		from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
#		hotplugNotifier.append(self.hotplugCB)

		class MoviePlayerActionMap(NumberActionMap):
			def __init__(self, player, contexts = [ ], actions = { }, prio=0):
				NumberActionMap.__init__(self, contexts, actions, prio)
				self.player = player

			def action(self, contexts, action):
				self.player.show()
				return NumberActionMap.action(self, contexts, action)

		self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", 
			{
				"ok": (self.ok, _("add file to playlist")),
				"cancel": (self.exit, _("exit mediaplayer")),
			}, -2)

		self["MediaPlayerActions"] = HelpableActionMap(self, "MediaPlayerActions", 
			{
				"play": (self.xplayEntry, _("play entry")),
				"pause": (self.pauseEntry, _("pause")),
				"stop": (self.stopEntry, _("stop entry")),
				"previous": (self.previousMarkOrEntry, _("play from previous mark or playlist entry")),
				"next": (self.nextMarkOrEntry, _("play from next mark or playlist entry")),
				"menu": (self.showMenu, _("menu")),
				"skipListbegin": (self.skip_listbegin, _("jump to listbegin")),
				"skipListend": (self.skip_listend, _("jump to listend")),
				"prevBouquet": (self.switchToPlayList, _("switch to playlist")),
				"nextBouquet": (self.switchToFileList, _("switch to filelist")),
				"delete": (self.deletePlaylistEntry, _("delete playlist entry")),
#ikseong				
#				"shift_stop": (self.clear_playlist, _("clear playlist")),
#				"shift_record": (self.playlist.PlayListShuffle, _("shuffle playlist")),
				"shift_stop": self.clear_playlist,
				"shift_record": self.playlist.PlayListShuffle,
				"subtitles": (self.subtitleSelection, _("Subtitle selection")),
			}, -2)

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

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

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

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

		self.onClose.append(self.delMPTimer)
		self.onClose.append(self.__onClose)

		self.righttimer = False
		self.rightKeyTimer = eTimer()
		self.rightKeyTimer.callback.append(self.rightTimerFire)

		self.lefttimer = False
		self.leftKeyTimer = eTimer()
		self.leftKeyTimer.callback.append(self.leftTimerFire)

		self.currList = "filelist"
		self.isAudioCD = False
		self.AudioCD_albuminfo = {}
		self.cdAudioTrackFiles = []
		self.onShown.append(self.applySettings)

		self.playlistIOInternal = PlaylistIOInternal()
		list = self.playlistIOInternal.open(resolveFilename(SCOPE_CONFIG, "playlist.e2pls"))
		if list:
			for x in list:
				self.playlist.addFile(x.ref)
			self.playlist.updateList()

		self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
			{
				iPlayableService.evUpdatedInfo: self.__evUpdatedInfo,
				iPlayableService.evUser+10: self.__evAudioDecodeError,
				iPlayableService.evUser+11: self.__evVideoDecodeError,
				iPlayableService.evUser+12: self.__evPluginError,
				iPlayableService.evUser+13: self["coverArt"].embeddedCoverArt
			})
Ejemplo n.º 31
0
    def __init__(self,
                 session,
                 service,
                 restoreService=True,
                 infoCallback=None,
                 getNextService=None,
                 getPrevService=None,
                 stopCallback=None,
                 pauseCallback=None,
                 streamMode=False,
                 askBeforeLeaving=True):
        Screen.__init__(self, session)
        InfoBarBase.__init__(self)
        InfoBarSeek.__init__(self)
        InfoBarShowHide.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        InfoBarCueSheetSupport.__init__(self)
        InfoBarServiceErrorPopupSupport.__init__(self)
        InfoBarExtensions.__init__(self)
        InfoBarPlugins.__init__(self)
        InfoBarNotifications.__init__(self)
        #TODO FIX THIS HACK
        # currently we just want to be able to resume playback (if supported by e2),
        # for now we don't care about cutting or jumpmarks or anything like that...
        del self["CueSheetActions"]

        self.session = session
        self.service = service
        self.infoCallback = infoCallback
        self.getNextServiceCB = getNextService
        self.getPrevServiceCB = getPrevService
        self.stopCB = stopCallback
        self.pauseCB = pauseCallback
        self.callback = None
        self.screen_timeout = 5000
        self.nextservice = None
        self.is_closing = False

        if not restoreService:  # lastservice is handled by PlayerBase which is inherited by InfoBarSeek
            # take care... when a zap timer want to zap to a service the player is closed and lastservice is changed in onClose callback of PlayerBase!
            self.lastservice = None

        self.streamMode = streamMode

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "InfobarSeekActions", "MediaPlayerActions",
                "MovieSelectionActions"
            ], {
                "cancel": self.leavePlayer,
                "stop": self.leavePlayer,
                "playpauseService": self.playpause,
                "previous": self.playPrev,
                "next": self.playNext,
                "showEventInfo": self.showVideoInfo,
            }, -2)

        self.returning = False
        self._askBeforeLeaving = askBeforeLeaving

        self.onFirstExecBegin.append(self.play)
        self.onClose.append(self.__onClose)
Ejemplo n.º 32
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)
Ejemplo n.º 33
0
    def __init__(self, session, playlistCallback, nextItemCallback,
                 prevItemCallback, infoCallback, menuCallback):
        Screen.__init__(self, session)
        self.skinName = ['KodiVideoPlayer']
        statusScreen = self.session.instantiateDialog(StatusScreen)
        InfoBarBase.__init__(self, steal_current_service=True)
        SubsSupport.__init__(self, searchSupport=True, embeddedSupport=True)
        SubsSupportStatus.__init__(self)
        InfoBarSeek.__init__(self)
        InfoBarShowHide.__init__(self)
        InfoBarSubservicesSupport.__init__(self)
        InfoBarAspectChange.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarNotifications.__init__(self)
        HelpableScreen.__init__(self)
        self.playlistCallback = playlistCallback
        self.nextItemCallback = nextItemCallback
        self.prevItemCallback = prevItemCallback
        self.infoCallback = infoCallback
        self.menuCallback = menuCallback
        self.statusScreen = statusScreen
        self.defaultImage = None
        self.postAspectChange.append(self.showAspectChanged)
        self.__timer = eTimer()
        self.__timer.callback.append(self.__seekToPosition)
        self.__image = None
        self.__position = None
        self.__firstStart = True
        self["genre"] = Label()

        # load meta info from json file provided by Kodi Enigma2Player
        try:
            meta = json.load(open(KODIEXTIN, "r"))
        except Exception as e:
            self.logger.error("failed to load meta from %s: %s", KODIEXTIN,
                              str(e))
            meta = {}
        self.__image = Meta(meta).getImage()
        self["image"] = WebPixmap(self.__image, caching=True)

        self.genre = str(", ".join(Meta(meta).getGenre()))
        self.plot = Meta(meta).getPlot()

        self["genre"].setText(self.genre)

        # set title, image if provided
        self.title_ref = Meta(meta).getTitle()

        # set start position if provided
        self.setStartPosition(Meta(meta).getStartTime())

        self["directionActions"] = HelpableActionMap(
            self, "DirectionActions", {
                "downUp": (playlistCallback, _("Show playlist")),
                "upUp": (playlistCallback, _("Show playlist"))
            })

        self["okCancelActions"] = HelpableActionMap(self, "OkCancelActions",
                                                    {"cancel": self.close})

        self["actions"] = HelpableActionMap(
            self, "KodiPlayerActions", {
                "menuPressed": (menuCallback, _("Show playback menu")),
                "infoPressed": (infoCallback, _("Show playback info")),
                "nextPressed":
                (nextItemCallback, _("Skip to next item in playlist")),
                "prevPressed":
                (prevItemCallback, _("Skip to previous item in playlist")),
                "seekFwdManual":
                self.keyr,
                "seekBackManual":
                self.keyl
            })

        self.eventTracker = ServiceEventTracker(
            self, {
                iPlayableService.evStart: self.__evStart,
            })

        assert KodiVideoPlayer.instance is None, "class KodiVideoPlayer is a singleton class and just one instance of this class is allowed!"
        KodiVideoPlayer.instance = self

        self.onClose.append(
            boundFunction(self.session.deleteDialog, self.statusScreen))
        self.onClose.append(
            boundFunction(Notifications.RemovePopup, self.RESUME_POPUP_ID))
        self.onClose.append(self.__timer.stop)
Ejemplo n.º 34
0
	def __init__(self, session, server, currentList):
		Screen.__init__(self, session)
		InfoBarNotifications.__init__(self)
		InfoBarAudioSelection.__init__(self)
		self.server = server
		self.currentList = currentList
		self.skinName = "MoviePlayer"
		self.state = self.STATE_IDLE
		self.oldservice = self.session.screen["CurrentService"]
		self.oldNavService = self.session.nav.getCurrentlyPlayingServiceReference()
		self.session.nav.stopService()
		self.vlcservice = VlcService(self)
		self.session.screen["CurrentService"] = self.vlcservice
		self.hidetimer = eTimer()
		self.hidetimer.timeout.get().append(self.ok)
		self.onClose.append(self.__onClose)

		class VlcPlayerActionMap(ActionMap):
			def __init__(self, player, contexts = [ ], actions = { }, prio=0):
				ActionMap.__init__(self, contexts, actions, prio)
				self.player = player

			def action(self, contexts, action):
				if action[:5] == "seek:":
					time = int(action[5:])
					self.player.seekRelative(time)
					return 1
				elif action[:8] == "seekdef:":
					key = int(action[8:])
					time = [-config.seek.selfdefined_13.value, False, config.seek.selfdefined_13.value,
							-config.seek.selfdefined_46.value, False, config.seek.selfdefined_46.value,
							-config.seek.selfdefined_79.value, False, config.seek.selfdefined_79.value][key-1]
					self.player.seekRelative(time)
					return 1
				else:
					return ActionMap.action(self, contexts, action)

		self["actions"] = VlcPlayerActionMap(self, ["OkCancelActions", "TvRadioActions", "InfobarSeekActions", "MediaPlayerActions"],
		{
				"ok": self.ok,
				"cancel": self.stop,
				"keyTV": self.stop,
				"pauseService": self.pause,
				"unPauseService": self.play,
				"play": self.play,
				"seekFwd": self.seekFwd,
				"seekBack": self.seekBack,
				"seekFwdDown": self.seekFwd,
				"seekBackDown": self.seekBack,
				"seekFwdManual": self.seekManual,
				"seekBackManual": self.seekManual,
				"next": self.playNextFile,
				"previous": self.playPrevFile
			}, -2)

		print "[VLC] evEOF=%d" % iPlayableService.evEOF
		self.__event_tracker = ServiceEventTracker(screen = self, eventmap =
			{
				iPlayableService.evEOF: self.__evEOF,
				iPlayableService.evSOF: self.__evSOF
			})
Ejemplo n.º 35
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
Ejemplo n.º 36
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)
Ejemplo n.º 37
0
	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
Ejemplo n.º 38
0
    def __init__(self, session, args=None):
        Screen.__init__(self, session)
        InfoBarAudioSelection.__init__(self)
        InfoBarCueSheetSupport.__init__(self,
                                        actionmap="DivXPlayerCueSheetActions")
        InfoBarNotifications.__init__(self)
        InfoBarBase.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        HelpableScreen.__init__(self)

        self.container = eConsoleAppContainer()

        self.summary = None
        self.oldService = self.session.nav.getCurrentlyPlayingServiceReference(
        )
        self.session.nav.stopService()

        # 'None' is magic to start at the list of mountpoints
        self.filelist = FileList(
            None,
            matchingPattern="(?i)^.*\.(avi)",
            useServiceRef=True,
            additionalExtensions="4098:m3u 4098:e2pls 4098:pls")
        self["filelist"] = self.filelist

        self.is_closing = False
        self.delname = ""

        self.next_operation = ""
        self.lastServicePlayed = None
        self.current_service = None

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

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

        self.repeat = False
        self.seek_target = None

        class DivXPlayerActionMap(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, _("play divx file")),
                "cancel": (self.exit, _("exit divxplayer")),
            }, -2)

        self["DivXPlayerActions"] = HelpableActionMap(
            self, "DivXPlayerActions", {
                "play": (self.playEntry, _("play entry")),
                "pause": (self.pauseEntry, _("pause")),
                "stop": (self.stopEntry, _("stop entry")),
                "forward": (self.forwardEntry, _("forward entry")),
                "backward": (self.doNothing, _("backward entry")),
                "menu": (self.showMenu, _("menu")),
            }, -2)

        self["actions"] = DivXPlayerActionMap(
            self, ["DirectionActions"], {
                "right": self.right,
                "left": self.left,
                "up": self.up,
                "upRepeated": self.up,
                "upUp": self.doNothing,
                "down": self.down,
                "downRepeated": self.down,
                "downUp": self.doNothing,
            }, -2)

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

        self.onClose.append(self.__onClose)

        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={
                iPlayableService.evUser + 11: self.__evDecodeError,
                iPlayableService.evUser + 12: self.__evPluginError
            })
Ejemplo n.º 39
0
    def __init__(self, session, name, url):
        global SREF
        Screen.__init__(self, session)
        self.skinName = 'MoviePlayer'
        title = 'Play Stream'
        # self['list'] = MenuList([])
        InfoBarMenu.__init__(self)
        InfoBarNotifications.__init__(self)
        InfoBarBase.__init__(self, steal_current_service=True)
        TvInfoBarShowHide.__init__(self)
        InfoBarAudioSelection.__init__(self)
        # self.__event_tracker = ServiceEventTracker(screen = self, eventmap =
        # {
        # iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged,
        # iPlayableService.evStart: self.__serviceStarted,
        # iPlayableService.evEOF: self.__evEOF,
        # })

        # InfoBarSubtitleSupport.__init__(self)
        try:
            self.init_aspect = int(self.getAspect())
        except:
            self.init_aspect = 0

        self.new_aspect = self.init_aspect
        self['actions'] = ActionMap(
            [
                'WizardActions', 'MoviePlayerActions', 'MovieSelectionActions',
                'MediaPlayerActions', 'EPGSelectActions',
                'MediaPlayerSeekActions', 'SetupActions', 'ColorActions',
                'InfobarShowHideActions', 'InfobarActions',
                'InfobarSeekActions'
            ],
            {
                'leavePlayer': self.cancel,
                'epg': self.showIMDB,
                'info': self.showinfo,
                # 'info': self.cicleStreamType,
                'tv': self.cicleStreamType,
                'stop': self.leavePlayer,
                'cancel': self.cancel,
                'back': self.cancel
            },
            -1)
        self.allowPiP = False
        self.service = None
        service = None
        InfoBarSeek.__init__(self, actionmap='InfobarSeekActions')
        self.icount = 0
        # self.desc = desc
        self.pcip = 'None'
        self.url = url
        self.name = name
        # self.srefOld = self.session.nav.getCurrentlyPlayingServiceReference()
        self.state = self.STATE_PLAYING
        # self.hidetimer = eTimer()
        # self.hidetimer.timeout.get().append(self.ok)
        self.hideTimer = eTimer()
        self.hideTimer.start(5000, True)
        try:
            self.hideTimer_conn = self.hideTimer.timeout.connect(self.ok)
        except:
            self.hideTimer.callback.append(self.ok)
        self.srefOld = self.session.nav.getCurrentlyPlayingServiceReference()
        SREF = self.srefOld
        if '8088' in str(self.url):
            self.onLayoutFinish.append(self.slinkPlay)
        else:
            self.onLayoutFinish.append(self.cicleStreamType)
        self.onClose.append(self.cancel)
        # self.onClose.append(self.__onClose)
        return
Ejemplo n.º 40
0
    def __init__(self, session, streamurl, servicetype):
        Screen.__init__(self, session)

        self.session = session

        InfoBarBase.__init__(self)
        InfoBarMoviePlayerSummarySupport.__init__(self)
        InfoBarServiceNotifications.__init__(self)
        InfoBarShowHide.__init__(self)
        InfoBarSeek.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        IPTVInfoBarPVRState.__init__(self, PVRState, True)
        SubsSupport.__init__(self, searchSupport=True, embeddedSupport=True)
        SubsSupportStatus.__init__(self)

        self.streamurl = streamurl
        self.servicetype = servicetype

        skin = skin_path + 'vodplayer.xml'

        self["streamcat"] = StaticText()
        self["streamtype"] = StaticText()
        self["extension"] = StaticText()

        self.PicLoad = ePicLoad()
        self.Scale = AVSwitch().getFramebufferScale()
        try:
            self.PicLoad.PictureData.get().append(self.DecodePicture)
        except:
            self.PicLoad_conn = self.PicLoad.PictureData.connect(
                self.DecodePicture)

        self["cover"] = Pixmap()

        self["eventname"] = Label()
        self["state"] = Label()
        self["speed"] = Label()
        self["statusicon"] = MultiPixmap()

        self["PTSSeekBack"] = Pixmap()
        self["PTSSeekPointer"] = Pixmap()

        with open(skin, 'r') as f:
            self.skin = f.read()

        self.setup_title = _('VOD')

        self['actions'] = ActionMap(
            ["XStreamityActions"], {
                'cancel': self.back,
                'tv': self.toggleStreamType,
                'info': self.toggleStreamType,
                "channelUp": self.__next__,
                "channelDown": self.prev,
                "up": self.prev,
                "down": self.__next__,
                "stop": self.back,
                "red": self.back,
            }, -2)

        self.onFirstExecBegin.append(
            boundFunction(self.playStream, self.servicetype, self.streamurl))
Ejemplo n.º 41
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
Ejemplo n.º 42
0
    def __init__(self, session, server, currentList):
        Screen.__init__(self, session)
        InfoBarNotifications.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        self.server = server
        self.seek_time = 600
        self.currentList = currentList
        self.skinName = "MoviePlayer"
        self.state = self.STATE_IDLE
        self.oldservice = self.session.screen["CurrentService"]
        self.oldNavService = self.session.nav.getCurrentlyPlayingServiceReference(
        )
        self.session.nav.stopService()
        self.vlcservice = VlcService(self)
        self.session.screen["CurrentService"] = self.vlcservice
        self.hidetimer = eTimer()
        self.hidetimer.timeout.get().append(self.ok)
        self.onClose.append(self.__onClose)

        class VlcPlayerActionMap(ActionMap):
            def __init__(self, player, contexts=[], actions={}, prio=0):
                ActionMap.__init__(self, contexts, actions, prio)
                self.player = player

            def action(self, contexts, action):
                if action[:5] == "seek:":
                    time = int(action[5:])
                    self.player.seekRelative(time)
                    return 1
                elif action[:8] == "seekdef:":
                    key = int(action[8:])
                    time = [
                        -config.seek.selfdefined_13.value, False,
                        config.seek.selfdefined_13.value,
                        -config.seek.selfdefined_46.value, False,
                        config.seek.selfdefined_46.value,
                        -config.seek.selfdefined_79.value, False,
                        config.seek.selfdefined_79.value
                    ][key - 1]
                    self.player.seekRelative(time)
                    return 1
                else:
                    return ActionMap.action(self, contexts, action)

        self["actions"] = VlcPlayerActionMap(
            self, [
                "OkCancelActions", "TvRadioActions", "InfobarSeekActions",
                "MediaPlayerActions", "ChannelSelectEPGActions"
            ], {
                "ok": self.ok,
                "cancel": self.stop,
                "keyTV": self.stop,
                "stop": self.stop,
                "pauseService": self.pause,
                "playpauseService": self.pause,
                "unPauseService": self.play,
                "play": self.play,
                "seekFwd": self.seekFwd,
                "seekBack": self.seekBack,
                "seekFwdDown": self.seekFwd,
                "seekBackDown": self.seekBack,
                "seekFwdManual": self.seekManual,
                "seekBackManual": self.seekManual,
                "next": self.playNextFile,
                "previous": self.playPrevFile,
                "menu": self.openVCS,
                "showEPGList": self.choiceJumping,
                "subtitles": self.subtitleSelection
            }, -2)

        print("[VLC] evEOF=%d" % iPlayableService.evEOF)
        self.__event_tracker = ServiceEventTracker(screen=self,
                                                   eventmap={
                                                       iPlayableService.evEOF:
                                                       self.__evEOF,
                                                       iPlayableService.evSOF:
                                                       self.__evSOF
                                                   })
Ejemplo n.º 43
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)", 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
			})
Ejemplo n.º 44
0
	def __init__(self):
		InfoBarAudioSelection.__init__(self)
	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
Ejemplo n.º 46
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
Ejemplo n.º 47
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)
	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