GNOME Bugzilla – Bug 650812
Play a sound/notification when rendering finishes
Last modified: 2012-11-09 18:42:13 UTC
When rendering finishes, we could play a nice "ding" sound from the sound theme using libcanberra. Perhaps we could also show some sort of notification that integrates with gnome-shell's libnotify features... For the sound, this depends on introspection support in libcanberra: https://bugs.freedesktop.org/show_bug.cgi?id=32587
Right now it doesn't seem libcanberra will support introspection soon. gnome-clocks bypassed this issue by using pycanberra. Would you accept a patch that uses pycanberra to achieve this? (I want to know before I start working on one)
Sure :) pycanberra didn't exist at all back then, if I recall correctly. I just hope that mixing pycanberra with the various other bits that are introspected (gtk, gst) doesn't cause a gobject conflict...
It seems to work in Clocks, so I guess it won't. I'll start working on a patch as soon as I find out how to get pitivi from git master to run on Fedora.
Created attachment 228425 [details] [review] [PATCH] Notify and play a sound when render is complete Patch attached. The only thing I'm unsure of with this patch is the commit message style. Do you have any style guidelines for pitivi commit messages?
Created attachment 228496 [details] [review] [PATCH] Notify and play a sound when render is complete (try 2) This version of the patch makes sure we can render even if libnotify or pycanberra are not installed.
This is awesome! A few remaining bugs/nitpicks I've found with your latest patch: - When render is complete, it does not make the rest of the UI sensitive again... perhaps you haven't dismissed the render dialog window properly? - "Render Complete" uses header capitalization... Feels weird compared to the other notifications I've seen, I think the norm for notifications is to use "sentence" capitalization style? - Notifications won't show up if the application is focused. Is there a way you could force them to be shown (because we don't have any other UI indication otherwise)? Actually, I do see the notification bar showing up for *split second*... maybe you're showing the notifications "too soon" (either before you're done doing UI changes such as closing windows... or maybe it just needs to sleep for a second). - If you do multiple renders, it will have a number of the notifications for the app in the gnome-shell message tray, however it won't show up in an efficient/elegant manner when you click the notification icon. It will look like this: /--------------------------------------------------------------\ | (icon) Render complete Pitivi has finished rendering FOO | | (icon) Render complete Pitivi has finished rendering BAR | | (icon) Render complete Pitivi has finished rendering BAZ | \--------------------------------------------------- ---------/ \/ Instead of something like: /--------------------------------------------------------------\ | (icon) Render complete | | | | Pitivi has finished rendering FOO | | Pitivi has finished rendering BAR | | Pitivi has finished rendering BAZ | \--------------------------------------------------- ---------/ \/ I'm not sure how to do that, but I suspect libnotify has a provision for it?
(In reply to comment #6) > This is awesome! > > A few remaining bugs/nitpicks I've found with your latest patch: > > - When render is complete, it does not make the rest of the UI sensitive > again... perhaps you haven't dismissed the render dialog window properly? Indeed. Maybe we shouldn't dismiss it at all... (remove the "Also, don't show the render options dialog again if the render wasn't cancelled." of the commit) > > - "Render Complete" uses header capitalization... Feels weird compared to the > other notifications I've seen, I think the norm for notifications is to use > "sentence" capitalization style? > Fixed locally > - Notifications won't show up if the application is focused. Is there a way you > could force them to be shown (because we don't have any other UI indication > otherwise)? Actually, I do see the notification bar showing up for *split > second*... maybe you're showing the notifications "too soon" (either before > you're done doing UI changes such as closing windows... or maybe it just needs > to sleep for a second). I tried multiple combinations of things, I have no idea why the notification disappears. I'm starting to think it's a bug in the shell, because even when I defined the notification as "resident" (which means it shouldn't disappear without the user explicitly removing it) it is still removed. I'll have to dig into it. > > - If you do multiple renders, it will have a number of the notifications for > the app in the gnome-shell message tray, however it won't show up in an > efficient/elegant manner when you click the notification icon > ... > I'm not sure how to do that, but I suspect libnotify has a provision for it? Fixed locally (that's just a matter of adding \n)
Created attachment 228582 [details] [review] [PATCH] Notify and play a sound when render is complete (try 3) This fixes all problems you mentioned. I hope it's good enough.
Created attachment 228584 [details] [review] [PATCH] Notify and play a sound when render is complete (try 4) now without global.
Created attachment 228595 [details] [review] [PATCH] Notify and play a sound when render is complete (try 5)
Pushed to master (with some minor fixes) as: commit bcf90cf446734e00e70b6c799d35dfc871f21b68 Author: Elad Alfassa <elad@fedoraproject.org> Date: Fri Nov 9 13:36:30 2012 -0500 Notify and play a sound when rendering is complete Also reuse the render progress dialog at the end of rendering to allow the user to open the rendered movie in their default movie player. Fixes bug #650812 Adds (soft) dependencies: libnotify with introspection support, pycanberra Thanks for your contribution!