[gnome-shell/wip/carlosg/sound-abstraction: 2/4] messageTray: Port to MetaSound for emitting sounds



commit 85f6db0a53407701409764b610c929765a0d70c5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Dec 13 20:32:16 2018 +0100

    messageTray: Port to MetaSound for emitting sounds
    
    Move away from ShellGlobal API, which is too tightly coupled to
    libcanberra-gtk.

 js/ui/messageTray.js | 21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index eebc93fdf..ff8d8e389 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -448,26 +448,11 @@ var Notification = new Lang.Class({
             return;
         }
 
+        let sound = global.display.get_sound();
         if (this._soundName) {
-            if (this.source.app) {
-                let app = this.source.app;
-
-                global.play_theme_sound_full(0, this._soundName,
-                                             this.title, null,
-                                             app.get_id(), app.get_name());
-            } else {
-                global.play_theme_sound(0, this._soundName, this.title, null);
-            }
+            sound.play_from_theme(this._soundName, this.title, null);
         } else if (this._soundFile) {
-            if (this.source.app) {
-                let app = this.source.app;
-
-                global.play_sound_file_full(0, this._soundFile,
-                                            this.title, null,
-                                            app.get_id(), app.get_name());
-            } else {
-                global.play_sound_file(0, this._soundFile, this.title, null);
-            }
+            sound.play_from_file(this._soundFile, this.title, null);
         }
     },
 


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