Sha256: 9097405ec4e8fdbdb9d2c7c2af7033d6ab4aec73f875490ab4f9ba4f978c8fb2

Contents?: true

Size: 795 Bytes

Versions: 17

Compression:

Stored size: 795 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require "dbus"

session_bus = DBus::SessionBus.instance

# Get the Rhythmbox service
rhythmbox = session_bus.service("org.gnome.Rhythmbox")

# Get the object from this service
player = rhythmbox.object("/org/gnome/Rhythmbox/Player")

if player.has_iface? "org.gnome.Rhythmbox.Player"
  puts "We have Rhythmbox Player interface"
end

player_with_iface = player["org.gnome.Rhythmbox.Player"]
p player_with_iface.getPlayingUri

# Maybe support default_iface=(iface_str) on an ProxyObject, so
# that this is possible?
player.default_iface = "org.gnome.Rhythmbox.Player"
puts "default_iface test:"
p player.getPlayingUri
player.on_signal("elapsedChanged") do |u|
  puts "elapsedChanged: #{u}"
end

main = DBus::Main.new
main << session_bus
main.run

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ruby-dbus-0.23.1 examples/simple/call_introspect.rb
ruby-dbus-0.23.0.beta2 examples/simple/call_introspect.rb
ruby-dbus-0.23.0.beta1 examples/simple/call_introspect.rb
ruby-dbus-0.22.1 examples/simple/call_introspect.rb
ruby-dbus-0.22.0 examples/simple/call_introspect.rb
ruby-dbus-0.21.0 examples/simple/call_introspect.rb
ruby-dbus-0.20.0 examples/simple/call_introspect.rb
ruby-dbus-0.19.0 examples/simple/call_introspect.rb
ruby-dbus-0.18.1 examples/simple/call_introspect.rb
ruby-dbus-0.18.0.beta8 examples/simple/call_introspect.rb
ruby-dbus-0.18.0.beta7 examples/simple/call_introspect.rb
ruby-dbus-0.18.0.beta6 examples/simple/call_introspect.rb
ruby-dbus-0.18.0.beta5 examples/simple/call_introspect.rb
ruby-dbus-0.18.0.beta4 examples/simple/call_introspect.rb
ruby-dbus-0.18.0.beta3 examples/simple/call_introspect.rb
ruby-dbus-0.18.0.beta2 examples/simple/call_introspect.rb
ruby-dbus-0.18.0.beta1 examples/simple/call_introspect.rb