Exemplo 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)
Exemplo 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)
Exemplo n.º 3
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)
Exemplo n.º 4
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)
Exemplo n.º 5
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)
Exemplo n.º 6
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)
Exemplo n.º 7
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)
Exemplo n.º 8
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)
Exemplo n.º 9
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)