Example #1
0
		bottom_layout.pack(self._seek, 0, 1)

		# Add bottom_box
		main_layout.add(self._bottom_box, Clutter.BinAlignment.CENTER, Clutter.BinAlignment.END)

		self.connect('enter-event', self.fade_in)
		self.connect('leave-event', self.fade_out)

	def insert_songs(self, songs, index):
		model = self.get_property('lomo')
		for song in songs:
			model.insert_uri(Lomo.create_uri(song), index)

	def fade_in(self, actor, ev):
		self._bottom_box.animatev(Clutter.AnimationMode.EASE_OUT_EXPO, 500,
			("opacity",), (0xff,))

	def fade_out(self, actor, ev):
		self._bottom_box.animatev(Clutter.AnimationMode.EASE_OUT_EXPO, 500,
			("opacity",), (0x00,))

if __name__ == '__main__':
	Lomo.init(0, "")
	ClutterX11.set_use_argb_visual(True)
	Clutter.init([])
	app = App(sys.argv[1:])
	app.connect('destroy', lambda w: Clutter.main_quit())
	app.show()
	Clutter.main()

Example #2
0
	def insert_songs(self, songs, index):
		model = self.get_property('lomo')
		for song in songs:
			model.insert_uri(Lomo.create_uri(song), index)
Example #3
0
		parent = self._app.get_window(),
		action = Gtk.FileChooserAction.SELECT_FOLDER)
		dialog.add_button(Gtk.STOCK_OK, 1)

		code = dialog.run()
		if code == 1:
			dialog.hide()
			uri = dialog.get_filename()
			if uri:
				importer = Importer(self._app.get_adb())
				importer.scan((uri,))
		dialog.destroy()

if __name__ == '__main__':
	def do_run():
		i = Importer(extensions = ('mp3',))
		i.scan(sys.argv)
		return False

	try:
		Lomo.init(0, '')
		Gtk.init([])
		w = Gtk.Window()
		w.show_all()
		w.connect('delete-event', lambda w, ev: Gtk.main_quit())
		GLib.timeout_add(1, do_run)
		Gtk.main()
	except KeyboardInterrupt:
		sys.exit(0)