Beispiel #1
0
	def __init__(self, session, service):
		Screen.__init__(self, session)
		InfoBarSeek.__init__(self)
		InfoBarCueSheetSupport.__init__(self)
		InfoBarBase.__init__(self, steal_current_service=True)
		
		self.session = session
		self.service = service
		self.working = False
		self.oldService = self.session.nav.getCurrentlyPlayingServiceReference()
		self.session.nav.playService(service)
		previewcreator.callback = self.grabDone
		
		desktopSize = getDesktop(0).size()
		self["video"] = VideoWindow(decoder=0, fb_width=desktopSize.width(), fb_height=desktopSize.height())
		self["seekState"] = Label()
		
		self.onPlayStateChanged.append(self.updateStateLabel)
		self.updateStateLabel(self.seekstate)
		
		self["actions"] = ActionMap(["OkCancelActions"],
			{
				"ok": self.grab,
				"cancel": self.exit
			}, -2)
	def __init__(self, session, service, mediatype):
		Screen.__init__(self, session)
		self.skinName = "MoviePlayer"
		InfoBarNotifications.__init__(self)
		if mediatype == 'rtl':
			InfoBarSeek.__init__(self)
		self.session = session
		self.service = service
		self.screen_timeout = 3000
		self.mediatype = mediatype
		self.__event_tracker = ServiceEventTracker(screen = self, eventmap =
			{
				iPlayableService.evStart: self.__serviceStarted,
				iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged,
				iPlayableService.evEOF: self.__evEOF,
			})
		self["actions"] = ActionMap(["OkCancelActions", "InfobarSeekActions", "MediaPlayerActions", "MovieSelectionActions"],
		{
				"ok": self.ok,
				"cancel": self.leavePlayer,
				"stop": self.handleLeave,
				"showEventInfo": self.showVideoInfo,
			}, -2)
		self.hidetimer = eTimer()
		self.hidetimer.timeout.get().append(self.ok)
		self.returning = False
		self.state = self.STATE_PLAYING
		self.lastseekstate = self.STATE_PLAYING
		self.onPlayStateChanged = [ ]
		self.play()
		self.onClose.append(self.__onClose)
	def __init__(self, session, 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
Beispiel #4
0
 def right(self):
     if self.servicelist and self.servicelist.dopipzap:
         if config.usage.oldstyle_zap_controls.value:
             self.switchChannelDown()
         else:
             self.zapDown()
     else:
         InfoBarSeek.seekFwd(self)
Beispiel #5
0
 def left(self):
     if self.servicelist and self.servicelist.dopipzap:
         if config.usage.oldstyle_zap_controls.value:
             self.switchChannelUp()
         else:
             self.zapUp()
     else:
         InfoBarSeek.seekBack(self)
Beispiel #6
0
	def right(self):
		if self.servicelist and self.servicelist.dopipzap:
			if config.usage.oldstyle_zap_controls.value:
				self.switchChannelDown()
			else:
				self.zapDown()
		else:
			InfoBarSeek.seekFwd(self)
Beispiel #7
0
	def left(self):
		if self.servicelist and self.servicelist.dopipzap:
			if config.usage.oldstyle_zap_controls.value:
				self.switchChannelUp()
			else:
				self.zapUp()
		else:
			InfoBarSeek.seekBack(self)
Beispiel #8
0
    def __init__(self, session, service):
        self.skin = CutListEditor.skin
        Screen.__init__(self, session)
        InfoBarSeek.__init__(self, actionmap="CutlistSeekActions")
        InfoBarCueSheetSupport.__init__(self)
        InfoBarBase.__init__(self, steal_current_service=True)
        HelpableScreen.__init__(self)
        self.old_service = session.nav.getCurrentlyPlayingServiceReference()
        session.nav.playService(service)

        service = session.nav.getCurrentService()
        cue = service and service.cueSheet()
        if cue is not None:
            # disable cutlists. we want to freely browse around in the movie
            print("cut lists disabled!")
            cue.setCutListEnable(0)

        self.downloadCuesheet()

        self["Timeline"] = ServicePositionGauge(self.session.nav)
        self["cutlist"] = List(self.getCutlist())
        self["cutlist"].onSelectionChanged.append(self.selectionChanged)
        self["SeekState"] = Label()
        self.onPlayStateChanged.append(self.updateStateLabel)
        self.updateStateLabel(self.seekstate)

        desktopSize = getDesktop(0).size()
        self["Video"] = VideoWindow(decoder=0,
                                    fb_width=desktopSize.width(),
                                    fb_height=desktopSize.height())

        self["actions"] = HelpableActionMap(
            self,
            "CutListEditorActions", {
                "setIn": (self.setIn, _("Make this mark an 'in' point")),
                "setOut": (self.setOut, _("Make this mark an 'out' point")),
                "setMark": (self.setMark, _("Make this mark just a mark")),
                "addMark": (self.__addMark, _("Add a mark")),
                "removeMark": (self.__removeMark, _("Remove a mark")),
                "removeAll":
                (self.__removeAll, _("Remove all cuts and marks")),
                "leave": (self.exit, _("Exit editor")),
                "showMenu": (self.showMenu, _("menu")),
            },
            prio=-4)

        self.tutorial_seen = False

        self.onExecBegin.append(self.showTutorial)
        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={iPlayableService.evCuesheetChanged: self.refillList})

        # to track new entries we save the last version of the cutlist
        self.last_cuts = self.getCutlist()
        self.cut_start = None
        self.inhibit_seek = False
        self.onClose.append(self.__onClose)
Beispiel #9
0
    def __init__(self, session, service):
        self.skin = CutListEditor.skin
        Screen.__init__(self, session)
        Screen.setTitle(self, _("Cutlist editor"))
        InfoBarSeek.__init__(self, actionmap="CutlistSeekActions")
        InfoBarCueSheetSupport.__init__(self)
        InfoBarBase.__init__(self, steal_current_service=True)
        HelpableScreen.__init__(self)
        self.old_service = session.nav.getCurrentlyPlayingServiceReference()
        session.nav.playService(service)

        service = session.nav.getCurrentService()
        cue = service and service.cueSheet()
        if cue is not None:
            # disable cutlists. we want to freely browse around in the movie
            print "cut lists disabled!"
            cue.setCutListEnable(0)

        self.downloadCuesheet()

        self["Timeline"] = ServicePositionGauge(self.session.nav)
        self["cutlist"] = List(self.getCutlist())
        self["cutlist"].onSelectionChanged.append(self.selectionChanged)
        self["SeekState"] = Label()
        self.onPlayStateChanged.append(self.updateStateLabel)
        self.updateStateLabel(self.seekstate)

        desktopSize = getDesktop(0).size()
        self["Video"] = VideoWindow(decoder=0, fb_width=desktopSize.width(), fb_height=desktopSize.height())

        self["actions"] = HelpableActionMap(
            self,
            "CutListEditorActions",
            {
                "setIn": (self.setIn, _("Make this mark an 'in' point")),
                "setOut": (self.setOut, _("Make this mark an 'out' point")),
                "setMark": (self.setMark, _("Make this mark just a mark")),
                "addMark": (self.__addMark, _("Add a mark")),
                "removeMark": (self.__removeMark, _("Remove a mark")),
                "leave": (self.exit, _("Exit editor")),
                "showMenu": (self.showMenu, _("menu")),
            },
            prio=-4,
        )

        self.tutorial_seen = False

        self.onExecBegin.append(self.showTutorial)
        self.__event_tracker = ServiceEventTracker(
            screen=self, eventmap={iPlayableService.evCuesheetChanged: self.refillList}
        )

        # to track new entries we save the last version of the cutlist
        self.last_cuts = self.getCutlist()
        self.cut_start = None
        self.inhibit_seek = False
        self.onClose.append(self.__onClose)
 def seekBackManual(self):
     if fileExists("%so" % SeekbarPlg) or fileExists("%sc" % SeekbarPlg):
         from Plugins.Extensions.Seekbar.plugin import Seekbar, seekbarBack
         Seekbar.keyOK = MVCkeyOK
         seekbarBack(self)
         Seekbar.keyOK = Seekbar.keyOK
     else:
         # InfoBarSeek
         InfoBarSeek.seekBackManual(self)
Beispiel #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)
Beispiel #12
0
 def keyl(self):
     try:
         if isPluginInstalled("TimeSleep"):
             from Plugins.Extensions.TimeSleep.plugin import timesleep
             timesleep(self, False)
         else:
             InfoBarSeek.seekBackManual(self)
     except:
         InfoBarSeek.seekBackManual(self)
Beispiel #13
0
    def __init__(self,
                 session,
                 service,
                 lastservice,
                 infoCallback=None,
                 nextCallback=None,
                 prevCallback=None):
        Screen.__init__(self, session)
        InfoBarNotifications.__init__(self)
        InfoBarSeek.__init__(self)
        self.session = session
        self.service = service
        self.infoCallback = infoCallback
        self.nextCallback = nextCallback
        self.prevCallback = prevCallback
        self.screen_timeout = 5000
        self.nextservice = None

        print "evEOF=%d" % iPlayableService.evEOF
        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={
                iPlayableService.evSeekableStatusChanged:
                self.__seekableStatusChanged,
                iPlayableService.evStart: self.__serviceStarted,
                iPlayableService.evEOF: self.__evEOF,
            })

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "InfobarSeekActions", "MediaPlayerActions",
                "MovieSelectionActions"
            ], {
                "ok": self.ok,
                "cancel": self.leavePlayer,
                "stop": self.leavePlayer,
                "playpauseService": self.playpauseService,
                "seekFwd": self.playNextFile,
                "seekBack": self.playPrevFile,
                "showEventInfo": self.showVideoInfo,
            }, -2)

        self.lastservice = lastservice

        self.hidetimer = eTimer()
        self.hidetimer_conn = self.hidetimer.timeout.connect(self.ok)
        self.returning = False

        self.state = self.STATE_PLAYING
        self.lastseekstate = self.STATE_PLAYING

        self.onPlayStateChanged = []
        self.__seekableStatusChanged()

        self.play()
        self.onClose.append(self.__onClose)
    def __init__(self, session, filelist, index, path, startslide):
        self.textcolor = config.plugins.mc_pp.textcolor.value
        self.bgcolor = config.plugins.mc_pp.bgcolor.value
        space = config.plugins.mc_pp.framesize.value
        size_w = getDesktop(0).size().width()
        size_h = getDesktop(0).size().height()
        self.skin = '<screen position="0,0" size="' + str(size_w) + ',' + str(size_h) + '" flags="wfNoBorder" > \t\t\t<eLabel position="0,0" zPosition="0" size="' + str(size_w) + ',' + str(size_h) + '" backgroundColor="' + self.bgcolor + '" /><widget name="pic" position="' + str(space) + ',' + str(space) + '" size="' + str(size_w - space * 2) + ',' + str(size_h - space * 2) + '" zPosition="1" alphatest="on" /> \t\t\t<widget name="point" position="' + str(space + 5) + ',' + str(space + 2) + '" size="20,20" zPosition="2" pixmap="skin_default/icons/record.png" alphatest="on" /> \t\t\t<widget name="play_icon" position="' + str(space + 25) + ',' + str(space + 2) + '" size="20,20" zPosition="2" pixmap="skin_default/icons/ico_mp_play.png"  alphatest="on" /> \t\t\t<widget name="file" position="' + str(space + 45) + ',' + str(space) + '" size="' + str(size_w - space * 2 - 50) + ',25" font="Regular;20" halign="left" foregroundColor="' + self.textcolor + '" zPosition="2" noWrap="1" transparent="1" /></screen>'
        Screen.__init__(self, session)
        InfoBarBase.__init__(self)
        InfoBarSeek.__init__(self, actionmap='MediaPlayerSeekActions')
        self['actions'] = ActionMap(['OkCancelActions',
         'ColorActions',
         'DirectionActions',
         'MovieSelectionActions'], {'cancel': self.Exit,
         'green': self.PlayPause,
         'yellow': self.PlayPause,
         'blue': self.nextPic,
         'red': self.prevPic,
         'left': self.prevPic,
         'right': self.nextPic,
         'showEventInfo': self.StartExif}, -1)
        self['point'] = Pixmap()
        self['pic'] = Pixmap()
        self['play_icon'] = Pixmap()
        self['file'] = Label(_('please wait, loading picture...'))
        self.old_index = 0
        self.filelist = []
        self.lastindex = index
        self.currPic = []
        self.shownow = True
        self.dirlistcount = 0
        for x in filelist:
            if len(filelist[0]) == 3:
                if x[0][1] == False:
                    self.filelist.append(path + x[0][0])
                else:
                    self.dirlistcount += 1
            else:
                self.filelist.append(x[T_FULL])

        self.maxentry = len(self.filelist) - 1
        self.index = index - self.dirlistcount
        if self.index < 0:
            self.index = 0
        self.picload = ePicLoad()
        self.picload.PictureData.get().append(self.finish_decode)
        self.slideTimer = eTimer()
        self.slideTimer.callback.append(self.slidePic)
        if self.maxentry >= 0:
            self.onLayoutFinish.append(self.setPicloadConf)
        self.__event_tracker = ServiceEventTracker(screen=self, eventmap={iPlayableService.evEOF: self.doEOF})
        if startslide == True:
            self.PlayPause()
            if config.plugins.mc_pp.musicenable.value == True and config.plugins.mc_pp.music.value != 'none':
                if pathExists(config.plugins.mc_pp.music.value):
                    self.session.nav.playService(eServiceReference(4097, 0, config.plugins.mc_pp.music.value))
Beispiel #15
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))
Beispiel #16
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)
 def doSeek(self, pts):
     length = self.getSeekLength()
     if length and length < pts:
         # PTS is behind the movie length
         self.doSeekEOF()
     else:
         # Call baseclass function
         InfoBarSeek.doSeek(self, pts)
         if pts and config.usage.show_infobar_on_skip.value:
             # InfoBarSeek
             self.showAfterSeek()
Beispiel #18
0
 def __init__(self, session, player_callback):
     Screen.__init__(self, session)
     self.skinName = ["ArchivCZSKMoviePlayer", "MoviePlayer"]
     InfoBarBase.__init__(self)
     InfoBarShowHide.__init__(self)
     InfoBarSeek.__init__(self)
     # disable slowmotion/fastforward
     self.seekFwd = self.seekFwdManual
     self.seekBack = self.seekBackManual
     initSubsSettings()
     SubsSupport.__init__(self,
                          defaultPath=config_archivczsk.tmpPath.value,
                          forceDefaultPath=True,
                          searchSupport=True,
                          embeddedSupport=True,
                          preferEmbedded=True)
     SubsSupportStatus.__init__(self)
     InfoBarAudioSelectionNoSubtitles.__init__(self)
     InfoBarNotifications.__init__(self)
     InfoBarSubservicesSupport.__init__(self)
     InfoBarAspectChange.__init__(self)
     self.postAspectChange.append(self.__aspect_changed)
     HelpableScreen.__init__(self)
     self.status_dialog = self.session.instantiateDialog(StatusScreen)
     self.player_callback = player_callback
     self.__timer = eTimer()
     self.__timer_conn = eConnectCallback(self.__timer.timeout,
                                          self.__pts_available)
     self.__subtitles_url = None
     self.__resume_time_sec = None
     self["actions"] = HelpableActionMap(
         self, "ArchivCZSKMoviePlayerActions", {
             "showPlaylist": (boundFunction(self.player_callback, (
                 "playlist",
                 "show",
             )), _("Show playlist")),
             "nextEntry": (boundFunction(self.player_callback, (
                 "playlist",
                 "next",
             )), _("Play next entry in playlist")),
             "prevEntry": (boundFunction(self.player_callback, (
                 "playlist",
                 "prev",
             )), _("Play previous entry in playlist")),
             "cancel": (boundFunction(self.player_callback,
                                      ("exit", )), _("Exit player")),
         }, -2)
     self.__event_tracker = ServiceEventTracker(
         screen=self,
         eventmap={
             iPlayableService.evStart: self.__service_started,
         })
     self.onClose.append(self.__on_close)
Beispiel #19
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)
Beispiel #20
0
    def __init__(self, session):
        Screen.__init__(self, session)
        InfoBarBase.__init__(self, steal_current_service=True)
        InfoBarSeek.__init__(self, actionmap="CutlistSeekActions")
        HelpableScreen.__init__(self)
        self.old_service = session.nav.getCurrentlyPlayingServiceReference()
        self.session.nav.stopService()

        self["key_red"] = StaticText(_("Exit"))
        self["key_green"] = StaticText(_("Play"))
        self["key_yellow"] = StaticText((""))
        self["key_blue"] = StaticText(_("Fullscreen"))
        self["connection_label"] = MultiColorLabel()
        self["do_blink"] = Boolean(False)
        self["pig_mode"] = Boolean(True)

        self["poster"] = Pixmap()
        self.picload = ePicLoad()
        self.picload_conn = self.picload.PictureData.connect(
            self.paintPosterPixmapCB)

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "ColorActions", "InfobarSeekActions",
                "MediaPlayerActions"
            ], {
                "ok": self.keyOK,
                "cancel": self.exit,
                "stop": self.disconnect,
                "playpauseService": self.playpauseService,
                "red": self.exit,
                "green": self.keyOK,
                "blue": self.keyBlue,
                "yellow": self.keyYellow,
                "seekFwd": self.keyPass
            }, -4)

        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={
                iPlayableService.evStart: self.__serviceStarted,
                iPlayableService.evUpdatedEventInfo: self.__streamStarted,
                iPlayableService.evTuneFailed: self.__streamFailed,
                iPlayableService.evEOF: self.__evEOF,
                iPlayableService.evUser + 15: self.__streamFailed
            })

        self.onClose.append(self.__onClose)
        self.onExecBegin.append(self.__onExecBegin)

        self.setState(self.STATE_DISCONNECTED)
Beispiel #21
0
    def __init__(self, session):
        Screen.__init__(self, session)
        InfoBarBase.__init__(self, steal_current_service=True)
        InfoBarSeek.__init__(self, actionmap="CutlistSeekActions")
        HelpableScreen.__init__(self)
        self.old_service = session.nav.getCurrentlyPlayingServiceReference()
        self.session.nav.stopService()

        self["key_red"] = StaticText(_("Exit"))
        self["key_green"] = StaticText(_("Play"))
        self["key_yellow"] = StaticText((""))
        self["key_blue"] = StaticText(_("Fullscreen"))
        self["connection_label"] = MultiColorLabel()
        self["do_blink"] = Boolean(False)
        self["pig_mode"] = Boolean(True)

        self["poster"] = Pixmap()
        self.picload = ePicLoad()
        self.picload.PictureData.get().append(self.paintPosterPixmapCB)

        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions", "InfobarSeekActions", "MediaPlayerActions"],
            {
                "ok": self.keyOK,
                "cancel": self.exit,
                "stop": self.disconnect,
                "playpauseService": self.playpauseService,
                "red": self.exit,
                "green": self.keyOK,
                "blue": self.keyBlue,
                "yellow": self.keyYellow,
                "seekFwd": self.keyPass,
            },
            -4,
        )

        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={
                iPlayableService.evStart: self.__serviceStarted,
                iPlayableService.evUpdatedEventInfo: self.__streamStarted,
                iPlayableService.evTuneFailed: self.__streamFailed,
                iPlayableService.evEOF: self.__evEOF,
                iPlayableService.evUser + 15: self.__streamFailed,
            },
        )

        self.onClose.append(self.__onClose)
        self.onExecBegin.append(self.__onExecBegin)

        self.setState(self.STATE_DISCONNECTED)
Beispiel #22
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"]
Beispiel #23
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"]
    def doSeekEOF(self):
        # Stop one second before eof : 1 * 90 * 1000
        state = self.seekstate
        play = self.getSeekPlayPosition()
        length = self.getSeekLength()
        end = length and length - 2 * 90000

        # Validate play and end values
        if play and end and play < end and 0 < end:
            # InfoBarSeek
            InfoBarSeek.doSeek(self, end)

        # If player is in pause mode do not call eof
        if state != self.SEEK_STATE_PAUSE:
            InfoBarSeek._InfoBarSeek__evEOF(self)
Beispiel #25
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)
Beispiel #26
0
	def __init__(self, session, master):
		MediaGUI.__init__(self, session, master)
		InfoBarNotifications.__init__(self)
		InfoBarSeek.__init__(self)
		self.setTitle(_("UPnP/DLNA Audio Player"))

		self["artist"] = Label("")
		self["title"] = Label("")
		self["album"] = Label("")
		self["year"] = Label("")
		self["genre"] = Label("")
		self["coverArt"] = MediaPixmap()

		self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
			{
				iPlayableService.evUser + 13: self["coverArt"].embeddedCoverArt
			})
Beispiel #27
0
	def __init__(self, session, service, lastservice, infoCallback = None, nextCallback = None, prevCallback = None):
		Screen.__init__(self, session)
		InfoBarNotifications.__init__(self)
		InfoBarSeek.__init__(self)
		self.session = session
		self.service = service
		self.infoCallback = infoCallback
		self.nextCallback = nextCallback
		self.prevCallback = prevCallback
		self.screen_timeout = 5000
		self.nextservice = None

		print "evEOF=%d" % iPlayableService.evEOF
		self.__event_tracker = ServiceEventTracker(screen = self, eventmap =
			{
				iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged,
				iPlayableService.evStart: self.__serviceStarted,
				iPlayableService.evEOF: self.__evEOF,
			})

		self["actions"] = ActionMap(["OkCancelActions", "InfobarSeekActions", "MediaPlayerActions", "MovieSelectionActions"],
		{
				"ok": self.ok,
				"cancel": self.leavePlayer,
				"stop": self.leavePlayer,
				"playpauseService": self.playpauseService,
				"seekFwd": self.playNextFile,
				"seekBack": self.playPrevFile,
				"showEventInfo": self.showVideoInfo,
			}, -2)


		self.lastservice = lastservice

		self.hidetimer = eTimer()
		self.hidetimer_conn = self.hidetimer.timeout.connect(self.ok)
		self.returning = False

		self.state = self.STATE_PLAYING
		self.lastseekstate = self.STATE_PLAYING

		self.onPlayStateChanged = [ ]
		self.__seekableStatusChanged()

		self.play()
		self.onClose.append(self.__onClose)
Beispiel #28
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)
Beispiel #29
0
 def __init__(self, session, player_callback):
     Screen.__init__(self, session)
     self.skinName = ["ArchivCZSKMoviePlayer", "MoviePlayer"]
     InfoBarBase.__init__(self)
     InfoBarShowHide.__init__(self)
     InfoBarSeek.__init__(self)
     # disable slowmotion/fastforward
     self.seekFwd = self.seekFwdManual
     self.seekBack = self.seekBackManual
     initSubsSettings()
     SubsSupport.__init__(self, 
             defaultPath = config_archivczsk.tmpPath.value,
             forceDefaultPath = True,
             searchSupport = True)
     SubsSupportStatus.__init__(self)
     InfoBarAudioSelectionNoSubtitles.__init__(self)
     InfoBarNotifications.__init__(self)
     InfoBarSubservicesSupport.__init__(self)
     InfoBarAspectChange.__init__(self)
     self.postAspectChange.append(self.__aspect_changed)
     HelpableScreen.__init__(self)
     self.status_dialog = self.session.instantiateDialog(StatusScreen)
     self.player_callback = player_callback
     self.__timer = eTimer()
     self.__timer_conn = eConnectCallback(self.__timer.timeout, self.__pts_available)
     self.__subtitles_url = None
     self.__resume_time_sec = None
     self["actions"] = HelpableActionMap(self, "ArchivCZSKMoviePlayerActions",
             {"showPlaylist": (boundFunction(self.player_callback, ("playlist", "show",)),
                 _("Show playlist")),
                 "nextEntry":(boundFunction(self.player_callback, ("playlist", "next",)),
                     _("Play next entry in playlist")),
                 "prevEntry":(boundFunction(self.player_callback, ("playlist", "prev",)),
                     _("Play previous entry in playlist")),
                 "cancel":(boundFunction(self.player_callback, ("exit",)),
                     _("Exit player")),
             }, -2)
     self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
     {
         iPlayableService.evStart: self.__service_started,
     })
     self.onClose.append(self.__on_close)
Beispiel #30
0
    def left(self):
        slist = self.servicelist
        if slist and slist.dopipzap:
            if slist.inBouquet():
                prev = slist.getCurrentSelection()
                if prev:
                    prev = prev.toString()
                    while True:
                        if config.usage.quickzap_bouquet_change.value:
                            if slist.atBegin():
                                slist.prevBouquet()
                        slist.moveUp()
                        cur = slist.getCurrentSelection()
                        if not cur or not cur.flags & 64 or cur.toString() == prev:
                            break

            else:
                slist.moveUp()
            slist.zap(enable_pipzap=True)
        else:
            InfoBarSeek.seekBack(self)
Beispiel #31
0
	def left(self):
		slist = self.servicelist
		if slist and slist.dopipzap:
			# XXX: We replicate InfoBarChannelSelection.zapUp here - we shouldn't do that
			if slist.inBouquet():
				prev = slist.getCurrentSelection()
				if prev:
					prev = prev.toString()
					while True:
						if config.usage.quickzap_bouquet_change.value:
							if slist.atBegin():
								slist.prevBouquet()
						slist.moveUp()
						cur = slist.getCurrentSelection()
						if not cur or (not (cur.flags & 64)) or cur.toString() == prev:
							break
			else:
				slist.moveUp()
			slist.zap(enable_pipzap = True)
		else:
			InfoBarSeek.seekBack(self)
Beispiel #32
0
	def left(self):
		slist = self.servicelist
		if slist and slist.dopipzap:
			# XXX: We replicate InfoBarChannelSelection.zapUp here - we shouldn't do that
			if slist.inBouquet():
				prev = slist.getCurrentSelection()
				if prev:
					prev = prev.toString()
					while True:
						if config.usage.quickzap_bouquet_change.value:
							if slist.atBegin():
								slist.prevBouquet()
						slist.moveUp()
						cur = slist.getCurrentSelection()
						if not cur or (not (cur.flags & 64)) or cur.toString() == prev:
							break
			else:
				slist.moveUp()
			slist.zap(enable_pipzap=True)
		else:
			InfoBarSeek.seekBack(self)
Beispiel #33
0
	def right(self):
		# XXX: gross hack, we do not really seek if changing channel in pip :-)
		slist = self.servicelist
		if slist and slist.dopipzap:
			# XXX: We replicate InfoBarChannelSelection.zapDown here - we shouldn't do that
			if slist.inBouquet():
				prev = slist.getCurrentSelection()
				if prev:
					prev = prev.toString()
					while True:
						if config.usage.quickzap_bouquet_change.value and slist.atEnd():
							slist.nextBouquet()
						else:
							slist.moveDown()
						cur = slist.getCurrentSelection()
						if not cur or (not (cur.flags & 64)) or cur.toString() == prev:
							break
			else:
				slist.moveDown()
			slist.zap(enable_pipzap=True)
		else:
			InfoBarSeek.seekFwd(self)
Beispiel #34
0
	def right(self):
		# XXX: gross hack, we do not really seek if changing channel in pip :-)
		slist = self.servicelist
		if slist and slist.dopipzap:
			# XXX: We replicate InfoBarChannelSelection.zapDown here - we shouldn't do that
			if slist.inBouquet():
				prev = slist.getCurrentSelection()
				if prev:
					prev = prev.toString()
					while True:
						if config.usage.quickzap_bouquet_change.value and slist.atEnd():
							slist.nextBouquet()
						else:
							slist.moveDown()
						cur = slist.getCurrentSelection()
						if not cur or (not (cur.flags & 64)) or cur.toString() == prev:
							break
			else:
				slist.moveDown()
			slist.zap(enable_pipzap = True)
		else:
			InfoBarSeek.seekFwd(self)
Beispiel #35
0
    def left(self):
        slist = self.servicelist
        if slist and slist.dopipzap:
            if slist.inBouquet():
                prev = slist.getCurrentSelection()
                if prev:
                    prev = prev.toString()
                    while True:
                        if config.usage.quickzap_bouquet_change.value:
                            if slist.atBegin():
                                slist.prevBouquet()
                        slist.moveUp()
                        cur = slist.getCurrentSelection()
                        if not cur or not cur.flags & 64 or cur.toString(
                        ) == prev:
                            break

            else:
                slist.moveUp()
            slist.zap(enable_pipzap=True)
        else:
            InfoBarSeek.seekBack(self)
Beispiel #36
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)
Beispiel #37
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
			})
	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
Beispiel #39
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
Beispiel #40
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
Beispiel #41
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))
Beispiel #42
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)
	def __init__(self, session, filelist, index, path, startslide):
		self.textcolor = config.plugins.mc_pp.textcolor.value
		self.bgcolor = config.plugins.mc_pp.bgcolor.value
		space = config.plugins.mc_pp.framesize.value
		size_w = getDesktop(0).size().width()
		size_h = getDesktop(0).size().height()

		self.skin = "<screen position=\"0,0\" size=\"" + str(size_w) + "," + str(size_h) + "\" flags=\"wfNoBorder\" > \
			<eLabel position=\"0,0\" zPosition=\"0\" size=\""+ str(size_w) + "," + str(size_h) + "\" backgroundColor=\""+ self.bgcolor +"\" /><widget name=\"pic\" position=\"" + str(space) + "," + str(space) + "\" size=\"" + str(size_w-(space*2)) + "," + str(size_h-(space*2)) + "\" zPosition=\"1\" alphatest=\"on\" /> \
			<widget name=\"point\" position=\""+ str(space+5) + "," + str(space+2) + "\" size=\"20,20\" zPosition=\"2\" pixmap=\"icons/record.png\" alphatest=\"on\" /> \
			<widget name=\"play_icon\" position=\""+ str(space+25) + "," + str(space+2) + "\" size=\"20,20\" zPosition=\"2\" pixmap=\"icons/ico_mp_play.png\"  alphatest=\"on\" /> \
			<widget name=\"file\" position=\""+ str(space+45) + "," + str(space) + "\" size=\""+ str(size_w-(space*2)-50) + ",25\" font=\"Regular;20\" halign=\"left\" foregroundColor=\"" + self.textcolor + "\" zPosition=\"2\" noWrap=\"1\" transparent=\"1\" /></screen>"

		Screen.__init__(self, session)
		InfoBarBase.__init__(self)
		InfoBarSeek.__init__(self, actionmap = "MediaPlayerSeekActions")
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions", "MovieSelectionActions"],
		{
			"cancel": self.Exit,
			"green": self.PlayPause,
			"yellow": self.PlayPause,
			"blue": self.nextPic,
			"red": self.prevPic,
			"left": self.prevPic,
			"right": self.nextPic,
			"showEventInfo": self.StartExif,
		}, -1)
		self["point"] = Pixmap()
		self["pic"] = Pixmap()
		self["play_icon"] = Pixmap()
		self["file"] = Label(_("please wait, loading picture..."))

		self.old_index = 0
		self.filelist = []
		self.lastindex = index
		self.currPic = []
		self.shownow = True
		self.dirlistcount = 0

		for x in filelist:
			if len(filelist[0]) == 3: #orig. filelist
				if x[0][1] == False:
					self.filelist.append(path + x[0][0])
				else:
					self.dirlistcount += 1
			else: # thumbnaillist
				self.filelist.append(x[T_FULL])

		self.maxentry = len(self.filelist)-1
		self.index = index - self.dirlistcount
		if self.index < 0:
			self.index = 0

		self.picload = ePicLoad()
		self.picload.PictureData.get().append(self.finish_decode)

		self.slideTimer = eTimer()
		self.slideTimer.callback.append(self.slidePic)

		if self.maxentry >= 0:
			self.onLayoutFinish.append(self.setPicloadConf)
		self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
			{
				iPlayableService.evEOF: self.doEOF,
			})
		if startslide == True:
			self.PlayPause();
			if config.plugins.mc_pp.musicenable.value == True and config.plugins.mc_pp.music.value != "none":
				if pathExists(config.plugins.mc_pp.music.value):
					self.session.nav.playService(eServiceReference(4097,0,config.plugins.mc_pp.music.value))
Beispiel #44
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
			})
Beispiel #45
0
	def __init__(self, session):
		self.session = session
		Screen.__init__(self, session)
		self.CurrentService = self.session.nav.getCurrentlyPlayingServiceReference()
		self.session.nav.stopService()
		self["cover"] = Cover()
		self["key_red"] = StaticText(_("Record"))
		self["key_green"] = StaticText(_("Genres"))
		self["key_yellow"] = StaticText(_("Stations"))
		self["key_blue"] = StaticText(_("Favorites"))
		self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
			{
				iPlayableService.evUpdatedInfo: self.__evUpdatedInfo,
				iPlayableService.evUser+10: self.__evAudioDecodeError,
				iPlayableService.evUser+12: self.__evPluginError
			})
		InfoBarSeek.__init__(self, actionmap = "MediaPlayerSeekActions")
		self.mode = self.FAVORITELIST
		self["list"] = SHOUTcastList()
		self["list"].connectSelChanged(self.onSelectionChanged)
		self["statustext"] = Label(_("Getting SHOUTcast genre list..."))
		self["actions"] = ActionMap(["WizardActions", "DirectionActions", "ColorActions", "EPGSelectActions"],
		{
			"ok": self.ok_pressed,
			"back": self.close,
			"input_date_time": self.menu_pressed,
			"red": self.red_pressed,
			"green": self.green_pressed,
			"yellow": self.yellow_pressed,
			"blue": self.blue_pressed,
			
		}, -1)
		self.stationList = []
		self.stationListIndex = 0
		self.genreList = []
		self.genreListIndex = 0
		self.favoriteList = []
		self.favoriteListIndex = 0

		self.favoriteConfig = Config()
		if os.path.exists(self.FAVORITE_FILE):
			self.favoriteConfig.loadFromFile(self.FAVORITE_FILE)
		else:
			self.favoriteConfig.loadFromFile(self.FAVORITE_FILE_DEFAULT)
		self.favoriteConfig.entriescount =  ConfigInteger(0)
		self.favoriteConfig.Entries = ConfigSubList()
		self.initFavouriteConfig()
		self.stationListXML = ""
		self["titel"] = Label()
		self["station"] = Label()
		self["headertext"] = Label()
		self["console"] = Label()
		self.headerTextString = ""
		self.stationListHeader = ""
		self.tunein = ""
		self.searchSHOUTcastString = ""
		self.currentStreamingURL = ""
		self.currentStreamingStation = ""
		self.stationListURL = ""
		self.onClose.append(self.__onClose)
		self.onLayoutFinish.append(self.getFavoriteList)

		self.reloadStationListTimer = eTimer()
		self.reloadStationListTimer.timeout.get().append(self.reloadStationListTimerTimeout)
		self.reloadStationListTimerVar = int(config.plugins.shoutcast.reloadstationlist.value)

		self.visible = True

		global containerStreamripper
		if containerStreamripper is None:
			containerStreamripper = eConsoleAppContainer()

		containerStreamripper.dataAvail.append(self.streamripperDataAvail)
		containerStreamripper.appClosed.append(self.streamripperClosed)

		if containerStreamripper.running():
			self["key_red"].setText(_("Stop record"))
			# just to hear to recording music when starting the plugin...
			self.currentStreamingStation = _("Recording stream station")
			self.playServiceStream("http://localhost:9191")
 def __init__(self, session):
     Screen.__init__(self, session)
     HelpableScreen.__init__(self)
     InfoBarNotifications.__init__(self)
     InfoBarBase.__init__(self)
     InfoBarSeek.__init__(self, actionmap="MediaPlayerSeekActions")
     self.isVisible = True
     self.oldService = self.session.nav.getCurrentlyPlayingServiceReference()
     self.session.nav.stopService()
     self.playlistparsers = {}
     self.addPlaylistParser(PlaylistIOM3U, "m3u")
     self.playlist = MyPlayList()
     self["fileinfo"] = Label()
     self["key_red"] = Button(_("Delete"))
     self["key_green"] = Button(_(""))
     self["key_yellow"] = Button("Favorites")
     self["key_blue"] = Button(_("Settings"))
     self["currentfolder"] = Label("")
     self["currentfavname"] = Label("")
     self.currList = "filelist"
     self.curfavfolder = -1
     self["actions"] = HelpableActionMap(
         self,
         "EVOMC_VideoPlayerActions",
         {
             "ok": (self.KeyOk, "Play selected file"),
             "left": (self.leftUp, "List Top"),
             "right": (self.rightDown, "List Bottom"),
             "up": (self.up, "List up"),
             "down": (self.down, "List down"),
             "menu": (self.KeyMenu, "File / Folder Options"),
             "video": (self.visibility, "Show / Hide Player"),
             "nextBouquet": (self.NextFavFolder, "Next Favorite Folder"),
             "prevBouquet": (self.PrevFavFolder, "Previous Favorite Folder"),
             "stop": (self.StopPlayback, "Stop Playback"),
             "red": (self.deleteFile, "Delete File"),
             "yellow": (self.FavoriteFolders, "Favorite Folders"),
             # 				"green": (self.showPreview, "Preview"),
             "blue": (self.KeySettings, "Settings"),
         },
         -2,
     )
     self["InfobarShowHideActions"] = HelpableActionMap(
         self, "InfobarShowHideActions", {"toggleShow": (self.showFileInfo, "Show File Info")}, -2
     )
     self["OkCancelActions"] = HelpableActionMap(
         self, "OkCancelActions", {"cancel": (self.Exit, "Exit Video Player")}, -2
     )
     self.aspect = getAspect()
     currDir = config.plugins.EVOMC_vp.lastDir.value
     if not pathExists(currDir):
         currDir = "/"
     self["currentfolder"].setText(str(currDir))
     if pathExists("/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer") is True:
         self.filelist = FileList(
             currDir,
             useServiceRef=True,
             showDirectories=True,
             showFiles=True,
             matchingPattern="(?i)^.*\.(mp4|ts|trp|wmv|mpg|vob|avi|mkv|dat|flac|m2ts|trp|flv)",
         )
     else:
         self.filelist = FileList(
             currDir,
             useServiceRef=True,
             showDirectories=True,
             showFiles=True,
             matchingPattern="(?i)^.*\.(mp4|ts|trp|wmv|mpg|vob|avi|mkv|dat|flac|m2ts|trp|flv)",
         )
     self["filelist"] = self.filelist
     self["thumbnail"] = Pixmap()
     evfd.getInstance().vfd_write_string("EVO-VIDEOPLAYER")
     # 		self.filelist.refresh()
     # 		self.ThumbTimer = eTimer()
     # 		self.ThumbTimer.callback.append(self.showThumb)
     # 		self.ThumbTimer.start(config.plugins.EVOMC_vp.preview_delay.getValue() * 1000, True)
     # 		self.filelistTimer = eTimer()
     # 		self.filelistTimer.callback.append(self.filelist.refresh())
     # 		self.filelistTimer.start(60, True)
     self.DimmerTimer = eTimer()
     self.DimmerTimer.callback.append(self.showDimmer)
     self.DimmerTimer.start(config.plugins.EVOMC_all.dimmer_delay.getValue() * 1000, True)
     self.__event_tracker = ServiceEventTracker(
         screen=self,
         eventmap={
             iPlayableService.evUser + 11: self.__evDecodeError,
             iPlayableService.evUser + 12: self.__evPluginError,
         },
     )
	def __init__(self, session, dvd_device = None, dvd_filelist = [ ], args = None):
		Screen.__init__(self, session)
		InfoBarBase.__init__(self)
		InfoBarNotifications.__init__(self)
		InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions")
		InfoBarShowHide.__init__(self)
		InfoBarAudioSelection.__init__(self)
		InfoBarSubtitleSupport.__init__(self)
		HelpableScreen.__init__(self)
		self.save_infobar_seek_config()
		self.change_infobar_seek_config()
		InfoBarSeek.__init__(self)
		InfoBarPVRState.__init__(self)
		self.dvdScreen = self.session.instantiateDialog(DVDOverlay)
		
		self.skinName = ["AZDVDPlayer", "DVDPlayer" ]

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

		self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
			{
				iPlayableService.evStopped: self.__serviceStopped,
				iPlayableService.evStart: self.__serviceStarted,
				iPlayableService.evUser+3: self.__osdFFwdInfoAvail,
				iPlayableService.evUser+4: self.__osdFBwdInfoAvail,
				iPlayableService.evUser+6: self.__osdAudioInfoAvail,
				iPlayableService.evUser+7: self.__osdSubtitleInfoAvail,
				iPlayableService.evUser+8: self.__chapterUpdated,
				iPlayableService.evUser+9: self.__titleUpdated,
				iPlayableService.evUser+11: self.__menuOpened,
				iPlayableService.evUser+12: self.__menuClosed,
				iPlayableService.evUser+13: self.__osdAngleInfoAvail
			})

		self["DVDPlayerDirectionActions"] = ActionMap(["DirectionActions"],
			{
				#MENU KEY DOWN ACTIONS
				"left": self.keyLeft,
				"right": self.keyRight,
				"up": self.keyUp,
				"down": self.keyDown,

				#MENU KEY REPEATED ACTIONS
				"leftRepeated": self.doNothing,
				"rightRepeated": self.doNothing,
				"upRepeated": self.doNothing,
				"downRepeated": self.doNothing,

				#MENU KEY UP ACTIONS
				"leftUp": self.doNothing,
				"rightUp": self.doNothing,
				"upUp": self.doNothing,
				"downUp": self.doNothing,
			})

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

		self["DVDPlayerPlaybackActions"] = HelpableActionMap(self, "AZDVDPlayerActions",
			{
				#DVDPLAYER OWN ACTIONS
				"stop": (self.stop, _("exit DVD player")),
				"toggleInfo": (self.toggleInfo, _("toggle time, chapter, audio, subtitle info")),
				"dvdMenu": (self.menu, _("show DVD main menu")),
				"nextChapter": (self.nextChapter, _("forward to the next chapter")),
				"prevChapter": (self.prevChapter, _("rewind to the previous chapter")),
				"nextTitle": (self.nextTitle, _("jump forward to the next title")),
				"prevTitle": (self.prevTitle, _("jump back to the previous title")),
				"nextAudioTrack": (self.nextAudioTrack, _("switch to the next audio track")),
				"SubtitleSelection": (self.subtitleSelection, _("switch to the next subtitle language")),
				"nextSubtitleTrack": (self.nextSubtitleTrack, _("switch to the next subtitle language")),
				"nextAngle": (self.nextAngle, _("switch to the next angle")),
				"seekBeginning": self.seekBeginning,
								
				#Actions linked to inforbarseek
				"pause": (self.playpauseService, _("Pause / Resume")),
				"seekFwd": (self.seekFwd, _("Seek forward")),
				"seekBwd": (self.seekBack, _("Seek backward")),
				
				#Actions from infobaraudioselection
				"AudioSelection": (self.audioSelection, _("Select audio track")),				
			}, -2)
			
		self["NumberActions"] = NumberActionMap( [ "NumberActions"],
			{
				"1": self.keyNumberGlobal,
				"2": self.keyNumberGlobal,
				"3": self.keyNumberGlobal,
				"4": self.keyNumberGlobal,
				"5": self.keyNumberGlobal,
				"6": self.keyNumberGlobal,
				"7": self.keyNumberGlobal,
				"8": self.keyNumberGlobal,
				"9": self.keyNumberGlobal,
				"0": self.keyNumberGlobal,
			})
			

		self.onClose.append(self.__onClose)

		from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
		hotplugNotifier.append(self.hotplugCB)
		
		self.autoplay = dvd_device or dvd_filelist

		if dvd_device:
			self.physicalDVD = True
		else:
			self.scanHotplug()

		self.dvd_filelist = dvd_filelist
		self.onFirstExecBegin.append(self.opened)
		self.service = None
		self.in_menu = False
	def __init__(self, session, filelist, index, path, startslide):

		self.textcolor = config.plugins.mc_pp.textcolor.value
		self.bgcolor = config.plugins.mc_pp.bgcolor.value
		space = config.plugins.mc_pp.framesize.value
		size_w = getDesktop(0).size().width()
		size_h = getDesktop(0).size().height()
		
		self.skin = "<screen position=\"0,0\" size=\"" + str(size_w) + "," + str(size_h) + "\" flags=\"wfNoBorder\" > \
			<eLabel position=\"0,0\" zPosition=\"0\" size=\""+ str(size_w) + "," + str(size_h) + "\" backgroundColor=\""+ self.bgcolor +"\" /><widget name=\"pic\" position=\"" + str(space) + "," + str(space) + "\" size=\"" + str(size_w-(space*2)) + "," + str(size_h-(space*2)) + "\" zPosition=\"1\" alphatest=\"on\" /> \
			<widget name=\"point\" position=\""+ str(space+5) + "," + str(space+2) + "\" size=\"20,20\" zPosition=\"2\" pixmap=\"skin_default/icons/record.png\" alphatest=\"on\" /> \
			<widget name=\"play_icon\" position=\""+ str(space+25) + "," + str(space+2) + "\" size=\"20,20\" zPosition=\"2\" pixmap=\"skin_default/icons/ico_mp_play.png\"  alphatest=\"on\" /> \
			<widget name=\"file\" position=\""+ str(space+45) + "," + str(space) + "\" size=\""+ str(size_w-(space*2)-50) + ",25\" font=\"Regular;20\" halign=\"left\" foregroundColor=\"" + self.textcolor + "\" zPosition=\"2\" noWrap=\"1\" transparent=\"1\" /></screen>"

		Screen.__init__(self, session)
		InfoBarBase.__init__(self)
		InfoBarSeek.__init__(self, actionmap = "MediaPlayerSeekActions")
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions", "MovieSelectionActions"],
		{
			"cancel": self.Exit,
			"green": self.PlayPause,
			"yellow": self.PlayPause,
			"blue": self.nextPic,
			"red": self.prevPic,
			"left": self.prevPic,
			"right": self.nextPic,
			"showEventInfo": self.StartExif,
		}, -1)
		
		self["point"] = Pixmap()
		self["pic"] = Pixmap()
		self["play_icon"] = Pixmap()
		self["file"] = Label(_("please wait, loading picture..."))
		
		self.old_index = 0
		self.filelist = []
		self.lastindex = index
		self.currPic = []
		self.shownow = True
		self.dirlistcount = 0

		for x in filelist:
			if len(filelist[0]) == 3: #orig. filelist
				if x[0][1] == False:
					self.filelist.append(path + x[0][0])
				else:
					self.dirlistcount += 1
			else: # thumbnaillist
				self.filelist.append(x[T_FULL])

		self.maxentry = len(self.filelist)-1
		self.index = index - self.dirlistcount
		if self.index < 0:
			self.index = 0
		
		self.picload = ePicLoad()
		self.picload.PictureData.get().append(self.finish_decode)
		
		self.slideTimer = eTimer()
		self.slideTimer.callback.append(self.slidePic)

		if self.maxentry >= 0:
			self.onLayoutFinish.append(self.setPicloadConf)
		self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
			{
				iPlayableService.evEOF: self.doEOF,
			})
		if startslide == True:
			self.PlayPause();
			if config.plugins.mc_pp.musicenable.value == True and config.plugins.mc_pp.music.value != "none":
				if pathExists(config.plugins.mc_pp.music.value):
					self.session.nav.playService(eServiceReference(4097,0,config.plugins.mc_pp.music.value))
Beispiel #49
0
 def doSeekRelative(self, pts):
     printDBG("doSeekRelative pts[%r]" % pts)
     InfoBarSeek.doSeekRelative(self, pts)
     self.waitForSeekToLastPosition = -1
 def doSeekRelative(self, pts):
     printDBG("doSeekRelative pts[%r]" % pts)
     InfoBarSeek.doSeekRelative(self, pts)
     self.waitForSeekToLastPosition = -1
Beispiel #51
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
Beispiel #52
0
	def __init__(self, session):
		self.session = session
		Screen.__init__(self, session)
		self.CurrentService = self.session.nav.getCurrentlyPlayingServiceReference()
		self.session.nav.stopService()
		self["cover"] = Cover()
		self["key_red"] = StaticText(_("Record"))
		self["key_green"] = StaticText(_("Genres"))
		self["key_yellow"] = StaticText(_("Stations"))
		self["key_blue"] = StaticText(_("Favorites"))
		self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
			{
				iPlayableService.evUpdatedInfo: self.__evUpdatedInfo,
				iPlayableService.evUser+10: self.__evAudioDecodeError,
				iPlayableService.evUser+12: self.__evPluginError
			})
		InfoBarSeek.__init__(self, actionmap = "MediaPlayerSeekActions")
		self.mode = self.FAVORITELIST
		self["list"] = SHOUTcastList()
		self["list"].connectSelChanged(self.onSelectionChanged)
		self["statustext"] = Label(_("Getting SHOUTcast genre list..."))
		self["actions"] = ActionMap(["WizardActions", "DirectionActions", "ColorActions", "EPGSelectActions"],
		{
			"ok": self.ok_pressed,
			"back": self.close,
			"input_date_time": self.menu_pressed,
			"red": self.red_pressed,
			"green": self.green_pressed,
			"yellow": self.yellow_pressed,
			"blue": self.blue_pressed,
			
		}, -1)
		self.stationList = []
		self.stationListIndex = 0
		self.genreList = []
		self.genreListIndex = 0
		self.favoriteList = []
		self.favoriteListIndex = 0

		self.favoriteConfig = Config()
		if os.path.exists(self.FAVORITE_FILE):
			self.favoriteConfig.loadFromFile(self.FAVORITE_FILE)
		else:
			self.favoriteConfig.loadFromFile(self.FAVORITE_FILE_DEFAULT)
		self.favoriteConfig.entriescount =  ConfigInteger(0)
		self.favoriteConfig.Entries = ConfigSubList()
		self.initFavouriteConfig()
		self.stationListXML = ""
		self["titel"] = Label()
		self["station"] = Label()
		self["headertext"] = Label()
		self["console"] = Label()
		self.headerTextString = ""
		self.stationListHeader = ""
		self.tunein = ""
		self.searchSHOUTcastString = ""
		self.currentStreamingURL = ""
		self.currentStreamingStation = ""
		self.stationListURL = ""
		self.onClose.append(self.__onClose)
		self.onLayoutFinish.append(self.getFavoriteList)

		self.reloadStationListTimer = eTimer()
		self.reloadStationListTimer.timeout.get().append(self.reloadStationListTimerTimeout)
		self.reloadStationListTimerVar = int(config.plugins.shoutcast.reloadstationlist.value)

		self.visible = True

		global containerStreamripper
		if containerStreamripper is None:
			containerStreamripper = eConsoleAppContainer()

		containerStreamripper.dataAvail.append(self.streamripperDataAvail)
		containerStreamripper.appClosed.append(self.streamripperClosed)

		if containerStreamripper.running():
			self["key_red"].setText(_("Stop record"))
			# just to hear to recording music when starting the plugin...
			self.currentStreamingStation = _("Recording stream station")
			self.playServiceStream("http://localhost:9191")
Beispiel #53
0
    def __init__(self, session, openmovie, opensubtitle, rootID, LastPlayedService, URLlinkName='', movieTitle='', LastPosition = 0):

        self.session = session
        self.statusScreen = self.session.instantiateDialog(StatusScreen)

                # #end subsupports stuff

        self.conditionalNotVisible = []
        self.URLlinkName = URLlinkName
        self.frameon = 1 / 24
        self.seeksubtitle = 0
        self.resume_point = 0
        self.nrsubtitle = 0
        self.statesubtitle = self.HIDDENSUBTITLE
        self.subtitles_enabled = False
        self.selected_subtitle = False
        self.stateplay = ''
        self.stateinfo = self.VISIBLE
        self.openmovie = openmovie
        
        if movieTitle == '':
            self.movieTitle = getNameWithoutExtension(path.basename(self.openmovie))
            #printDEBUG(self.movieTitle)
        else:
            self.movieTitle = movieTitle
            
        self.opensubtitle = ''
        self.rootID = int(rootID)
        self.LastPlayedService = LastPlayedService
        self.subtitle = []
        self.fontpos = 540
        self.fontsize = 60
        self.aspectratiomode = '0'
        self.SubtitleLineHeight = 66
        self.osdPosX = 0
        self.osdPosY = 0
        self.fonttype_nr = 0
        self.fontcolor_nr = 0
        self.fontbackground_nr = 0
        self.fontBackgroundState = 1
        self.loadfont()
        self.loadcolor()
        self.loadBackgroundColor()
        self.loadconfig()

        if self.opensubtitle == '':
            self.enablesubtitle = False
        else:
            self.enablesubtitle = True

        isHD = False
        isWideScreen = False
        isDolby = False
        self.skin = """
<screen name="AdvancedFreePlayer" position="0,0" size="1280,720" zPosition="-2" title="InfoBar" backgroundColor="transparent" flags="wfNoBorder">
    <!-- SubTitles -->
    <widget name="afpSubtitles" position="0,0" size="1,1" valign="center" halign="center" font="Regular;60" backgroundColor="#ff000000" transparent="0" />
  </screen>"""
        Screen.__init__(self, session)
        self['afpSubtitles'] = Label()

        self['actions'] = ActionMap(['AdvancedFreePlayer'], {  # "ToggleSubtitles": self.ToggleSubtitles,
            'ToggleInfobar': self.ToggleInfobar,
            'HelpScreen': self.HelpScreen,
            'SelectAspect': self.aspectChange,
            'ExitPlayer': self.ExitPlayer,
            'MoveSubsUp': self.MoveSubsUp,
            'MoveSubsDown': self.MoveSubsDown,
            'SetSmallerFont': self.SetSmallerFont,
            'SetBiggerFont': self.SetBiggerFont,
            'pause': self.pause,
            'play': self.play,
            'FastF30s': self.FastF30s,
            'FastF120s': self.FastF120s,
            'FastF300s': self.FastF300s,
            'BackF30s': self.BackF30s,
            'BackF120s': self.BackF120s,
            'BackF300s': self.BackF300s,
            'toggleFontBackground': self.toggleFontBackground,
            'SeekUpSubtitles': self.subsDelayInc,
            'SeekDownSubtitles': self.subsDelayDec,
            'togglePause': self.togglePause,
            'ToggleFont': self.ToggleFont,
            'refreshSubs': self.refreshSubs,
            'SelectAudio': self.SelectAudio,
            'SelectSubtitles': self.SelectSubtitles,
            }, -2)
        self.onShown.append(self.__LayoutFinish)
        InfoBarBase.__init__(self, steal_current_service=True)  # #subsupport....
        if subs == True:  # #susbsupport
            initSubsSettings()
        SubsSupport.__init__(self, embeddedSupport=True, searchSupport=True)
        self.subs = subs
        InfoBarSeek.__init__(self, actionmap='AdvancedFreePlayerSeekActions')  # #subsupport
        self.onClose.append(self.__onClose)
        if self.LastPlayedService is None:
            self.LastPlayedService = self.session.nav.getCurrentlyPlayingServiceReference()
        self.session.nav.stopService()
        self.__event_tracker = ServiceEventTracker(screen=self, eventmap={iPlayableService.evStart: self.resumeLastPlayback})  # iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged,
Beispiel #54
0
    def __init__(self, session, service):
        self.skin = CutListEditor.skin
        Screen.__init__(self, session)
        Screen.setTitle(self, _("Cutlist editor"))
        InfoBarSeek.__init__(self, actionmap=["CutlistSeekActions"])
        InfoBarCueSheetSupport.__init__(self)
        InfoBarBase.__init__(self, steal_current_service=True)
        HelpableScreen.__init__(self)
        self.old_service = session.nav.getCurrentlyPlayingServiceReference()
        self.service = service
        session.nav.playService(service)
        self.pauseService()

        # disable cutlists. we want to freely browse around in the movie
        # However, downloading and uploading the cue sheet restores the
        # default state, so we need to keep disabling it.
        self.cut_state = 2

        self.getCuesheet()

        # preserve the original cuts to possibly restore them later
        self.prev_cuts = self.cut_list[:]
        self.last_mark = [
            x for x in self.prev_cuts if x[1] == self.CUT_TYPE_LAST
        ]
        self.edited = False
        self.MovieSelection = isinstance(
            self.session.current_dialog,
            MovieSelection) and self.session.current_dialog

        self["InLen"] = Label()
        self["OutLen"] = Label()
        self["Timeline"] = ServicePositionGauge(self.session.nav)
        self["cutlist"] = List(self.getCutlist())
        self["cutlist"].onSelectionChanged.append(self.selectionChanged)
        self["SeekState"] = Label()
        self.onPlayStateChanged.append(self.updateStateLabel)
        self.updateStateLabel(self.seekstate)

        self["key_red"] = Label(_("Start cut"))
        self["key_green"] = Label(_("End cut"))
        self["key_yellow"] = Label(_("Step back"))
        self["key_blue"] = Label(_("Step forward"))

        self["SeekActions"].actions.update({"stepFwd": self.stepFwd})
        self.helpList.append(
            (self["SeekActions"], "CutlistSeekActions", [("stepFwd",
                                                          _("Step forward"))]))

        desktopSize = getDesktop(0).size()
        self["Video"] = VideoWindow(decoder=0,
                                    fb_width=desktopSize.width(),
                                    fb_height=desktopSize.height())

        self["actions"] = HelpableActionMap(self, ["CutListEditorActions"], {
            "setIn": (self.setIn, _("Make this mark an 'in' point")),
            "setOut": (self.setOut, _("Make this mark an 'out' point")),
            "setStart":
            (self.setStart, _("Make this mark the initial 'in' point")),
            "setEnd": (self.setEnd, _("Make this mark the final 'out' point")),
            "setMark": (self.setMark, _("Make this mark just a mark")),
            "addMark": (self.__addMark, _("Add a mark")),
            "removeMark": (self.__removeMark, _("Remove a mark")),
            "execute": (self.execute, _("Execute cuts and exit")),
            "quickExecute": (self.quickExecute, _("Quick execute...")),
            "leave": (self.exit, _("Exit editor")),
            "showMenu": (self.showMenu, _("Menu")),
            "backMenu": (self.backMenu, _("Restore previous cuts...")),
        },
                                            prio=-4)

        self.onExecBegin.append(self.showTutorial)
        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={iPlayableService.evCuesheetChanged: self.refillList})

        # to track new entries we save the last version of the cutlist
        self.last_cuts = self.getCutlist()
        self.cut_start = None
        self.cut_end = None
        self.state = CutListContextMenu.SHOW_DELETECUT
        self.inhibit_seek = False
        self.inhibit_cut = False
        self.onClose.append(self.__onClose)
        # Use onShown to set the initial list index, since apparently that doesn't
        # work from here.
        self.onShown.append(self.__onShown)
Beispiel #55
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)
Beispiel #56
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