Merge lp://staging/~dylanmccall/notify-osd/sounds-support into lp://staging/notify-osd/lucid

Proposed by Dylan McCall
Status: Needs review
Proposed branch: lp://staging/~dylanmccall/notify-osd/sounds-support
Merge into: lp://staging/notify-osd/lucid
Diff against target: 453 lines (+293/-3)
6 files modified
configure.in (+1/-1)
src/bubble.c (+90/-0)
src/bubble.h (+15/-0)
src/notification.c (+134/-0)
src/notification.h (+21/-0)
src/stack.c (+32/-2)
To merge this branch: bzr merge lp://staging/~dylanmccall/notify-osd/sounds-support
Reviewer Review Type Date Requested Status
Mirco Müller (community) Needs Fixing
Review via email: mp+42788@code.staging.launchpad.net

Description of the change

This branch adds sounds support, as specified at https://wiki.ubuntu.com/NotifyOSD#Sound and http://people.canonical.com/~agateau/notifications-1.1/spec/ar01s08.html

The feature can be tested with notify-send:
notify-send --hint=string:sound-name:phone-incoming-call "Yay" "sound-name hint"
notify-send --hint=string:sound-file:/usr/share/sounds/gnome/default/alerts/sonar.ogg "Yay" "sound-file hint"

Note that a bubble's sound plays when it appears, and libcanberra-gtk (+PulseAudio) position the sound so it seems to come from the notification bubble.

To post a comment you must log in.
431. By Dylan McCall

Remove type check for suppress-sound hint. If the hint is there, immediately set suppress_sound to TRUE.

Revision history for this message
Dylan McCall (dylanmccall) wrote :

To test suppress-sound, you'll need a sufficiently long sound (but the file can't be too big or Canberra will refuse to play it). Try something like this:

notify-send --hint=string:sound-file:/home/dylan/Desktop/Freedom.ogg --hint=string:suppress-sound: "Testing" "suppress-sound hint"

Run that twice, giving it your own sound-file. The specification on this one wasn't completely clear to me, but my implementation will stop any other notification sounds generated by notify-osd.

I noticed that pynotify doesn't deal in Boolean hints (which the specification wants), and I couldn't find any other hints that were boolean either. So, in revision 431 I made this not look at the type of the hint. If the hint is there, it's assumed that suppress_sound should be True.

Revision history for this message
Mirco Müller (macslow) wrote :

This patch causes notification bubbles not to show up at all (but attached sound-files are played). I'm not sure what's causing the bubble not to appear. I've used these to commands to test this on current natty:

notify-send "Incoming call" "Yo dude, answer the damn phone" -i ubuntu-logo --hint=string:sound-file:/usr/share/sounds/ubuntu/stereo/phone-incoming-call.ogg

notify-send "Line busy" "Please call again later" -i gnome-foot --hint=string:sound-file:/usr/share/sounds/ubuntu/stereo/phone-outgoing-busy.ogg

I see and hear the first bubble, but the second bubble does not get displayed. I only hear the sound file played of the second one.

review: Needs Fixing
Revision history for this message
Dylan McCall (dylanmccall) wrote :

Interesting… I tried to reproduce that problem but I haven't seen it yet :o
I tried under both Maverick and Natty (under a VM) with this branch. (I had to rebase it to the current lp:notify-osd to get it to build under Natty).

Was this consistently happening on your end, or should I be looking for more of a chance occurrence?

Revision history for this message
Andrew Somerville (andy-somerville) wrote :

Seems like this died several years ago. Any replacement?

Unmerged revisions

431. By Dylan McCall

Remove type check for suppress-sound hint. If the hint is there, immediately set suppress_sound to TRUE.

430. By Dylan McCall

Renamed sound-id to sound-name, matching specification at http://people.canonical.com/~agateau/notifications-1.1/spec/ar01s08.html

Set ID for sound-file, sounds, too, so suppress-sound works reliably.

429. By Dylan McCall

Implement suppress-sound hint. Haven't been able to test this, but it _should_ work, I think...

428. By Dylan McCall

Initial support for sounds in notify-osd.

This adds a dependency on libcanberra-gtk, which carries out the actual playing of event sounds.
This uses the sound-file hint described in the Desktop Notification Specification.
In addition, there is a non-standard x-sound-id hint.

Implementation so far plays sounds, but does not fully comply with the specification. Still need to implement suppress-sounds :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches