Esempio n. 1
0
    def cb_Menu(self, data):
        print "cb_Menu:"
        if data != []:
            if data[0] == 2:
                nm = self['streamlist'].getCurrent()[0][0]
                p = nm.find('-')
                if p > 0:
                    scArtist = nm[:p].strip()
                    scTitle = nm[p + 1:].strip()
                else:
                    scArtist = ''
                    scTitle = nm

                url = self['streamlist'].getCurrent()[0][1]
                ltype = 'canna'
                token = ''
                album = ''
                entry = [scTitle, url, scArtist, album, ltype, token]

                res = SimplePlaylistIO.addEntry(data[1], entry)
                if res == 1:
                    self.session.open(MessageBox,
                                      _("Eintrag hinzugefügt"),
                                      MessageBox.TYPE_INFO,
                                      timeout=5)
                elif res == 0:
                    self.session.open(MessageBox,
                                      _("Eintrag schon vorhanden"),
                                      MessageBox.TYPE_INFO,
                                      timeout=5)
                else:
                    self.session.open(MessageBox,
                                      _("Fehler!"),
                                      MessageBox.TYPE_INFO,
                                      timeout=5)
Esempio n. 2
0
	def cb_Menu(self, data):
		print "cb_Menu:"
		if data != []:
			if data[0] == 2:
				nm = self['streamlist'].getCurrent()[0][0]
				p = nm.find('-')
				if p > 0:
					scArtist = nm[:p].strip()
					scTitle = nm[p+1:].strip()
				else:
					scArtist = ''
					scTitle = nm

				url = self['streamlist'].getCurrent()[0][1]
				ltype = 'canna'
				token = ''
				album = ''
				entry = [scTitle, url, scArtist, album, ltype, token, '']

				res = SimplePlaylistIO.addEntry(data[1], entry)
				if res == 1:
					self.session.open(MessageBox, _("Eintrag hinzugefügt"), MessageBox.TYPE_INFO, timeout=5)
				elif res == 0:
					self.session.open(MessageBox, _("Eintrag schon vorhanden"), MessageBox.TYPE_INFO, timeout=5)
				else:
					self.session.open(MessageBox, _("Fehler!"), MessageBox.TYPE_INFO, timeout=5)
Esempio n. 3
0
    def cb_Menu(self, data):
        print "cb_Menu:"
        if data != []:
            if data[0] == 2 and self.playing:
                scArtist = self['streamlist'].getCurrent()[0][0]
                scTitle = self['streamlist'].getCurrent()[0][1]
                url = ''
                ltype = 'songsto'
                token = ''
                album = self["album"].getText()
                entry = [scTitle, url, scArtist, album, ltype, token, '']

                res = SimplePlaylistIO.addEntry(data[1], entry)
                if res == 1:
                    self.session.open(MessageBox,
                                      _("Eintrag hinzugefügt"),
                                      MessageBox.TYPE_INFO,
                                      timeout=5)
                elif res == 0:
                    self.session.open(MessageBox,
                                      _("Eintrag schon vorhanden"),
                                      MessageBox.TYPE_INFO,
                                      timeout=5)
                else:
                    self.session.open(MessageBox,
                                      _("Fehler!"),
                                      MessageBox.TYPE_INFO,
                                      timeout=5)
Esempio n. 4
0
    def cb_Menu(self, data):
        print "cb_Menu:"
        if data != []:
            if data[0] == 2:
                nm = self["liste"].getCurrent()[0][0]
                p = nm.find("-")
                if p > 0:
                    scArtist = nm[:p].strip()
                    scTitle = nm[p + 1 :].strip()
                else:
                    scArtist = ""
                    scTitle = nm

                url = self["liste"].getCurrent()[0][1]
                ltype = "canna"
                token = ""
                album = ""
                entry = [scTitle, url, scArtist, album, ltype, token, "", "0"]

                res = SimplePlaylistIO.addEntry(data[1], entry)
                if res == 1:
                    self.session.open(MessageBoxExt, _("Added entry"), MessageBoxExt.TYPE_INFO, timeout=5)
                elif res == 0:
                    self.session.open(MessageBoxExt, _("Entry already exists"), MessageBoxExt.TYPE_INFO, timeout=5)
                else:
                    self.session.open(MessageBoxExt, _("Error!"), MessageBoxExt.TYPE_INFO, timeout=5)
Esempio n. 5
0
	def globalList(self):
		self.ltype = 'sl_glob_playlist'
		self['ContentTitle'].setText("Global Playlist")

		self.filelist = SimplePlaylistIO.getPL('mp_global_pl_01')
		if self.filelist == []:
			self.keyLocked = True
			self['F4'].hide()
			self.filelist.append(("Keine globale Playlist gefunden.", "dump"))
		else:
			self['F4'].show()
			self.chooseMenuList.setList(map(simplelistListEntry, self.filelist))
			self.keyLocked = False
Esempio n. 6
0
	def globalList(self):
		self.ltype = 'sl_glob_playlist'
		self['ContentTitle'].setText("Global Playlist-%02d" % config.mediaportal.sp_pl_number.value)
		self['F4'].show()
		self.filelist == []
		self.filelist = SimplePlaylistIO.getPL('mp_global_pl_%02d' % config.mediaportal.sp_pl_number.value)
		if self.filelist == []:
			self.keyLocked = True
			self['F4'].hide()
			self.filelist.append(("Keine Einträge gefunden.", "dump"))
		else:
			self['F4'].show()
			self.keyLocked = False
		self.chooseMenuList.setList(map(simplelistListEntry, self.filelist))
Esempio n. 7
0
	def cb_Menu(self, data):
		print "cb_Menu:"
		if data != []:
			if data[0] == 2 and self.playing:
				scArtist = self['streamlist'].getCurrent()[0][0]
				scTitle = self['streamlist'].getCurrent()[0][1]
				url = ''
				ltype = 'songsto'
				token = ''
				album = self["album"].getText()
				entry = [scTitle, url, scArtist, album, ltype, token, '']
					
				res = SimplePlaylistIO.addEntry(data[1], entry)
				if res == 1:
					self.session.open(MessageBox, _("Eintrag hinzugefügt"), MessageBox.TYPE_INFO, timeout=5)
				elif res == 0:
					self.session.open(MessageBox, _("Eintrag schon vorhanden"), MessageBox.TYPE_INFO, timeout=5)
				else:
					self.session.open(MessageBox, _("Fehler!"), MessageBox.TYPE_INFO, timeout=5)
Esempio n. 8
0
    def cb_Menu(self, data):
        print "cb_Menu:"
        if data != []:
            if data[0] == 2 and self.playing:
                scArtist = self["streamlist"].getCurrent()[0][1]
                scTitle = self["streamlist"].getCurrent()[0][0]
                url = ""
                ltype = "songsto"
                token = self["streamlist"].getCurrent()[0][4]
                album = self["streamlist"].getCurrent()[0][2]
                imgurl = "http://songs.to/covers/" + self["streamlist"].getCurrent()[0][3]
                entry = [scTitle, url, scArtist, album, ltype, token, imgurl]

                res = SimplePlaylistIO.addEntry(data[1], entry)
                if res == 1:
                    self.session.open(MessageBox, _("Eintrag hinzugefügt"), MessageBox.TYPE_INFO, timeout=5)
                elif res == 0:
                    self.session.open(MessageBox, _("Eintrag schon vorhanden"), MessageBox.TYPE_INFO, timeout=5)
                else:
                    self.session.open(MessageBox, _("Fehler!"), MessageBox.TYPE_INFO, timeout=5)
Esempio n. 9
0
		self.session.openWithCallback(self.cb_Menu, SimplePlayerMenu, 'extern')

	def cb_Menu(self, data):
		print "cb_Menu:"
		if data != []:
			if data[0] == 2:
				playinfos = self['liste'].getCurrent()[0][0]
				if re.match('.*?-', playinfos):
					playinfos = playinfos.split(' - ')
					if playinfos:
						if len(playinfos) == 2:
							scArtist = playinfos[0]
							scTitle = playinfos[1]
							self["artist"].setText(playinfos[0])
							self["songtitle"].setText(playinfos[1])
					else:
						playinfos = playinfos.split('-')
						if playinfos:
							if len(playinfos) == 2:
								scArtist = playinfos[0]
								scTitle = playinfos[1]
								self["artist"].setText(playinfos[0])
								self["songtitle"].setText(playinfos[1])
				else:
					self["artist"].setText(playinfos)
					scArtist = ''
					scTitle = playinfos

				url = self['liste'].getCurrent()[0][1]
				ltype = 'eighties'
				token = self.token
				album = self.genreName
				entry = [scTitle, url, scArtist, album, ltype, token, '', '0']

				res = SimplePlaylistIO.addEntry(data[1], entry)
				if res == 1:
					self.session.open(MessageBoxExt, _("Added entry"), MessageBoxExt.TYPE_INFO, timeout=5)
				elif res == 0:
					self.session.open(MessageBoxExt, _("Entry already exists"), MessageBoxExt.TYPE_INFO, timeout=5)
Esempio n. 10
0
	def cb_Menu(self, data):
		print "cb_Menu:"
		if data != []:
			if data[0] == 2:
				playinfos = self['streamlist'].getCurrent()[0][0]
				if re.match('.*?-', playinfos):
					playinfos = playinfos.split(' - ')
					if playinfos:
						if len(playinfos) == 2:
							scArtist = playinfos[0]
							scTitle = playinfos[1]
							self["artist"].setText(playinfos[0])
							self["songtitle"].setText(playinfos[1])
					else:
						playinfos = playinfos.split('-')
						if playinfos:
							if len(playinfos) == 2:
								scArtist = playinfos[0]
								scTitle = playinfos[1]
								self["artist"].setText(playinfos[0])
								self["songtitle"].setText(playinfos[1])
				else:
					self["artist"].setText(playinfos)
					scArtist = ''
					scTitle = playinfos
					
				url = self['streamlist'].getCurrent()[0][1]
				ltype = 'eighties'
				token = self.token
				album = self.genreName
				entry = [scTitle, url, scArtist, album, ltype, token, '']
					
				res = SimplePlaylistIO.addEntry(data[1], entry)
				if res == 1:
					self.session.open(MessageBox, _("Eintrag hinzugefügt"), MessageBox.TYPE_INFO, timeout=5)
				elif res == 0:
					self.session.open(MessageBox, _("Eintrag schon vorhanden"), MessageBox.TYPE_INFO, timeout=5)
				else:
					self.session.open(MessageBox, _("Fehler!"), MessageBox.TYPE_INFO, timeout=5)
Esempio n. 11
0
	def cb_Menu(self, data):
		print "cb_Menu:"
		if data != []:
			if data[0] == 2:
				playinfos = self['streamlist'].getCurrent()[0][0]
				if re.match('.*?-', playinfos):
					playinfos = playinfos.split(' - ')
					if playinfos:
						if len(playinfos) == 2:
							scArtist = playinfos[0]
							scTitle = playinfos[1]
							self["artist"].setText(playinfos[0])
							self["songtitle"].setText(playinfos[1])
					else:
						playinfos = playinfos.split('-')
						if playinfos:
							if len(playinfos) == 2:
								scArtist = playinfos[0]
								scTitle = playinfos[1]
								self["artist"].setText(playinfos[0])
								self["songtitle"].setText(playinfos[1])
				else:
					self["artist"].setText(playinfos)
					scArtist = ''
					scTitle = playinfos
					
				url = self['streamlist'].getCurrent()[0][1]
				ltype = 'eighties'
				token = self.token
				album = self.genreName
				entry = [scTitle, url, scArtist, album, ltype, token, '']
					
				res = SimplePlaylistIO.addEntry(data[1], entry)
				if res == 1:
					self.session.open(MessageBox, _("Eintrag hinzugefügt"), MessageBox.TYPE_INFO, timeout=5)
				elif res == 0:
					self.session.open(MessageBox, _("Eintrag schon vorhanden"), MessageBox.TYPE_INFO, timeout=5)
				else:
					self.session.open(MessageBox, _("Fehler!"), MessageBox.TYPE_INFO, timeout=5)
Esempio n. 12
0
	def deleteEntry(self):
		if self.ltype != 'sl_glob_playlist' or not len(self.filelist):
			return
		idx = self['genreList'].getSelectedIndex()
		SimplePlaylistIO.delEntry('mp_global_pl_01', self.filelist, idx)
		self.chooseMenuList.setList(map(simplelistListEntry, self.filelist))
Esempio n. 13
0
	def deleteEntry(self):
		if self.ltype != 'sl_glob_playlist' or not len(self.filelist):
			return
		idx = self['genreList'].getSelectedIndex()
		SimplePlaylistIO.delEntry('mp_global_pl_%02d' % config.mediaportal.sp_pl_number.value, self.filelist, idx)
		self.chooseMenuList.setList(map(simplelistListEntry, self.filelist))