-
-
Save ajgappmark/a3406b9cbeda2bac4bd7 to your computer and use it in GitHub Desktop.
ruby-dbus play with Banshee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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