Ejemplo 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)
Ejemplo n.º 2
0
	def append(self, item):
		## Appends an item to the queue.
		# If we have a path to a mounted DVD, we should play it
		# properly
		if (os.path.isdir(item+'/VIDEO_TS')):
			item = 'dvd://'+item
		# Make sure 'item' is a URI.
		if ('://' not in item): item = 'file://' + item
		# Create a new row.
		row = self.list.append()
		# Add the path and the interpreted name to the row item.
		self.list.set_value(row, 0, item)
		# Initiate the tag reading process, but show the filename in case it fails.
		self.list.set_value(row, 1, useful.uriToFilename(item))
		# Flag whether file is a video or not, default True (ie is a video)
		# This default disables gapless until we are sure it'll work properly
		self.list.set_value(row, 2, True)
		tagger.fileTag.file(item, self.setItmTags)
		# The queue has changed.
		self.queueChanged()