def activate(self, totem):
		DBusGMainLoop(set_as_default=True)
		self.notification = Notification("/org/gnome/Totem", totem)
		self.title = ""
		self.artist = ""
		self.album = ""
		self.duration = 0 # may be usable in future
		totem.connect("file-opened", self.do_file_opened)
		totem.connect("file-closed", self.do_file_closed)
		totem.connect("metadata-updated", self.do_update_metadata)
		totem.connect("notify::playing", self.do_notify)
Exemplo n.º 2
0
	def __init__(self, name, totem):
		dbus.service.Object.__init__(self, name, '/Player')
		self.totem = totem

		self.null_metadata = {"year" : "", "tracknumber" : "", "location" : "",
			"title" : "", "album" : "", "time" : "", "genre" : "", "artist" : ""}
		self.old_metadata = self.null_metadata.copy()
		self.current_metadata = self.null_metadata.copy()
		self.old_caps = 64 # at startup, we can only support a playlist
		self.old_status = (2, 0, 0, 0) # startup state

		totem.connect("metadata-updated", self.do_update_metadata)
		totem.connect("notify::playing", self.do_notify)
		totem.connect("notify::seekable", self.do_notify)
		totem.connect("notify::current-mrl", self.do_notify)