Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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