Exemplo n.º 1
0
	def setPlayingTitle(self, tags):
		# If the tags passed aren't 'None'.
		if (tags):
			# If we don't want to set it, return.
			if (not cfg.getBool('gui/fileastitle')): return
			# Set the title name.
			dispTitle = tagger.getDispTitle(tags)
			if (dispTitle):
				# Update the currently displayed titles URI.
				self.titlesURI = player.uri
			else:
				# Use the filename if no tags were found.
				if not (self.titlesURI == player.uri):
					# Make sure we haven't already used tags for this file.
					# If we have, we may as well continue using them.
					# Certain files send 4 or more tag signals, and
					# only one contains useful information.
					dispTitle = useful.uriToFilename(player.uri, ext=False)
				else:
					dispTitle = None
				
			titlename = dispTitle + ' - ' + useful.lName if dispTitle else None
		
		else:
			# Otherwise, the default title.
			titlename = useful.lName
			
		# Set the title.
		if titlename: self.mainWindow.set_title(titlename)
Exemplo n.º 2
0
	def setItmTags(self, uri, tags, isvideo, args=None):
		# file hasn't been set yet, stops errors on startup
		file = None
		# Get the current file
		for x in range(len(self.list)):
			if (self.list[x][0] == uri):
				file = self.list[x]
				break
		# Set the video flag
		if file:
			file[2] = isvideo
		## Sets the items tags and displays them (maybe not very efficient).
		dispTitle = tagger.getDispTitle(tags)
		# Add display title if available, else pass
		if dispTitle and file:
			file[1] = dispTitle
		else:
			return