Пример #1
0
	def __init__(self, session):
		Renderer.__init__(self)
		
		self.showiframe = Showiframe()
		self.session = session
		self.poll_timer = eTimer()
		self.poll_timer.callback.append(self.poll)
Пример #2
0
	def __init__(self, session):
		Renderer.__init__(self)
		
		self.showiframe = Showiframe()
		self.session = session
		self.poll_timer = eTimer()
		self.poll_timer.callback.append(self.poll)
Пример #3
0
    def __init__(self,
                 session,
                 libraryName,
                 loadLibrary,
                 playEntry,
                 viewName,
                 select=None,
                 sort=None,
                 filter=None):

        self.showiframe = Showiframe()

        DMC_View.__init__(self, session, libraryName, loadLibrary, playEntry,
                          viewName, select, sort, filter)

        self["poster"] = Pixmap()
        self["title"] = Label()

        if self.APILevel >= 5:
            self["shortDescriptionContainer"] = Label()
            self["cnt_poster"] = Pixmap()
            self["cnt_title"] = Label()
            self["cnt_shortDescription"] = Label()

        self["key_red"] = StaticText(_("Sort: ") + _("Default"))
        self["key_green"] = StaticText("")
        self["key_yellow"] = StaticText("")
        self["key_blue"] = StaticText(self.viewName[0])

        try:
            from StillPicture import StillPicture
            self["backdrop"] = StillPicture(session)
            self.ShowStillPicture = True
        except Exception, ex:
            printl("Exception: " + str(ex), self)
Пример #4
0
    def __init__(self,
                 session,
                 libraryName,
                 loadLibrary,
                 playEntry,
                 viewName,
                 select=None,
                 sort=None,
                 filter=None):

        self.showiframe = Showiframe()

        DMC_View.__init__(self, session, libraryName, loadLibrary, playEntry,
                          viewName, select, sort, filter)

        self["poster"] = Pixmap()
        self["title"] = Label()
        if self.APILevel == 1:
            self["otitle"] = Label()
        self["tag"] = Label()
        self["shortDescription"] = Label()
        if self.APILevel == 1:
            self["director"] = Label()
            self["writer"] = Label()
        self["genre"] = Label()
        self["year"] = Label()
        self["runtime"] = Label()

        if self.APILevel >= 2:
            self["total"] = Label()
            self["current"] = Label()

        if self.APILevel >= 5:
            self["quality"] = Label()
            self["sound"] = Label()

        if self.APILevel >= 7:
            printl("we are at api level 7", self, "D")
            self["studio"] = Label()
            self["mpaa"] = Label()

        self.BackdropDynamic = 1
        if self.APILevel >= 6:
            try:
                self.BackdropDynamic = int(DataElement().getDataPreloading(
                    self, "backdrop_dynamic"))
                self["backdrop_dynamic"] = DataElement()
            except Exception, ex:
                printl("Exception(" + str(type(ex)) + "): " + str(ex), self,
                       "W")
                self.BackdropDynamic = 1
Пример #5
0
class StillPicture(Renderer, InfoBarBase):
	GUI_WIDGET = eStillPicture
	
	element = False
	
	stillpicture = ""
	stillpictureDefault = ""
	isLoop = False
	session = None
	poll_timer = None

	def __init__(self, session):
		Renderer.__init__(self)
		
		self.showiframe = Showiframe()
		self.session = session
		self.poll_timer = eTimer()
		self.poll_timer.callback.append(self.poll)

	def addEventTracker(self):
		printl("", self)
		if self.session is not None and self.session.nav is not None:
			self.session.nav.event.append(self.event)
		else:
			printl("ARGGHHHH!!! self.session is not None and self.session.nav is not None", self, "E")
		#self.eventSafe = self.session.nav.event
		#self.session.nav.event = []
		#self.session.nav.event.append(self.event)
		#print "addEventTracker.eventSafe", self.eventSafe
		#print "addEventTracker.session.nav.event", self.session.nav.event
	
	def removeEventTracker(self):
		printl("", self)
		if self.session is not None and self.session.nav is not None:
			self.session.nav.event.remove(self.event)
		else:
			printl("ARGGHHHH!!! self.session is not None and self.session.nav is not None", self, "E")
		#print "addEventTracker.eventSafe", self.eventSafe
		#print "addEventTracker.session.nav.event", self.session.nav.event
		#self.session.nav.event = self.eventSafe
		#print "addEventTracker.session.nav.event", self.session.nav.event

	def event(self, type):
		#print "EVENT", type
		if type == iPlayableService.evEOF:
			self.__evEOF()

	def poll(self):
		#print "poll"
		if self.session is not None and self.session.nav is not None:
			service = self.session.nav.getCurrentService()
			seek = service and service.seek()
			if seek is not None:
				pos = seek.getPlayPosition()
		else:
			printl("ARGGHHHH!!! self.session is not None and self.session.nav is not None", self, "E")

	def pollStart(self):
		printl("", self)
		self.addEventTracker()
		self.poll_timer.start(500)

	def pollStop(self):
		printl("", self)
		self.removeEventTracker()
		self.poll_timer.stop()

	def __evEOF(self):
		printl("", self)
		if self.session is not None and self.session.nav is not None:
			service = self.session.nav.getCurrentService()
			boxtype = getBoxtype()
			if boxtype[2] != "sh4" and service and service.seek():
				service.seek().seekTo(0)
			else:
				self.session.nav.playService(eServiceReference(4097, 0, self.getStillpicture()), forceRestart=True)
		else:
			printl("ARGGHHHH!!! self.session is not None and self.session.nav is not None", self, "E")
		#self.showStillPicture()

	def elementExists(self):
		return self.element

	def getStillpicture(self):
		return self.stillpicture

	def getStillpictureDefault(self):
		return self.stillpictureDefault

	def setStillPicture(self, value, default=False, refresh=True, isLoop=False):
		if default is True:
			self.stillpictureDefault = value
		
		if self.stillpicture != value:
			self.stillpicture = value
			self.isLoop = isLoop
			if refresh is True:
				self.changed()

	def setStillPictureToDefault(self):
		if self.stillpicture != self.stillpictureDefault:
			self.stillpicture = self.stillpictureDefault
			self.changed()

	def postWidgetCreate(self, instance):
		#print "postWidgetCreate", instance
		self.sequence = None
		
		if self.skinAttributes is not None:
			self.element = True
			for (attrib, value) in self.skinAttributes:
				if attrib == "text":
					self.setStillPicture(value, True, False)

	def showStillPicture(self):
		#print "showStillPicture", "-->"
		if self.elementExists():
			try:
				if self.isLoop is False:
					self.showiframe.showStillpicture(self.getStillpicture())
				elif self.isLoop is True:
					if self.session is not None and self.session.nav is not None:
						printl("loop: " + str(self.getStillpicture()), self)
						ServiceEventTracker.setActiveInfoBar(self, None, None)
						self.session.nav.playService(eServiceReference(4097, 0, self.getStillpicture()))
						self.pollStart()
					else:
						printl("ARGGHHHH!!! self.session is not None and self.session.nav is not None", self, "E")
			except Exception, ex:
				printl("Exception(" + str(type(ex)) + "): " + str(ex), self, "E")
Пример #6
0
class StillPicture(Renderer, InfoBarBase):
	GUI_WIDGET = eStillPicture
	
	element = False
	
	stillpicture = ""
	stillpictureDefault = ""
	isLoop = False
	session = None
	poll_timer = None

	def __init__(self, session):
		Renderer.__init__(self)
		
		self.showiframe = Showiframe()
		self.session = session
		self.poll_timer = eTimer()
		self.poll_timer.callback.append(self.poll)

	def addEventTracker(self):
		printl("", self)
		if self.session is not None and self.session.nav is not None:
			self.session.nav.event.append(self.event)
		else:
			printl("ARGGHHHH!!! self.session is not None and self.session.nav is not None", self, "E")
		#self.eventSafe = self.session.nav.event
		#self.session.nav.event = []
		#self.session.nav.event.append(self.event)
		#print "addEventTracker.eventSafe", self.eventSafe
		#print "addEventTracker.session.nav.event", self.session.nav.event
	
	def removeEventTracker(self):
		printl("", self)
		if self.session is not None and self.session.nav is not None:
			self.session.nav.event.remove(self.event)
		else:
			printl("ARGGHHHH!!! self.session is not None and self.session.nav is not None", self, "E")
		#print "addEventTracker.eventSafe", self.eventSafe
		#print "addEventTracker.session.nav.event", self.session.nav.event
		#self.session.nav.event = self.eventSafe
		#print "addEventTracker.session.nav.event", self.session.nav.event

	def event(self, type):
		#print "EVENT", type
		if type == iPlayableService.evEOF:
			self.__evEOF()

	def poll(self):
		#print "poll"
		if self.session is not None and self.session.nav is not None:
			service = self.session.nav.getCurrentService()
			seek = service and service.seek()
			if seek is not None:
				pos = seek.getPlayPosition()
		else:
			printl("ARGGHHHH!!! self.session is not None and self.session.nav is not None", self, "E")

	def pollStart(self):
		printl("", self)
		self.addEventTracker()
		self.poll_timer.start(500)

	def pollStop(self):
		printl("", self)
		self.removeEventTracker()
		self.poll_timer.stop()

	def __evEOF(self):
		printl("", self)
		if self.session is not None and self.session.nav is not None:
			service = self.session.nav.getCurrentService()
			boxtype = getBoxtype()
			if boxtype[2] != "sh4" and service and service.seek():
				service.seek().seekTo(0)
			else:
				self.session.nav.playService(eServiceReference(4097, 0, self.getStillpicture()), forceRestart=True)
		else:
			printl("ARGGHHHH!!! self.session is not None and self.session.nav is not None", self, "E")
		#self.showStillPicture()

	def elementExists(self):
		return self.element

	def getStillpicture(self):
		return self.stillpicture

	def getStillpictureDefault(self):
		return self.stillpictureDefault

	def setStillPicture(self, value, default=False, refresh=True, isLoop=False):
		if default is True:
			self.stillpictureDefault = value
		
		if self.stillpicture != value:
			self.stillpicture = value
			self.isLoop = isLoop
			if refresh is True:
				self.changed()

	def setStillPictureToDefault(self):
		if self.stillpicture != self.stillpictureDefault:
			self.stillpicture = self.stillpictureDefault
			self.changed()

	def postWidgetCreate(self, instance):
		#print "postWidgetCreate", instance
		self.sequence = None
		
		if self.skinAttributes is not None:
			self.element = True
			for (attrib, value) in self.skinAttributes:
				if attrib == "text":
					self.setStillPicture(value, True, False)

	def showStillPicture(self):
		#print "showStillPicture", "-->"
		if self.elementExists():
			try:
				if self.isLoop is False:
					self.showiframe.showStillpicture(self.getStillpicture())
				elif self.isLoop is True:
					if self.session is not None and self.session.nav is not None:
						printl("loop: " + str(self.getStillpicture()), self)
						ServiceEventTracker.setActiveInfoBar(self, None, None)
						self.session.nav.playService(eServiceReference(4097, 0, self.getStillpicture()))
						self.pollStart()
					else:
						printl("ARGGHHHH!!! self.session is not None and self.session.nav is not None", self, "E")
			except Exception, ex:
				printl("Exception(" + str(type(ex)) + "): " + str(ex), self, "E")