Skip to content

Instantly share code, notes, and snippets.

@markoa
Created January 7, 2010 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save markoa/271388 to your computer and use it in GitHub Desktop.
Save markoa/271388 to your computer and use it in GitHub Desktop.
ruby-dbus play with Banshee
#!/usr/bin/env ruby
require 'dbus'
bus = DBus::SessionBus.instance
banshee_service = bus.service("org.bansheeproject.Banshee")
banshee = banshee_service.object("/org/bansheeproject/Banshee/PlayerEngine")
puts banshee.introspect
player_iface = banshee["org.bansheeproject.Banshee.PlayerEngine"]
puts player_iface.inspect
#player_iface.Play
banshee.default_iface = "org.bansheeproject.Banshee.PlayerEngine"
banshee.on_signal("EventChanged") do |evnt, message, buffering_percent|
puts "#{evnt} #{message} #{buffering_percent}"
end
banshee.on_signal("StateChanged") do |state|
puts state
end
puts "Looping..."
loop = DBus::Main.new
loop << bus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment