Exemplo n.º 1
0
    def getText(self):
        '''
        '''
        printl("", self, "S")

        content = "Direct Local"
        content += "\n   Advantages:\tThe medias are played directly from E2."
        content += "\n   Prequesits:\tThis mode works if your plex library is mounted on your Dreambox and accessable."
        content += "\n   Functions:\tSeeking is working"
        content += "\n   HowTo:\tYou can use Windows or Linux based Plexserver."
        content += "\n\tSample content for Library location: movies | tvshows | music"
        content += "\n\tMedia location in Plex for Windows (sample): C:\path\of\library\root\movies\movie.mkv"
        content += "\n\tMedia location Plex for Linux (sample): /path/of/library/root/movies\movie.mkv"
        content += "\n\tMedia location on the Dreambox (sample): /media/net/mountpoint/movies\movie.mkv"
        content += "\n\tAs you can see movies/\movie.mkv is identical."
        content += "\n\tAccording to this just set up the following:"
        content += "\n\tRemote Path Part >>> C:\path\of\library\root\ or /path/of/library/root/"
        content += "\n\tLocal Path Part >>> /media/net/mountpoint/"
        content += "\n\n Transcoded"
        content += "\n   Advantages:\tThe medias go through the plex transcoder. So it is possible to set the quality."
        content += "\n   Prequesits:\tYou have to install gst-fragemented"
        content += "\n   Functions:\tSeeking is working"
        content += "\n\n Streamed"
        content += "\n   Advantages:\tIf you cant setup direct local and you dont have gst-fragmented"
        content += "\n   Prequesits:\tNothing"
        content += "\n   Functions:\tSeeking is not working"
        content += "\n\n myPlex"
        content += "\n   Advantages:\tYou can access shared libraries of friends."
        content += "\n   Prequesits:\tYou need a myPlex account."
        content += "\n   Note:\tThis is only neccessary to connect to shared libs. No need to use this in you local network"  
        printl("", self, "C")
        return content
Exemplo n.º 2
0
 def __init__(self, session):
     '''
     '''
     printl("", self, "S")
     
     Screen.__init__(self, session)
     
     self._session = session
     
     self["help"] = ScrollLabel()
     
         
     self["key_red"] = StaticText(_("Close"))
     
     self["setupActions"] = HelpableActionMap(self, "DP_View", 
     {
         "red": self.keyCancel,
         "cancel": self.keyCancel,
         "bouquet_up":       (self.bouquetUp, ""),
         "bouquet_down":     (self.bouquetDown, ""),
     }, -2)
     
     self.onLayoutFinish.append(self.setContent)
     
     printl("", self, "C")
Exemplo n.º 3
0
 def _filter(self):
     '''
     '''
     printl("", self, "S")
     
     print self.activeFilter
     listViewList = []
     if self.activeFilter[1][0] is None:
         listViewList = self.listViewList
     else:
         
         testLength = None
         if len(self.activeFilter[1]) >= 3:
             testLength = self.activeFilter[1][2]
         
         if self.activeFilter[1][1]:
             listViewList = [x for x in self.listViewList if self.activeFilter[2] in x[1][self.activeFilter[1][0]]]
         else:
             if testLength is None:
                 listViewList = [x for x in self.listViewList if x[1][self.activeFilter[1][0]] == self.activeFilter[2]]
             else:
                 listViewList = [x for x in self.listViewList if x[1][self.activeFilter[1][0]].strip()[:testLength] == self.activeFilter[2].strip()[:testLength]]
     
     self["listview"].setList(listViewList)
     self["listview"].setIndex(0)
     
     printl("", self, "C")
Exemplo n.º 4
0
 def onChooseFilter(self):
     '''
     '''
     printl("", self, "S")
     
     menu = []
     
     selection = 0
     counter = 0
     
     for i in range(len(self.onFilterKeyValuePair)):
         x = self.onFilterKeyValuePair[i]
         subelements = self.onFilterKeyValuePair[i][2]
         for j in range(len(subelements)):
             y = subelements[j]
             text = "%s: %s" % (_(x[0]), _(y))
             menu.append((text, (x[0], x[1], y, )))
             if self.activeFilter[1][0] == self.onFilterKeyValuePair[i][1][0]:
                 if self.activeFilter[2] == subelements[j]:
                     selection = counter
             counter += 1
     
     self.session.openWithCallback(self.onChooseFilterCallback, ChoiceBox, title=_("Select filter"), list=menu, selection=selection)
     
     printl("", self, "C")
Exemplo n.º 5
0
    def checkWakeOnLan(self):
        '''
		'''
        printl("", self, "S")

        self.g_wolon = self.g_serverConfig.wol.value
        self.g_wakeserver = str(self.g_serverConfig.wol_mac.value)
        self.g_woldelay = int(self.g_serverConfig.wol_delay.value)

        if self.g_wolon == True:
            ip = "%d.%d.%d.%d" % tuple(self.g_serverConfig.ip.value)
            port = int(self.g_serverConfig.port.value)
            state = testPlexConnectivity(ip, port)

            if state == False:

                self.session.openWithCallback(
                    self.executeWakeOnLan, MessageBox,
                    _("Plexserver seems to be offline. Start with Wake on Lan settings? \n\nPlease note: \nIf you press yes the spinner will run for "
                      + str(self.g_woldelay) +
                      " seconds. \nAccording to your settings."),
                    MessageBox.TYPE_YESNO)
            else:

                self.getServerData()
        else:
            self.getServerData()

        printl("", self, "C")
Exemplo n.º 6
0
 def onLeave(self):
     '''
     '''
     printl("", self, "S")
     
     selectKeyValuePair = self.onLeaveSelectKeyValuePair
     printl("selectKeyValuePair: " + str(selectKeyValuePair), self, "D")
     
     if selectKeyValuePair is None:
         
         self.close()
         printl("", self, "C")
         return
     
     self._load(self.onLeavePrimaryKeyValuePair)
     
     for i in range(len(self.listViewList)):
         entry = self.listViewList[i][1]
         printl("iterator: " + str(i) + " entry: " + str(entry), self, "I")
         isIndex = True
         
         for key in selectKeyValuePair.keys():
             if entry[key] != selectKeyValuePair[key]:
                 isIndex = False
                 break
         if isIndex:
             self["listview"].setIndex(i)
             break
     self.refresh()
     
     printl("", self, "C")
Exemplo n.º 7
0
	def getMusicSections(self, selection):
		'''
		'''
		printl("", self, "S")
		
		mainMenuList = []
		plugin = selection[2] #e.g. Plugin.MENU_MOVIES
		
		origSelection = selection
		
		# ARTISTS
		params = copy.deepcopy(selection[3])
		url = params['t_url']
		params['t_url'] = url + "?type=8"
		mainMenuList.append((_("by Artists"), plugin, params))
		printl("mainMenuList 1: " + str(mainMenuList), self, "D")
		
		#ALBUMS
		params = copy.deepcopy(selection[3])
		params['t_url'] = url + "?type=9"
		mainMenuList.append((_("by Albums"), plugin, params))
		printl("mainMenuList 2: " + str(mainMenuList), self, "D")
		
		self["menu"].setList(mainMenuList)
		self.refreshMenu(0)
		
		printl("mainMenuList: " + str(mainMenuList), self, "D")
		
		printl("", self, "C")
Exemplo n.º 8
0
	def getPlayPosition(self):
		printl("", self, "S")
		
		position = self.seek.getPlayPosition()
		
		printl("", self, "C")
		return position
Exemplo n.º 9
0
    def bufferInfo(self):
        '''
		'''
        #printl("", self, "S")

        bufferInfo = self.session.nav.getCurrentService().streamed(
        ).getBufferCharge()

        self.bufferPercent = bufferInfo[0]
        self.buffer1 = bufferInfo[1]
        self.bufferAvgOutRate = bufferInfo[2]
        self.buffer3 = bufferInfo[3]
        self.buffersize = bufferInfo[4]

        self["bufferslider"].setValue(int(self.bufferPercent))

        if (self.bufferPercent > 95):
            self.bufferFull()

        if (self.bufferPercent == 0 and not self.endReached
                and (bufferInfo[1] != 0 and bufferInfo[2] != 0)):
            self.bufferEmpty()

        printl(
            "Buffersize[4]: %d BufferPercent[0]: %d Buffer[1]: %d Buffer[3]: %d BufferAvgOutRate[2]: %d"
            % (self.buffersize, self.bufferPercent, self.buffer1, self.buffer3,
               self.bufferAvgOutRate), self, "D")
Exemplo n.º 10
0
    def setAudioTrack(self):
        '''
		'''
        printl("", self, "S")
        if self.switchedLanguage == False:
            try:
                service = self.session.nav.getCurrentService()

                tracks = service and self.getServiceInterface("audioTracks")
                nTracks = tracks and tracks.getNumberOfTracks() or 0

                if not nTracks:
                    printl("no tracks found yet ... retrying later", self, "D")
                    return

                self.nTracks = True
                trackList = []

                for i in xrange(nTracks):
                    audioInfo = tracks.getTrackInfo(i)
                    lang = audioInfo.getLanguage()
                    printl("lang: " + str(lang), self, "D")
                    trackList += [str(lang)]

                systemLanguage = language.getLanguage(
                )[:
                  2]  # getLanguage returns e.g. "fi_FI" for "language_country"
                printl("found systemLanguage: " + systemLanguage, self, "I")
                #systemLanguage = "en"

                self.tryAudioEnable(trackList, systemLanguage, tracks)

            except Exception, e:
                printl("audioTrack exception: " + str(e), self, "W")
Exemplo n.º 11
0
def getViewClass():
	"""
	"""
	printl("",__name__ , "S")
	
	printl("",__name__ , "C")
	return DPS_ViewShows
Exemplo n.º 12
0
	def finishupdate(self):
		printl("", self, "S")
		
		time.sleep(2)
		self.session.openWithCallback(self.e2restart, MessageBox,_("Enigma2 must be restarted!\nShould Enigma2 now restart?"), MessageBox.TYPE_YESNO)
	
		printl("", self, "C")
Exemplo n.º 13
0
    def sleepNow(self):
        printl("", self, "S")

        time.sleep(int(self.g_woldelay))
        self.getServerData()

        printl("", self, "C")
Exemplo n.º 14
0
	def seekToMinute(self, minutes):
		printl("", self, "S")

		self.resumeStamp = int(minutes)*60
		self.seekToStartPos()

		printl("", self, "C")   
Exemplo n.º 15
0
    def __init__(self,
                 pid,
                 name=None,
                 desc=None,
                 start=None,
                 fnc=None,
                 where=None,
                 supportStillPicture=False,
                 weight=100):
        '''
		'''
        printl("", self, "S")

        self.pid = pid
        self.name = name
        if desc is None:
            self.desc = self.name
        else:
            self.desc = desc
        self.start = start
        self.fnc = fnc
        self.where = where
        self.weight = weight
        self.supportStillPicture = supportStillPicture

        printl("", self, "C")
Exemplo n.º 16
0
	def getPlayLength(self):
		printl("", self, "S")
		
		length = self.seek.getLength()
		
		printl("", self, "C")
		return length	
Exemplo n.º 17
0
def getViewClass():
	'''
	'''
	printl("", __name__, "S")
	
	printl("", __name__, "C")
	return DPS_PosterView
Exemplo n.º 18
0
    def buildList(self):
        '''
		'''
        printl("", self, "S")

        self.list = []

        for c in config.plugins.dreamplex.Entries:
            res = [c]
            res.append((eListboxPythonMultiContent.TYPE_TEXT, 5, 0, 200, 20, 1,
                        RT_HALIGN_LEFT | RT_VALIGN_CENTER, str(c.state.value)))
            res.append(
                (eListboxPythonMultiContent.TYPE_TEXT, 55, 0, 200, 20, 1,
                 RT_HALIGN_LEFT | RT_VALIGN_CENTER, str(c.name.value)))
            ip = "%d.%d.%d.%d" % tuple(c.ip.value)
            res.append((eListboxPythonMultiContent.TYPE_TEXT, 260, 0, 150, 20,
                        1, RT_HALIGN_LEFT | RT_VALIGN_CENTER, str(ip)))
            port = "%d" % (c.port.value)
            res.append((eListboxPythonMultiContent.TYPE_TEXT, 450, 0, 80, 20,
                        1, RT_HALIGN_LEFT | RT_VALIGN_CENTER, str(port)))
            self.list.append(res)

        self.l.setList(self.list)
        self.moveToIndex(0)

        printl("", self, "C")
Exemplo n.º 19
0
	def showL1(self):
			
		#self.setText("postertext", "rendering ...")
		
		if self.postersLeft[1] is not None:
			printl("show me: " + str(self.postersLeft[1]), self, "D")
			test = self.EXpicloadPoster_m1.startDecode(self.postersLeft[1])
Exemplo n.º 20
0
    def getText(self):
        '''
        '''
        printl("", self, "S")

        content = "Direct Local"
        content += "\n   Advantages:\tThe medias are played directly from E2."
        content += "\n   Prequesits:\tThis mode works if your plex library is mounted on your Dreambox and accessable."
        content += "\n   Functions:\tSeeking is working"
        content += "\n   HowTo:\tYou can use Windows or Linux based Plexserver."
        content += "\n\tSample content for Library location: movies | tvshows | music"
        content += "\n\tMedia location in Plex for Windows (sample): C:\path\of\library\root\movies\movie.mkv"
        content += "\n\tMedia location Plex for Linux (sample): /path/of/library/root/movies\movie.mkv"
        content += "\n\tMedia location on the Dreambox (sample): /media/net/mountpoint/movies\movie.mkv"
        content += "\n\tAs you can see movies/\movie.mkv is identical."
        content += "\n\tAccording to this just set up the following:"
        content += "\n\tRemote Path Part >>> C:\path\of\library\root\ or /path/of/library/root/"
        content += "\n\tLocal Path Part >>> /media/net/mountpoint/"
        content += "\n\n Transcoded"
        content += "\n   Advantages:\tThe medias go through the plex transcoder. So it is possible to set the quality."
        content += "\n   Prequesits:\tYou have to install gst-fragemented"
        content += "\n   Functions:\tSeeking is working"
        content += "\n\n Streamed"
        content += "\n   Advantages:\tIf you cant setup direct local and you dont have gst-fragmented"
        content += "\n   Prequesits:\tNothing"
        content += "\n   Functions:\tSeeking is not working"
        content += "\n\n myPlex"
        content += "\n   Advantages:\tYou can access shared libraries of friends."
        content += "\n   Prequesits:\tYou need a myPlex account."
        content += "\n   Note:\tThis is only neccessary to connect to shared libs. No need to use this in you local network"
        printl("", self, "C")
        return content
Exemplo n.º 21
0
	def showR3(self):

		#self.setText("postertext", "rendering ...")
		
		if self.postersRight[3] is not None:
			printl("show me: " + str(self.postersRight[3]), self, "D")
			test = self.EXpicloadPoster_p3.startDecode(self.postersRight[3])
Exemplo n.º 22
0
 def _load(self, primaryKeys=None, ignoreSort=False, ignoreFilter=False):
     '''
     '''
     printl("", self, "S")
 
     library = self.loadLibrary(primaryKeys)
     #printl("library: " + str(library), self, "D")
     
     self.listViewList = library[0]
     self.onEnterPrimaryKeys = library[1]
     self.onLeavePrimaryKeyValuePair = library[2]
     self.onLeaveSelectKeyValuePair = library[3]
     self.onSortKeyValuePair = library[4]
     self.onFilterKeyValuePair = library[5]
     
     if len(library) >= 7:
         self.libraryFlags = library[6]
     else:
         self.libraryFlags = {}
     
 
     if ignoreSort is False:
         # After changing the lsit always return to the default sort
         self.activeSort = self.onSortKeyValuePair[0]
     
     if ignoreFilter is False:
         # After changing the lsit always return to the default filter
         x = self.onFilterKeyValuePair[0]
         self.activeFilter = (x[0], x[1], x[2][0], )
     
     self.sort()
     self.filter()
     
     printl("", self, "C")
Exemplo n.º 23
0
def loadPlexPlugins():
    '''
	'''
    printl("", "__init__::loadPlexPlugins", "S")

    printl("registering ... movies", "__init__::loadPlexPlugins", "D")
    registerPlugin(
        Plugin(pid="movies",
               name=_("Movies"),
               start=DP_LibMovies,
               where=Plugin.MENU_MOVIES))

    printl("registering ... tvhshows",
           "__initgetBoxInformationt__::loadPlexPlugins", "D")
    registerPlugin(
        Plugin(pid="tvshows",
               name=_("TV Shows"),
               start=DP_LibShows,
               where=Plugin.MENU_TVSHOWS))

    printl("registering ... music",
           "__initgetBoxInformationt__::loadPlexPlugins", "D")
    registerPlugin(
        Plugin(pid="music",
               name=_("Music"),
               start=DP_LibMusic,
               where=Plugin.MENU_MUSIC))

    #printl("registering ... pictures", "__initgetBoxInformationt__::loadPlexPlugins", "D")
    #registerPlugin(Plugin(pid="tvshows", name=_("Music"), start=DP_LibPictures, where=Plugin.MENU_PICTURES))

    #printl("registering ... channels", "__initgetBoxInformationt__::loadPlexPlugins", "D")
    #registerPlugin(Plugin(pid="tvshows", name=_("Music"), start=DP_LibChannels, where=Plugin.MENU_CHANNELS))

    printl("", "__init__::loadPlexPlugins", "C")
Exemplo n.º 24
0
 def displayOptionsMenuCallback(self, choice):
     '''
     '''
     printl("", self, "S")
     
     if choice is None or choice[1] is None:
         return
     
     selection = self["listview"].getCurrent()
     if selection is not None:
         if choice[1].start:
             if choice[1].supportStillPicture:
                 self.session.open(choice[1].start, selection[1])
             else:
                 if self.has_key("backdrop"):
                     self["backdrop"].finishStillPicture()
                 self.session.openWithCallback(self.pluginCallback, choice[1].start, selection[1])
                 
         elif choice[1].fnc:
             if choice[1].supportStillPicture is False and self.has_key("backdrop"):
                 self["backdrop"].finishStillPicture()
             choice[1].fnc(self.session, selection[1])
             if choice[1].supportStillPicture is False and self.has_key("backdrop"):
                 self.refresh()
     
     printl("", self, "C")
Exemplo n.º 25
0
	def __init__(self, session, what = None):
		'''
		'''
		printl("", self, "S")
		
		Screen.__init__(self, session)
		self.session = session
		
		self["state"] = StaticText(_("State"))
		self["name"] = StaticText(_("Name"))
		self["ip"] = StaticText(_("IP"))
		self["port"] = StaticText(_("Port"))
		
		self["key_red"] = StaticText(_("Add"))
		self["key_yellow"] = StaticText(_("Edit"))
		self["key_blue"] = StaticText(_("Delete"))
		self["entrylist"] = DPS_ServerEntryList([])
		self["actions"] = ActionMap(["WizardActions","MenuActions","ShortcutActions"],
			{
			 "ok"	:	self.keyYellow,
			 "back"	:	self.keyClose,
			 "red"	:	self.keyRed,
			 "yellow":	self.keyYellow,
			 "blue":	 self.keyDelete,
			 }, -1)
		self.what = what
		self.updateList()
		
		printl("", self, "C")
Exemplo n.º 26
0
    def checkIfDVD(self, playbackPath):
        '''
		tries to determin if media entry is a dvd
		'''
        printl("", self, "S")

        isDVD = False
        dvdFilelist = []
        dvdDevice = None

        if playbackPath.lower().endswith(u"ifo"):  # DVD
            isDVD = True
            dvdFilelist.append(
                str(playbackPath.replace(u"/VIDEO_TS.IFO", "").strip()))

        elif playbackPath.lower().endswith(u"iso"):  # DVD
            isDVD = True
            dvdFilelist.append(str(playbackPath))

        printl("", self, "C")
        return (
            isDVD,
            dvdFilelist,
            dvdDevice,
        )
Exemplo n.º 27
0
    def keyStartLocalCache(self):
        '''
        '''
        printl("", self, "S")

        printl("start local file caching", self, "I")

        if ".m3u8" in self.url:
            self.session.open(
                MessageBox,
                _("This stream can not get saved on HDD\nm3u8 streams are not supported"
                  ), MessageBox.TYPE_INFO)

            printl("", self, "C")
            return

        if self.localCache == True:

            printl("", self, "C")
            return

        self.container = eConsoleAppContainer()
        self.container.appClosed.append(self.DLfinished)
        self.container.setCWD(config.plugins.dreamplex.playerTempPath.value)
        self.startDL()

        printl("", self, "C")
Exemplo n.º 28
0
def getViewClass():
    '''
	'''
    printl("", __name__, "S")

    printl("", __name__, "C")
    return DPS_ViewMusic
Exemplo n.º 29
0
	def getMusicSections(self, selection):
		'''
		'''
		printl("", self, "S")
		
		mainMenuList = []
		plugin = selection[2] #e.g. Plugin.MENU_MOVIES
		
		origSelection = selection
		
		# ARTISTS
		params = copy.deepcopy(selection[3])
		url = params['t_url']
		params['t_url'] = url + "?type=8"
		mainMenuList.append((_("by Artists"), plugin, params))
		printl("mainMenuList 1: " + str(mainMenuList), self, "D")
		
		#ALBUMS
		params = copy.deepcopy(selection[3])
		params['t_url'] = url + "?type=9"
		mainMenuList.append((_("by Albums"), plugin, params))
		printl("mainMenuList 2: " + str(mainMenuList), self, "D")
		
		self["menu"].setList(mainMenuList)
		self.refreshMenu(0)
		
		printl("mainMenuList: " + str(mainMenuList), self, "D")
		
		printl("", self, "C")
Exemplo n.º 30
0
	def createSetup(self, data = None):
		printl("", self, "S")
		
		separator = "".ljust(90,"_")
		
		self.cfglist = []
		
		# GENERAL SETTINGS
		self.cfglist.append(getConfigListEntry(_("General Settings") + separator, config.plugins.dreamplex.about, _(" ")))
		self.cfglist.append(getConfigListEntry(_("> Used Skin"), config.plugins.dreamplex.skins, _("If you change the skin you have to restart at least the GUI!")))
		self.cfglist.append(getConfigListEntry(_("> Show Plugin in Main Menu"), config.plugins.dreamplex.showInMainMenu, _(" ")))
		self.cfglist.append(getConfigListEntry(_("> Use Cache for Sections"), config.plugins.dreamplex.useCache, _(" ")))
		self.cfglist.append(getConfigListEntry(_("> Use Picture Cache"), config.plugins.dreamplex.usePicCache, _("Use this if you do not have enough space on your box e.g. no hdd drive just flash.")))
		self.cfglist.append(getConfigListEntry(_("> Stop Live TV on startup"), config.plugins.dreamplex.stopLiveTvOnStartup, _(" ")))
		self.cfglist.append(getConfigListEntry(_("> Show Infobar when buffer drained"), config.plugins.dreamplex.showInfobarOnBuffer, _(" ")))
		
		if config.plugins.dreamplex.showUpdateFunction.value == True:
			self.cfglist.append(getConfigListEntry(_("> Check for updates on startup"), config.plugins.dreamplex.checkForUpdateOnStartup, _("If activated on each start we will check if there is a new version depending on your update type.")))
			self.cfglist.append(getConfigListEntry(_("> Updatetype"), config.plugins.dreamplex.updateType, _("Use Beta only if you really want to help with testing")))

		# playing themes stops live tv for this reason we enable this only if live stops on startup is set
		if config.plugins.dreamplex.stopLiveTvOnStartup.value == True:
			self.cfglist.append(getConfigListEntry(_(">> Play Themes in TV Shows"), config.plugins.dreamplex.playTheme, _(" ")))
		else:
			# if the live startup stops is not set we have to turn of playtheme automatically
			config.plugins.dreamplex.playTheme.value = False
		
		# USERINTERFACE SETTINGS
		self.cfglist.append(getConfigListEntry(_("Userinterface Settings") + separator, config.plugins.dreamplex.about, _(" ")))
		self.cfglist.append(getConfigListEntry(_("> Summerize Sections"), config.plugins.dreamplex.summerizeSections, _(" ")))
		self.cfglist.append(getConfigListEntry(_("> Show Filter for Section"), config.plugins.dreamplex.showFilter, _(" ")))
		self.cfglist.append(getConfigListEntry(_("> Show Seen/Unseen count in TvShows"), config.plugins.dreamplex.showUnSeenCounts, _(" ")))
		self.cfglist.append(getConfigListEntry(_("> Use fastScroll as default"), config.plugins.dreamplex.fastScroll, _(" ")))
		
		# PATH SETTINGS
		self.cfglist.append(getConfigListEntry(_("Path Settings") + separator, config.plugins.dreamplex.about, _(" ")))
		
		self.mediafolderpath = getConfigListEntry(_("> Media Folder Path"), config.plugins.dreamplex.mediafolderpath, _(" "))
		self.cfglist.append(self.mediafolderpath)
		
		self.configfolderpath = getConfigListEntry(_("> Config Folder Path"), config.plugins.dreamplex.configfolderpath, _(" "))
		self.cfglist.append(self.configfolderpath)
		
		self.cachefolderpath = getConfigListEntry(_("> Cache Folder Path"), config.plugins.dreamplex.cachefolderpath, _(" "))
		self.cfglist.append(self.cachefolderpath)

		self.playerTempPath =  getConfigListEntry(_("> Player Temp Path"), config.plugins.dreamplex.playerTempPath, _(" "))
		self.cfglist.append(self.playerTempPath)
		
		self.logfolderpath = getConfigListEntry(_("> Log Folder Path"), config.plugins.dreamplex.logfolderpath, _(" "))
		self.cfglist.append(self.logfolderpath)
		
		# MISC
		self.cfglist.append(getConfigListEntry(_("Misc Settings") + separator, config.plugins.dreamplex.about, _(" ")))
		self.cfglist.append(getConfigListEntry(_("> Debug Mode"), config.plugins.dreamplex.debugMode, _(" ")))

		self["config"].list = self.cfglist
		self["config"].l.setList(self.cfglist)
		
		printl("", self, "C")
Exemplo n.º 31
0
 def __evUpdatedBufferInfo(self):
     '''
     '''
     #printl("", self, "S")
     
     if self.localCache:
         printl("", self, "C")
         return
     
     bufferInfo = self.session.nav.getCurrentService().streamed().getBufferCharge()
     self.buffersize = bufferInfo[4]
     self.bufferPercent = bufferInfo[0]
     self["bufferslider"].setValue(int(self.bufferPercent))
     self["label_speed"].setText("DL-Speed: " + self.formatKBits(bufferInfo[1]) )
     
     if bufferInfo[2] > 0:
         self.bitrate = bufferInfo[2] 
     
     if(self.bufferPercent > 95):
         self.bufferFull()
             
     if(self.bufferPercent == 0 and not self.endReached and (bufferInfo[1] != 0 and bufferInfo[2] !=0)):
         self.bufferEmpty()
     
     #printl("self.buffersize: " + str(self.buffersize), self, "D")
     #printl("self.bitrate: " + str(self.bitrate), self, "D")
     #printl("self.bufferSeconds: " + str(self.bufferSeconds), self, "D")
     #printl("self.bufferPercent: " + str(self.bufferPercent), self, "D")
     try:
         if self.bitrate != 0:
             self.bufferSeconds = self.buffersize / self.bitrate
             self.bufferSecondsLeft = self.bufferSeconds * self.bufferPercent / 100
     except:
         printl("something went wrong while calculating", self, "W")
Exemplo n.º 32
0
def initServerEntryConfig():
	'''
	'''
	printl("", "__init__::initServerEntryConfig", "S")
	
	config.plugins.dreamplex.Entries.append(ConfigSubsection())
	i = len(config.plugins.dreamplex.Entries) -1
	config.plugins.dreamplex.Entries[i].state 			= ConfigYesNo(default = True)
	config.plugins.dreamplex.Entries[i].connectionType  = ConfigSelection(default="0", choices = [("0", _("wan")),("1", _("lan"))])
	config.plugins.dreamplex.Entries[i].name 			= ConfigText(default = "PlexServer", visible_width = 50, fixed_size = False)
	config.plugins.dreamplex.Entries[i].ip 				= ConfigIP(default = [192,168,0,1])
	config.plugins.dreamplex.Entries[i].port 			= ConfigInteger(default=32400, limits=(1, 65555))
	config.plugins.dreamplex.Entries[i].transcode       = ConfigYesNo(default = True)
	config.plugins.dreamplex.Entries[i].transcodeType   = ConfigSelection(default="0", choices = [("0", _("m3u8")),("1", _("flv"))])
	config.plugins.dreamplex.Entries[i].quality         = ConfigSelection(default="0", choices = [("0", _("240p")),("1", _("320p")),("2", _("480p")),("3", _("720p")),("4", _("1080p"))])
	config.plugins.dreamplex.Entries[i].audioOutput     = ConfigSelection(default="2", choices = [("0", _("mp3,aac")),("1", _("mp3,aac,ac3")),("2", _("mp3,aac,ac3,dts"))])
	config.plugins.dreamplex.Entries[i].streamMode		= ConfigSelection(default="0", choices = [("0", _("HTTP Streaming")),("1", _("Local Buffer Mode")),("2", _("Direct Play"))])
	config.plugins.dreamplex.Entries[i].wol			    = ConfigYesNo(default = False)
	config.plugins.dreamplex.Entries[i].wol_mac         = ConfigText(default = "00AA00BB00CC", visible_width = 12, fixed_size = False)
	config.plugins.dreamplex.Entries[i].wol_delay		= ConfigInteger(default=60, limits=(1, 180))
	
	
	return config.plugins.dreamplex.Entries[i]
	
	printl("", "__init__::initServerEntryConfig", "C")
Exemplo n.º 33
0
	def setAudioTrack(self):
		'''
		'''
		printl("", self, "S")
		if self.switchedLanguage == False:
			try:
				service = self.session.nav.getCurrentService()
		
		
				tracks = service and self.getServiceInterface("audioTracks")
				nTracks = tracks and tracks.getNumberOfTracks() or 0
				
				if not nTracks:
					printl("no tracks found yet ... retrying later", self, "D")
					return
				
				self.nTracks = True
				trackList = []
				
				for i in xrange(nTracks):
					audioInfo = tracks.getTrackInfo(i)
					lang = audioInfo.getLanguage()
					printl("lang: " + str(lang), self, "D")
					trackList += [str(lang)]
				
				systemLanguage = language.getLanguage()[:2] # getLanguage returns e.g. "fi_FI" for "language_country"
				printl("found systemLanguage: " +  systemLanguage, self, "I")
				#systemLanguage = "en"
				
				self.tryAudioEnable(trackList, systemLanguage, tracks)
			
			except Exception, e:
				printl("audioTrack exception: " + str(e), self, "W") 
Exemplo n.º 34
0
	def buildList(self):
		'''
		'''
		printl("", self, "S")
		
		self.list=[]

		
		for c in config.plugins.dreamplex.Entries:
			res = [c]
			#res.append((eListboxPythonMultiContent.TYPE_TEXT, 5, 0, 200, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, str(c.state.value)))
			res.append((eListboxPythonMultiContent.TYPE_TEXT, 55, 0, 200, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, str(c.name.value)))
			
			if c.connectionType.value == "2":
				text1 = c.myplexUrl.value
				text2 = c.myplexUsername.value
			else:
				text1 = "%d.%d.%d.%d" % tuple(c.ip.value)
				text2 = "%d"%(c.port.value)
				
			res.append((eListboxPythonMultiContent.TYPE_TEXT, 260, 0, 150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, str(text1)))
			res.append((eListboxPythonMultiContent.TYPE_TEXT, 450, 0, 80, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, str(text2)))
			self.list.append(res)
		
		
		self.l.setList(self.list)
		self.moveToIndex(0)
				
		printl("", self, "C")
Exemplo n.º 35
0
def getMusicViewDefaults():
	printl("", __name__, "S")
	
	defaults = {}
	# mandatory items have to be defined or a assert error will come
	defaults["itemsPerPage"]		= "mandatory"
	defaults["apiLevel"]			= "mandatory"
	defaults["screen"]				= "mandatory"

	defaults["current"]				= True
	defaults["total"]				= True
	defaults["functionsContainer"]	= True
	defaults["showBackdrop"]		= True
	defaults["showPoster"]			= True
	defaults["audio"] 				= True
	defaults["resolution"] 			= True
	defaults["aspect"] 				= True
	defaults["codec"] 				= True
	defaults["rated"] 				= True
	defaults["title"] 				= True
	defaults["tag"] 				= True
	defaults["shortDescription"] 	= True
	defaults["subtitles"] 			= True
	defaults["selectedAudio"] 		= True
	defaults["genre"] 				= True
	defaults["year"] 				= True
	defaults["runtime"] 			= True
	defaults["backdroptext"]		= True
	defaults["postertext"]			= True
	defaults["rating_stars"] 		= True
	
	printl("", __name__, "C")
	return defaults
	
Exemplo n.º 36
0
def getViewClass():
	'''
	'''
	printl("",__name__ , "S")
	
	printl("",__name__ , "C")
	return DPS_ViewListLong
Exemplo n.º 37
0
    def buildInfoPlaybackArgs(self, entry):
        '''
		'''
        printl("", self, "S")

        printl("", self, "C")
        return {}
Exemplo n.º 38
0
	def postWidgetCreate(self, instance):
		printl("", self, "S")
		
		MenuList.postWidgetCreate(self, instance)
		instance.setItemHeight(20)

		printl("", self, "C")
Exemplo n.º 39
0
	def buildList(self):
		printl("", self, "S")
		
		self.list=[]

		
		for c in config.plugins.dreamplex.Entries:
			res = [c]
			#res.append((eListboxPythonMultiContent.TYPE_TEXT, 5, 0, 200, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, str(c.state.value)))
			res.append((eListboxPythonMultiContent.TYPE_TEXT, 55, 0, 200, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, str(c.name.value)))
			
			if c.connectionType.value == "2":
				text1 = c.myplexUrl.value
				text2 = c.myplexUsername.value
			else:
				text1 = "%d.%d.%d.%d" % tuple(c.ip.value)
				text2 = "%d"%(c.port.value)
				
			res.append((eListboxPythonMultiContent.TYPE_TEXT, 260, 0, 150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, str(text1)))
			res.append((eListboxPythonMultiContent.TYPE_TEXT, 450, 0, 80, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, str(text2)))
			self.list.append(res)
		
		
		self.l.setList(self.list)
		self.moveToIndex(0)
				
		printl("", self, "C")
Exemplo n.º 40
0
	def keyRight(self):
		printl("", self, "S")
		
		ConfigListScreen.keyRight(self)
		self.createSetup()
		
		printl("", self, "C")
Exemplo n.º 41
0
	def __init__(self, session):
		printl("", self, "S")
		
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		
		self.cfglist = []
		ConfigListScreen.__init__(self, self.cfglist, session, on_change = self._changed)
		
		self._session = session
		self._hasChanged = False

		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("Save"))
		self["help"] = StaticText()
		
		self["setupActions"] = ActionMap(["SetupActions", "ColorActions", "DPS_Settings"],
		{
			"green": self.keySave,
			"red": self.keyCancel,
			"cancel": self.keyCancel,
			"ok": self.ok,
			"left": self.keyLeft,
			"right": self.keyRight,
			"bouquet_up":	self.keyBouquetUp,
			"bouquet_down":	self.keyBouquetDown,
		}, -2)
		
		self.createSetup()
		
		self["config"].onSelectionChanged.append(self.updateHelp)
		
		printl("", self, "C")
Exemplo n.º 42
0
	def keySave(self):
		printl("", self, "S")

		self.saveAll()
		self.close(None)
		
		printl("", self, "C")
Exemplo n.º 43
0
	def __init__(self, session, what = None):
		printl("", self, "S")
		
		Screen.__init__(self, session)
		self.session = session
		
		self["state"] = StaticText(_("State"))
		self["name"] = StaticText(_("Name"))
		self["ip"] = StaticText(_("IP"))
		self["port"] = StaticText(_("Port"))
		
		self["key_red"] = StaticText(_("Discover"))
		self["key_green"] = StaticText(_("Add"))
		self["key_yellow"] = StaticText(_("Edit"))
		self["key_blue"] = StaticText(_("Delete"))
		self["entrylist"] = DPS_ServerEntryList([])
		self["actions"] = ActionMap(["WizardActions","MenuActions","ShortcutActions"],
			{
			 "ok"	:	self.keyYellow,
			 "back"	:	self.keyClose,
			 "red"	:	self.keyRed,
			 "yellow":	self.keyYellow,
			 "green":	self.keyGreen,
			 "blue":	self.keyDelete,
			 }, -1)
		self.what = what
		self.updateList()
		
		printl("", self, "C")
Exemplo n.º 44
0
	def setPara(self):
		'''
		'''
		printl("", self, "S")
		
		self.EXpicloadPoster.setPara([self["poster"].instance.size().width(), self["poster"].instance.size().height(), self.EXscale[0], self.EXscale[1], 0, 1, "#002C2C39"])
		self.EXpicloadBackdrop.setPara([self["mybackdrop"].instance.size().width(), self["mybackdrop"].instance.size().height(), self.EXscale[0], self.EXscale[1], 0, 1, "#002C2C39"])
		
		ptr_red = "/usr/lib/enigma2/python/Plugins/Extensions/DreamPlex/skin/1280x720/buttons/red.png"
		self["btn_red"].instance.setPixmapFromFile(ptr_red)
		
		ptr_blue = "/usr/lib/enigma2/python/Plugins/Extensions/DreamPlex/skin/1280x720/buttons/blue.png"
		self["btn_blue"].instance.setPixmapFromFile(ptr_blue)
		
		ptr_yellow = "/usr/lib/enigma2/python/Plugins/Extensions/DreamPlex/skin/1280x720/buttons/yellow.png"
		self["btn_yellow"].instance.setPixmapFromFile(ptr_yellow)
		
		ptr_zero = "/usr/lib/enigma2/python/Plugins/Extensions/DreamPlex/skin/all/key_0.png"
		self["btn_zero"].instance.setPixmapFromFile(ptr_zero)
		
		ptr_nine = "/usr/lib/enigma2/python/Plugins/Extensions/DreamPlex/skin/all/key_9.png"
		self["btn_nine"].instance.setPixmapFromFile(ptr_nine)
		
		ptr_pvr = "/usr/lib/enigma2/python/Plugins/Extensions/DreamPlex/skin/all/pvr.png"
		self["btn_pvr"].instance.setPixmapFromFile(ptr_pvr)
		
		ptr_menu = "/usr/lib/enigma2/python/Plugins/Extensions/DreamPlex/skin/all/menu.png"
		self["btn_menu"].instance.setPixmapFromFile(ptr_menu)
		
		self.resetGuiElementsInFastScrollMode()
		
		printl("", self, "C")
Exemplo n.º 45
0
    def onKeyInfo(self):
        '''
		'''
        printl("", self, "S")

        self.showFunctions(not self.areFunctionsHidden)

        printl("", self, "C")
Exemplo n.º 46
0
	def _changed(self):
		'''
		'''
		printl("", self, "S")
		
		self._hasChanged = True

		printl("", self, "C")
Exemplo n.º 47
0
	def keyRed(self):
		'''
		'''
		printl("", self, "S")
		
		self.session.openWithCallback(self.updateList, DPS_ServerEntryConfigScreen, None)
		
		printl("", self, "C")
Exemplo n.º 48
0
 def notifyEntryStopped(self, flags):
     printl("", self, "D")
     args = {}
     args["status"] = "stopped"
     plugins = getPlugins(where=Plugin.INFO_PLAYBACK)
     for plugin in plugins:
         printl("plugin.name=" + str(plugin.name), self, "D")
         plugin.fnc(args, flags)
Exemplo n.º 49
0
 def notifyEntryPlaying(self, entry, flags):
     printl("", self, "D")
     args = self.buildInfoPlaybackArgs(entry)
     args["status"] = "playing"
     plugins = getPlugins(where=Plugin.INFO_PLAYBACK)
     for plugin in plugins:
         printl("plugin.name=" + str(plugin.name), self, "D")
         plugin.fnc(args, flags)
Exemplo n.º 50
0
    def close(self, arg=None):
        '''
		'''
        printl("", self, "S")

        super(getViewClass(), self).close(arg)

        printl("", self, "C")
Exemplo n.º 51
0
	def keyClose(self):
		'''
		'''
		printl("", self, "S")
		
		self.close(self.session, self.what, None)

		printl("", self, "C")
Exemplo n.º 52
0
    def onKeyUp(self):
        '''
		'''
        printl("", self, "S")

        self.onPreviousEntry()

        printl("", self, "C")
Exemplo n.º 53
0
    def onKeyLeft(self):
        '''
		'''
        printl("", self, "S")

        self.onPreviousPage()

        printl("", self, "C")
Exemplo n.º 54
0
    def playEntry(self, entry):
        '''
		'''
        printl("", self, "S")

        super(getViewClass(), self).playEntry(entry)

        printl("", self, "C")
Exemplo n.º 55
0
    def leavePlayer(self):
        '''
        '''
        printl("", self, "S")

        self.leavePlayerConfirmed(True)

        printl("", self, "C")
Exemplo n.º 56
0
    def onKeyDown(self):
        '''
		'''
        printl("", self, "S")

        self.onNextEntry()

        printl("", self, "C")
Exemplo n.º 57
0
	def setCustomTitle(self):
		'''
		'''
		printl("", self, "S")
		
		self.setTitle(_("Settings"))

		printl("", self, "C")
Exemplo n.º 58
0
    def onKeyRight(self):
        '''
		'''
        printl("", self, "S")

        self.onNextPage()

        printl("", self, "C")
Exemplo n.º 59
0
	def updateList(self):
		'''
		'''
		printl("", self, "S")
		
		self["entrylist"].buildList()

		printl("", self, "C")