Getting values from Banshee-player's "EventChanged" signal.

Osmo Maatta osmoma at gmail.com
Thu Sep 23 05:48:22 PDT 2010


I have a small GTK-application that needs to react to various
DBus-events sent by media-players.

I have some problems connecting a DBus-signal for the Banshee
media-player. I have used dbus-monitor and qdbus tools to debug the
messages and their arguments.

$ qdbus org.bansheeproject.Banshee /org/bansheeproject/Banshee/PlayerEngine

The signals and arguments are:
...
signal void org.bansheeproject.Banshee.PlayerEngine.StateChanged(QString
state)

signal void org.bansheeproject.Banshee.PlayerEngine.EventChanged(QString
evnt, QString message, double bufferingPercent)
...

Output from dbus-monitor (when Banshee player changes track/song) shows
that the arguments are; string, string, double.

$ dbus-monitor
...
signal sender=:1.125 -> dest=(null destination) serial=1549
path=/org/bansheeproject/Banshee/PlayerEngine;
interface=org.bansheeproject.Banshee.PlayerEngine; member=EventChanged
   string "startofstream"
   string ""
   double 0
-----------------------

The "StateChanged" message/signal works just fine.

The problem is in the "EventChanged" signal.

Here is a  complete test code:
http://www.futuredesktop.com/tmp/banshee_test.c

Of course, you will need to have Banshee-media player for this test.

Compile it:
$ gcc $(pkg-config --cflags --libs dbus-1 dbus-glib-1 gtk+-2.0)
banshee_test.c -o banshee_test

Run it:
$ ./banshee_test

It outputs this at start:
** (banshee_test:22386): WARNING **: No marshaller for signature of
signal 'EventChanged'

It outputs this when Banshee changes to a new song/track.
** (banshee_test:22386): CRITICAL **:
marshal_dbus_message_to_g_marshaller: assertion `c_marshaller != NULL'
failed
--

The add-signal setting for "EventChanged" should be this, but it fails:
dbus_g_proxy_add_signal(proxy, "EventChanged", G_TYPE_STRING,
G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_INVALID);

Please help if you can.

Kindly
  Osmo Antero M (Moma)
  Oslo, Norway







More information about the dbus mailing list