Beispiel #1
0
	def REP(self):
		self.stop_state()
		select = self.tree.get_selection()
		filepath = path.on_tree_selection_changed(select)
		tag = eyeD3.Tag()
		audio = MP3(filepath)
		file = File(filepath)
		try:
			artwork = file.tags['APIC:'].data 
			with open('artwork.png', 'wb') as img:
				img.write(artwork)
			self.imagen.set_from_pixbuf(gtk.gdk.pixbuf_new_from_file_at_size('artwork.png', 200, 200))
		except:
			self.imagen.set_from_file("NOCD.png")
		
		duration = audio.info.length
		times = int(duration/60) + float(int((float(duration/60) - int(duration/60))*60))/100
		tag.link(filepath)
		self.info.set_text(" Se ha iniciado la reproduccion ")
		self.artista.set_text(tag.getArtist())
		self.album.set_text(tag.getAlbum())
		self.duracion.set_text("%.2f" % times + "  min")
		self.titulo.set_text(tag.getTitle())
		self.player.set_property("uri", "file://"+filepath)
		self.hilo = MiThread(duration,self.progressBar,1)
		self.hilo.start()
		self.player.set_state(gst.STATE_PLAYING)
Beispiel #2
0
	def save(self,widget):
		select = self.tree.get_selection()
		filepath = path.on_tree_selection_changed(select)
		tag = eyeD3.Tag()
		tag.link(filepath)
		tag.setAlbum(self.stock_album.get_text())
		tag.setArtist(self.stock_interp.get_text())
		tag.setTitle(self.stock_titulo.get_text())
		tag.update()
		self.window_edicion.hide()
Beispiel #3
0
	def edicion(self,widget):
		try:
			select = self.tree.get_selection()
			filepath = path.on_tree_selection_changed(select)
			tag = eyeD3.Tag()
			tag.link(filepath)
			self.stock_album.set_text(tag.getAlbum())
			self.stock_interp.set_text(tag.getArtist())
			self.stock_titulo.set_text(tag.getTitle())
			self.window_edicion.show()
		except:
			pass
Beispiel #4
0
	def delete(self,widget):
		select = self.tree.get_selection()
		filepath = path.on_tree_selection_changed(select)
		(modelo,filas) = select.get_selected_rows()
		for i in filas:
				for token in i:
					if token == '(' or token == ' ' or token == ',' or token == ')':
						pass
					else:
						node = token
				val = int(node)
				iterador = modelo.get_iter(i)
		treeiter = self.medialist.remove(iterador)

		dom = minidom.parse(path.TRACK)
		found = -1
		for i in range(0,len(dom.getElementsByTagName("track"))):
			if filepath.find(dom.getElementsByTagName("track")[i].firstChild.data) >= 0:
				found = i
		dom.getElementsByTagName("wml")[0].removeChild(dom.getElementsByTagName("pista")[found])
		xmldocument = open(path.TRACK,"w")
		dom.writexml(xmldocument)
		xmldocument.close()