[Galago-devel] DBus Signal for Volume?

A. Walton awalton at gnome.org
Tue Dec 8 07:00:13 PST 2009


On Tue, Dec 8, 2009 at 7:42 AM, Arigead <captain.deadly at gmail.com> wrote:
> Hello all,
>    new to this list, and have joined as I have a quick question. I
> maybe in the wrong place for this question but if so please re-direct me
> and accept my apologies.
>
> I'm working on a project which is working on learning user input to a
> system and trying to pre-empt the user's inputs over time. I'm currently
> getting sources of User Input from various DBus Signals. I'd like to
> have a Signal which would inform me of "Volume" changes by the user.
>
> I've been using a Dbus-monitor app to have a quick look at what signals
> are sent when the user (me) changes the volume on my Ubuntu 9.10 system.
> On the System bus I've got nothing that looks too useful:
>
> signal sender=:1.2 -> dest=(null destination) serial=1488
> path=/org/freedesktop/Hal/devices/computer_logicaldev_input_4;
> interface=org.freedesktop.Hal.Device; member=Condition
>   string "ButtonPressed"
>   string "volume-up"
>
> That signal doesn't give me anything too useful as I can only see that
> the volume has gone up not what it's been set to. On the Session Bus
> I've got a much more useful looking method call:
>
> method call sender=:1.7 -> dest=org.freedesktop.Notifications serial=35
> path=/org/freedesktop/Notifications;
> interface=org.freedesktop.Notifications; member=Notify
>   string "gnome-settings-daemon"
>   uint32 0
>   string "notification-audio-volume-medium"
>   string " "
>   string ""
>   array [
>   ]
>   array [
>      dict entry(
>         string "value"
>         variant             int32 46
>      )
>      dict entry(
>         string "x-canonical-private-synchronous"
>         variant             string "volume"
>      )
>   ]
>   int32 -1
>
> Embedded in this method call is a value "int32 46". This looks more
> useful and I was considering looking at the code for this method call
> and in it adding a signal. So when the DBus method
> org.freedesktop.Notifications; member=Notify gets called part of it's
> processing fires off a signal with the int value for volume.
>
> I've no problem adding code to libnotify to perform this functionality
> on a local copy but I'm just wondering if this is the right piece of
> code to be hacking. It's just for a demo and not something I'd plan to
> release, unless it was deemed useful by somebody.
>
> Anyhow if anybody has the knowledge, and time to let me know if I'm in
> the correct place I'd be most grateful
>
> Thanks a million in advance and like I say please redirect, to a better
> place.

Libnotify has no way of telling when the system's volume has changed.
The way that Canonical's NotifyOSD works is completely proprietary to
them, enabled by patching code throughout the stack. The particular
code you're probably looking for is a patch to Ubuntu's copy of
gnome-settings-daemon to send notifications with Canonical's private
hints to NotifyOSD. Upstream G-S-D draws its own volume change
indication.

Start here: http://git.gnome.org/cgit/gnome-settings-daemon/tree/plugins/media-keys?id=c05c9b8c19f4c735ac1809f8bc61a3c13ea42c12

-A. Walton

> _______________________________________________
> galago-devel mailing list
> galago-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/galago-devel


More information about the galago-devel mailing list