[gnome-shell/wip/carlosg/sound-abstraction: 7/10] messageTray: Port to MetaSoundPlayer for emitting sounds



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

    messageTray: Port to MetaSoundPlayer 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..13315b6ac 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -448,26 +448,11 @@ var Notification = new Lang.Class({
             return;
         }
 
+        let player = global.display.get_sound_player();
         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);
-            }
+            player.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);
-            }
+            player.play_from_file(this._soundFile, this.title, null);
         }
     },
 


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