Re: [Rhythmbox-devel] Rhythmbox crashes when using threads and network sockets

I have now tried with dbus. I found some nice tutorials [1] [2] so I got some code looking like:

session_bus = dbus.SessionBus()
proxy_obj = session_bus.get_object('org.gnome.Rhythmbox', '/org/gnome/Rhythmbox/Player')
player = dbus.Interface(proxy_obj, 'org.gnome.Rhythmbox.Player')

# get playing song
print player.getPlayingUri()
# skip to next

Much easier than I thought. However, one of the tutorials [2] described how I should the dbus-next utility to get information about all the different method are available via dbus. Using the following message I know what kind of objects I can get from rhythmbox:

dbus-send --print-reply --dest=org.gnome.Rhythmbox /org/gnome/Rhythmbox org.freedesktop.DBus.Introspectable.Introspect

Which gives:
  <node name="DAAP"/>
  <node name="Player"/>
  <node name="PlaylistManager"/>
  <node name="Shell"/>

I can do the same with them:

dbus-send --print-reply --dest=org.gnome.Rhythmbox /org/gnome/Rhythmbox/Player org.freedesktop.DBus.Introspectable.Introspect

<method name="getPlayingUri">
      <arg name="uri" type="s" direction="out"/>
    <method name="getPlaying">
      <arg name="playing" type="b" direction="out"/>
    <method name="next">
    <method name="previous">

Now I'm wondering, is there any documentation on these methods I get from the command, for instance getPlayingUri? Or is the xml file the only documentation? And with that said, can I "only" use the method defined in the introspect files? So if I need more functionality, I have to use threads (or some other kind of communication so I get access to the shell)?

Thanks for your help!

Oh, and by the way, with threads, I used the gdk lock functions to avoid crashing rhythmbox:

# get lock
# do stuff with gtk
# release lock

Kind regards,


--- Den mån 2010-03-22 skrev Michael Gratton <mike vee net>:

Från: Michael Gratton <mike vee net>
Ämne: Re: [Rhythmbox-devel] Rhythmbox crashes when using threads and network sockets
Till: rhythmbox-devel gnome org
Datum: måndag 22 mars 2010 00.12

On 22/03/10 07:23, Samuel Skånberg wrote:
> If I run my cli app that connects to the plugin and issue "play" and
> then "pause" a couple of times, rhythmbox crashes and segfaults.
> Any ideas why or what I could do instead?

Programming with whreads are generally error prone and is best avoided. Is there any reason why you cannot use the DBus interface to talk to RB? You wouldn't need the plugin at all then.


-- ⎊ michael gratton, itinerant geek
⎈ <>
rhythmbox-devel mailing list
rhythmbox-devel gnome org

Använder du Yahoo!?
Är du trött på spam? Yahoo! E-post har det bästa spamskyddet som finns

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]