Beispiel #1
0
 def poster_resize(self, poster_path):
         self["poster"].show()
         pixmaps = poster_path
         if DreamOS():
             self['poster'].instance.setPixmap(gPixmapPtr())
         else:
             self['poster'].instance.setPixmap(None)
         sc = AVSwitch().getFramebufferScale()
         self.picload = ePicLoad()
         size = self['poster'].instance.size()
         self.picload.setPara((size.width(),
          size.height(),
          sc[0],
          sc[1],
          False,
          1,
          '#FF000000'))
         ptr = self.picload.getData()
         if DreamOS():
             if self.picload.startDecode(pixmaps, False) == 0:
                 ptr = self.picload.getData()
         else:
             if self.picload.startDecode(pixmaps, 0, 0, False) == 0:
                 ptr = self.picload.getData()
         if ptr != None:
             self['poster'].instance.setPixmap(ptr)
             self['poster'].show()
         else:
             print('no cover.. error')
         return
Beispiel #2
0
	def ShowPicture(self):
		if self.shownow and self.pic_ready:
			if self.picVisible:
				self.picVisible = False
				empty = gPixmapPtr()
				self["pic"].instance.setPixmap(empty)

			ptr = self.picload.getData()
			if ptr != None:
				text = ""
				try:
					text = self.picInfo.split('\n',1)
					text = "(" + str(self.index+1) + "/" + str(self.maxentry+1) + ") " + text[0].split('/')[-1]
				except:
					pass

				self.shownow = False
				if not config.pic.infoline.value:
					self["play_icon"].hide()
					self["file"].setText("")
				else:
					self["file"].setText(text)
				self.lastindex = self.index

				setPixmap(self["pic"], ptr, self._scaleSize, self._aspectRatio)
				self.picVisible = True
			else:
				print "picture ready but no picture avail!!!!!!!"

			print "direction", self.direction
			if self.direction > 0:
				self.next()
			else:
				self.prev()
			self.start_decode()
Beispiel #3
0
 def stop(self):
     logger.debug("...")
     self.activity_timer.stop()
     self.pic_loading.instance.setPixmap(gPixmapPtr())
     if self.summaries:
         self.summaries[0]["background"].hide()
         self.summaries[0]["lcd_pic_loading"].hide()
Beispiel #4
0
    def ShowCover(self, localpic):
        print 'localpicxxx2', localpic
        print 'self.playlistxx', self.playlist, self.playindex
        from pltools import log
        log('localpic', localpic)
        localpic = self.playlist[self.playindex][2]
        print 'localpicddd', localpic
        if fileExists(localpic):
            try:
                self['radio_icon'].instance.setPixmap(gPixmapPtr())
                self.scale = AVSwitch().getFramebufferScale()
                self.picload = ePicLoad()
                size = self['radio_icon'].instance.size()
                self.picload.setPara(
                    (size.width(), size.height(), self.scale[0], self.scale[1],
                     False, 1, '#FF000000'))
                if self.picload.startDecode(localpic, 0, 0, False) == 0:
                    ptr = self.picload.getData()
                    if ptr != None:
                        self['radio_icon'].instance.setPixmap(ptr)
                        self['radio_icon'].show()
                        del self.picload
            except:
                pass

        return
	def poster_resize(self, poster_path):
		if fileExists(poster_path):
			self["poster"].instance.setPixmap(gPixmapPtr())
			scale = AVSwitch().getFramebufferScale()
			size = self["poster"].instance.size()
			self.picload.setPara((size.width(), size.height(), scale[0], scale[1], False, 1, "#00000000"))
			if is7080hd:
				try:
					if self.picload.startDecode(poster_path, False) == 0:
						ptr = self.picload.getData()
						if ptr != None:
							self["poster"].instance.setPixmap(ptr)
							self["poster"].show()
				except:
					if self.picload.startDecode(poster_path, 0, 0, False) == 0:
						ptr = self.picload.getData()
						if ptr != None:
							self["poster"].instance.setPixmap(ptr)
							self["poster"].show()
			else:
				if self.picload.startDecode(poster_path, 0, 0, False) == 0:
					ptr = self.picload.getData()
					if ptr != None:
						self["poster"].instance.setPixmap(ptr)
						self["poster"].show()
Beispiel #6
0
	def ShowPicture(self):
		if self.shownow and self.pic_ready:
			if self.picVisible:
				self.picVisible = False
				empty = gPixmapPtr()
				self["pic"].instance.setPixmap(empty)

			ptr = self.picload.getData()
			if ptr != None:
				text = ""
				try:
					text = self.picInfo.split('\n',1)
					text = "(" + str(self.index+1) + "/" + str(self.maxentry+1) + ") " + text[0].split('/')[-1]
				except:
					pass

				self.shownow = False
				if not config.pic.infoline.value:
					self["play_icon"].hide()
					self["file"].setText("")
				else:
					self["file"].setText(text)
				self.lastindex = self.index

				setPixmap(self["pic"], ptr)
				self.picVisible = True
			else:
				print "picture ready but no picture avail!!!!!!!"

			print "direction", self.direction
			if self.direction > 0:
				self.next()
			else:
				self.prev()
			self.start_decode()
Beispiel #7
0
def showCover(data, self, serien_nameCover, force_show=True):
	if self is not None and config.plugins.serienRec.showCover.value:
		if not force_show:
			global coverToShow
			if coverToShow == serien_nameCover:
				coverToShow = None
			else:
				return
			
		if fileExists(serien_nameCover):
			self['cover'].instance.setPixmap(gPixmapPtr())
			scale = AVSwitch().getFramebufferScale()
			size = self['cover'].instance.size()
			self.picload.setPara((size.width(), size.height(), scale[0], scale[1], False, 1, "#00000000"))
			picLoaderResult = 1
			if isDreamOS():
				picLoaderResult = self.picload.startDecode(serien_nameCover, False)
			else:
				picLoaderResult = self.picload.startDecode(serien_nameCover, 0, 0, False)

			if picLoaderResult == 0:
				ptr = self.picload.getData()
				if ptr is not None:
					self['cover'].instance.setPixmap(ptr)
					self['cover'].show()
		else:
			print "[SerienRecorder] Coverfile not found: %s" % serien_nameCover
 def __loadImage(self, picInfo=None):
     if picInfo:
         ptr = self.picload.getData()
         if ptr is not None and self.working:
             self.instance.setPixmap(ptr)
         else:
             self.instance.setPixmap(gPixmapPtr())
     self.working = False
Beispiel #9
0
def ePositionGauge_setPointer(self, which, pixmap, center):
	if pixmap is None:
		print "ePositionGauge.setPointer(which, None, center) is deprecated please use ePositionGauge.setPointer(which, enigma.gPixmapPtr(), center)!"
		import traceback
		traceback.print_stack(limit = 2)
		pm = enigma.gPixmapPtr()
		ePositionGauge_setPointer_org(self, which, pm, center)
	else:
		ePositionGauge_setPointer_org(self, which, pixmap, center)
Beispiel #10
0
def ePixmap_setPixmap(self, pixmap):
	if pixmap is None:
		print "ePixmap.setPixmap(None) is deprecated please use ePixmap.setPixmap(enigma.gPixmapPtr())!"
		import traceback
		traceback.print_stack(limit = 2)
		pm = enigma.gPixmapPtr()
		ePixmap_setPixmap_org(self, pm)
	else:
		ePixmap_setPixmap_org(self, pixmap)
Beispiel #11
0
def eSlider_setBackgroundPixmap(self, pixmap):
    if pixmap is None:
        print "eSlider.setBackgroundPixmap(None) is deprecated please use eSlider.setBackgroundPixmap(enigma.gPixmapPtr())!"
        import traceback
        traceback.print_stack(limit=2)
        pm = enigma.gPixmapPtr()
        eSlider_setBackgroundPixmap_org(self, pm)
    else:
        eSlider_setBackgroundPixmap_org(self, pixmap)
Beispiel #12
0
def ePixmap_setPixmap(self, pixmap):
    if pixmap is None:
        print "ePixmap.setPixmap(None) is deprecated please use ePixmap.setPixmap(enigma.gPixmapPtr())!"
        import traceback
        traceback.print_stack(limit=2)
        pm = enigma.gPixmapPtr()
        ePixmap_setPixmap_org(self, pm)
    else:
        ePixmap_setPixmap_org(self, pixmap)
Beispiel #13
0
def eSlider_setBackgroundPixmap(self, pixmap):
	if pixmap is None:
		print "eSlider.setBackgroundPixmap(None) is deprecated please use eSlider.setBackgroundPixmap(enigma.gPixmapPtr())!"
		import traceback
		traceback.print_stack(limit = 2)
		pm = enigma.gPixmapPtr()
		eSlider_setBackgroundPixmap_org(self, pm)
	else:
		eSlider_setBackgroundPixmap_org(self, pixmap)
Beispiel #14
0
def ePositionGauge_setPointer(self, which, pixmap, center):
    if pixmap is None:
        print "ePositionGauge.setPointer(which, None, center) is deprecated please use ePositionGauge.setPointer(which, enigma.gPixmapPtr(), center)!"
        import traceback
        traceback.print_stack(limit=2)
        pm = enigma.gPixmapPtr()
        ePositionGauge_setPointer_org(self, which, pm, center)
    else:
        ePositionGauge_setPointer_org(self, which, pixmap, center)
    def initPig(self):
        if not config.MVC.cover.value:
            self["Video"].show()
            self.miniTV_resume(True)
        else:
            self["Video"].hide()
            self["Cover"].instance.setPixmap(gPixmapPtr())

        self["Cover"].hide()
        self["CoverBg"].hide()
        self["CoverBgLbl"].hide()
Beispiel #16
0
 def showMovie(self):
     #print("MDC: Picture: showMovie: index: %s, file: %s" % (self.fileindex, str(self.file)))
     if self.slideTimer.isActive():
         self.slideTimer.stop()
     empty = gPixmapPtr()
     self['pic'].instance.setPixmap(empty)
     self.session.openWithCallback(self.showMovieCallback,
                                   MDCMoviePlayer, [self.file],
                                   0,
                                   leave_quietly=True,
                                   resume=False)
 def changed(self, what):
     if self.instance is not None:
         if what[0] != self.CHANGED_CLEAR:
             service = self.getServiceRef()
             cover_path = self.imageFileFromService(service)
             if cover_path is None:
                 cover_path = self.default_image
             if cover_path is not None:
                 self.working = True
                 self.picload.startDecode(cover_path)
                 return
         self.instance.setPixmap(gPixmapPtr())
Beispiel #18
0
 def ShowPng(self, Data):
     if fileExists("/tmp/country.png"):
         self['countryPng'].instance.setPixmap(gPixmapPtr())
         self.scale = AVSwitch().getFramebufferScale()
         self.picload = ePicLoad()
         size = self['countryPng'].instance.size()
         self.picload.setPara((size.width(), size.height(), self.scale[0], self.scale[1], False, 1, "#00000000"))
         if self.picload.startDecode("/tmp/country.png", 0, 0, False) == 0:
             ptr = self.picload.getData()
             if ptr != None:
                 self['countryPng'].instance.setPixmap(ptr)
                 self['countryPng'].show()
                 del self.picload
 def loadPreview(self, serviceref):
     self.hideDialog()
     if serviceref is None:
         empty = gPixmapPtr()
         self["CoverPreview"].instance.setPixmap(empty)
         self["backdrop"].hide()
         return
     path = serviceref.getPath()
     if serviceref.flags & eServiceReference.mustDescent:
         # directory
         if fileExists(path + ".jpg"):
             path += ".jpg"
         elif config.AdvancedMovieSelection.usefoldername.value:
             path = path[:-1] + ".jpg"
         else:
             path = path + "folder.jpg"
     elif os.path.isfile(path):
         # file service
         path_s = os.path.splitext(path)[0]
         path = path_s + ".jpg"
     else:   
         # structure service
         path = path + ".jpg"
     
     # load cover or provider icon
     self.working = True
     if fileExists(path):
         self.picload.startDecode(path)
         return
     series_path = os.path.join(os.path.dirname(path), "series.jpg")
     if fileExists(series_path):
         self.picload.startDecode(series_path)
         return
     # cover for serienrecorder plugin
     dir_name = os.path.dirname(path)
     series_path = os.path.join(dir_name,  os.path.basename(dir_name) + ".jpg")
     if fileExists(series_path):
         self.picload.startDecode(series_path)
         return
     if serviceref.getPath().endswith(".ts") and config.AdvancedMovieSelection.show_picon.value:
         picon = getServiceInfoValue(serviceref, iServiceInformation.sServiceref).rstrip(':').replace(':', '_') + ".png"
         piconpath = os.path.join(config.AdvancedMovieSelection.piconpath.value, picon)
         if fileExists(piconpath):
             self.picload.startDecode(piconpath)
             return
     cover_path = os.path.join(os.path.dirname(path), "cover.jpg")
     if fileExists(cover_path):
         self.picload.startDecode(cover_path)
     else:
         self.picload.startDecode(getNocover())
Beispiel #20
0
 def displayPixmap(self, pixmap, path):
     #print("MDC: PixmapDisplay: displayPixmap: path: %s" % path)
     self.pixmap = pixmap
     if path is not None and self.picload_conn is None:
         scale = AVSwitch().getFramebufferScale()
         size = self.pixmap.instance.size()
         #print("MDC: PixmapDisplay: displayPixmap: size: %s, %s, scale: %s, %s" % (size.width(), size.height(), scale[0], scale[1]))
         self.pixmap.instance.setPixmap(gPixmapPtr())
         self.picload_conn = self.picload.PictureData.connect(
             self.displayPixmapCallback)
         _filename, ext = os.path.splitext(path)
         setJPEG = 2 if ext == '.jpg' or ext == '.jpeg' else 1
         self.picload.setPara((size.width(), size.height(), scale[0],
                               scale[1], False, setJPEG, "#ff000000"))
         self.picload.startDecode(path, True)
Beispiel #21
0
	def showCover(self, coverName):
		self.picload = ePicLoad()
		if not fileExists(coverName):
			coverName = "/usr/lib/enigma2/python/Plugins/Extensions/tmdb/pic/no_cover.png"

		if fileExists(coverName):
			self['cover'].instance.setPixmap(gPixmapPtr())
			scale = AVSwitch().getFramebufferScale()
			size = self['cover'].instance.size()
			self.picload.setPara((size.width(), size.height(), scale[0], scale[1], False, 1, "#FF000000"))
			if self.picload.startDecode(coverName, 0, 0, False) == 0:
				ptr = self.picload.getData()
				if ptr != None:
					self['cover'].instance.setPixmap(ptr)
					self['cover'].show()
			del self.picload
	def showCoverFile(self, picPath, showNoCoverart=True):
		if fileExists(picPath):
			self._cover.instance.setPixmap(gPixmapPtr())
			scale = AVSwitch().getFramebufferScale()
			size = self._cover.instance.size()
			if mp_globals.fakeScale:
				self.picload.setPara((size.width(), size.height(), scale[0], scale[1], False, 1, "#00000000"))
			else:
				self.picload.setPara((size.width(), size.height(), scale[0], scale[1], False, 1, "#FF000000"))
			self.updateCover(picPath)
		else:
			printl("Coverfile not found: %s" % picPath, self, "E")
			if showNoCoverart and picPath != self._no_picPath:
				self.showCoverFile(self._no_picPath)

		if self._callback:
			self._callback()
Beispiel #23
0
	def showCoverFile(self, picPath):
		print "showCoverFile:"
		if fileExists(picPath):
			self._cover.instance.setPixmap(gPixmapPtr())
			scale = AVSwitch().getFramebufferScale()
			size = self._cover.instance.size()
			self.picload.setPara((size.width(), size.height(), scale[0], scale[1], False, 1, "#FF000000"))
			if self.picload.startDecode(picPath, 0, 0, False) == 0:
				ptr = self.picload.getData()
				if ptr != None:
					self._cover.instance.setPixmap(ptr)
					self._cover.show()
		else:
			printl("Coverfile not found: %s" % picPath, self, "E")

		if self._callback:
			self._callback()
Beispiel #24
0
	def poster_resize(self, poster_path, m_title):
		self.m_title = m_title
		self["poster"].instance.setPixmap(gPixmapPtr())
		self["poster"].hide()
		sc = AVSwitch().getFramebufferScale() # Maybe save during init
		size = self["poster"].instance.size()
		if self.picload:
			self.picload.setPara((size.width(), size.height(), sc[0], sc[1], False, 1, "#00000000")) # Background dynamically
			#self.picload.startDecode(poster_path)
			if self.picload.startDecode(poster_path, 0, 0, False) == 0:
				#def showCoverCallback(self, picInfo=None):
				#if picInfo:
				ptr = self.picload.getData()
				if ptr != None:
					print "EMC iMDB: Load Poster - %s" % self.m_title
					self["poster"].instance.setPixmap(ptr)
					self["poster"].show()
    def loadPreview(self, serviceref):
        self.hideDialog()
        if serviceref is None:
            empty = gPixmapPtr()
            self["CoverPreview"].instance.setPixmap(empty)
            return

        path = serviceref.getPath()
        if path.endswith("/"):
            if fileExists(path + ".jpg"):
                path += ".jpg"
            elif config.AdvancedMovieSelection.usefoldername.value:
                path = path[:-1] + ".jpg"
            else:
                path = path + "folder.jpg"
        elif os.path.isfile(path):
            path = os.path.splitext(path)[0] + ".jpg"
        else:
            path = path + ".jpg"

        self.working = True
        self["CoverPreview"].setPosition(self.cpX, self.cpY)
        if fileExists(path):
            self.picload.startDecode(path)
            return
        series_path = os.path.join(os.path.dirname(path), "series.jpg")
        if os.path.exists(series_path):
            self.picload.startDecode(series_path)
            return
        if serviceref.getPath().endswith(
                ".ts") and config.AdvancedMovieSelection.show_picon.value:
            picon = getServiceInfoValue(
                serviceref,
                iServiceInformation.sServiceref).rstrip(':').replace(
                    ':', '_') + ".png"
            piconpath = os.path.join(
                config.AdvancedMovieSelection.piconpath.value, picon)
            if os.path.exists(piconpath):
                if config.AdvancedMovieSelection.piconsize.value:
                    self["CoverPreview"].instance.setPixmapFromFile(piconpath)
                    self["CoverPreview"].setPosition(self.piconX, self.piconY)
                else:
                    self.picload.startDecode(piconpath)
                return
        self.picload.startDecode(nocover)
Beispiel #26
0
    def showCoverFile(self, picPath):
        print "showCoverFile:"
        if fileExists(picPath):
            self._cover.instance.setPixmap(gPixmapPtr())
            scale = AVSwitch().getFramebufferScale()
            size = self._cover.instance.size()
            self.picload.setPara((size.width(), size.height(), scale[0],
                                  scale[1], False, 1, "#FF000000"))
            if self.picload.startDecode(picPath, 0, 0, False) == 0:
                ptr = self.picload.getData()
                if ptr != None:
                    self._cover.instance.setPixmap(ptr)
                    self._cover.show()
        else:
            printl("Coverfile not found: %s" % picPath, self, "E")

        if self._callback:
            self._callback()
Beispiel #27
0
    def displayCover(self, cover_path, cover_ptr, nocover_path=None):
        print("MVC: Cover: displayCover: cover_path: %s, nocover_path: %s" %
              (cover_path, nocover_path))
        self.cover_ptr = cover_ptr
        path = nocover_path
        if os.path.exists(cover_path):
            path = cover_path

        if path is not None and self.cover_ptr is not None:
            print("MVC: Cover: displayCover: showing cover now")
            scale = AVSwitch().getFramebufferScale()
            size = self.cover_ptr.instance.size()
            self.cover_ptr.instance.setPixmap(gPixmapPtr())
            self.picload = ePicLoad()
            self.picload_conn = self.picload.PictureData.connect(
                self.displayCoverCallback)
            self.picload.setPara(
                (size.width(), size.height(), scale[0], scale[1], False, 1,
                 config.MVC.cover_background.value))
            self.picload.startDecode(path, True)
    def loadPreview(self, serviceref):
        self.hideDialog()
        if serviceref is None:
            empty = gPixmapPtr()
            self["CoverPreview"].instance.setPixmap(empty)
            return

        path = serviceref.getPath()
        if path.endswith("/"):
            if fileExists(path + ".jpg"):
                path += ".jpg"
            elif config.AdvancedMovieSelection.usefoldername.value:
                path = path[:-1] + ".jpg"
            else:
                path = path + "folder.jpg"
        elif os.path.isfile(path):
            path = os.path.splitext(path)[0] + ".jpg"
        else:
            path = path + ".jpg"
    
        self.working = True
        self["CoverPreview"].setPosition(self.cpX, self.cpY)
        if fileExists(path):
            self.picload.startDecode(path)
            return
        series_path = os.path.join(os.path.dirname(path), "series.jpg")
        if os.path.exists(series_path):
            self.picload.startDecode(series_path)
            return
        if serviceref.getPath().endswith(".ts") and config.AdvancedMovieSelection.show_picon.value:
            picon = getServiceInfoValue(serviceref, iServiceInformation.sServiceref).rstrip(':').replace(':', '_') + ".png"
            piconpath = os.path.join(config.AdvancedMovieSelection.piconpath.value, picon)
            if os.path.exists(piconpath):
                if config.AdvancedMovieSelection.piconsize.value:
                    self["CoverPreview"].instance.setPixmapFromFile(piconpath)
                    self["CoverPreview"].setPosition(self.piconX, self.piconY)
                else:
                    self.picload.startDecode(piconpath)
                return
        self.picload.startDecode(nocover)
Beispiel #29
0
	def showCover(self, poster_path):
		self.picload = ePicLoad()
		if not fileExists(poster_path):
			poster_path = "/usr/share/enigma2/skin_default/extensions/no_coverbg.png"
		if fileExists(poster_path):
			self["cover"].instance.setPixmap(gPixmapPtr())
			scale = AVSwitch().getFramebufferScale()
			size = self["cover"].instance.size()
			self.picload.setPara((size.width(), size.height(), scale[0], scale[1], False, 1, "#00000000"))
			if isDreamOS:
				if self.picload.startDecode(poster_path, False) == 0:
					ptr = self.picload.getData()
					if ptr != None:
						self["cover"].instance.setPixmap(ptr)
						self["cover"].show()
			else:
				if self.picload.startDecode(poster_path, 0, 0, False) == 0:
					ptr = self.picload.getData()
					if ptr != None:
						self["cover"].instance.setPixmap(ptr)
						self["cover"].show()
			del self.picload
	def showCover(self, poster_path):
		self.picload = ePicLoad()
		if not fileExists(poster_path):
			poster_path = "/usr/share/enigma2/skin_default/extensions/no_coverbg.png"
		if fileExists(poster_path):
			self["cover"].instance.setPixmap(gPixmapPtr())
			scale = AVSwitch().getFramebufferScale()
			size = self["cover"].instance.size()
			self.picload.setPara((size.width(), size.height(), scale[0], scale[1], False, 1, "#00000000"))
			if isDreamOS:
				if self.picload.startDecode(poster_path, False) == 0:
					ptr = self.picload.getData()
					if ptr != None:
						self["cover"].instance.setPixmap(ptr)
						self["cover"].show()
			else:
				if self.picload.startDecode(poster_path, 0, 0, False) == 0:
					ptr = self.picload.getData()
					if ptr != None:
						self["cover"].instance.setPixmap(ptr)
						self["cover"].show()
			del self.picload
Beispiel #31
0
    def ShowCover3(self, localpic):
        print 'localpicxxx', localpic
        from pltools import log
        log('localpic', localpic)
        localpic = '/tmp/cover.jpg'
        if fileExists(localpic):
            try:
                self['cover'].instance.setPixmap(gPixmapPtr())
                self.scale = AVSwitch().getFramebufferScale()
                self.picload = ePicLoad()
                size = self['cover'].instance.size()
                self.picload.setPara(
                    (size.width(), size.height(), self.scale[0], self.scale[1],
                     False, 1, '#FF000000'))
                if self.picload.startDecode(localpic, 0, 0, False) == 0:
                    ptr = self.picload.getData()
                    if ptr != None:
                        self['cover'].instance.setPixmap(ptr)
                        self['cover'].show()
                        del self.picload
            except:
                pass

        return