Skip to content

Commit

Permalink
messageTray: Port to MetaSoundPlayer for emitting sounds
Browse files Browse the repository at this point in the history
Move away from ShellGlobal API, which is too tightly coupled to
libcanberra-gtk. The app ID/name seem unused in canberra, so we
may simplify this to a single case.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/327
  • Loading branch information
garnacho authored and fmuellner committed Jan 9, 2019
1 parent 9a35c99 commit 25bfe99
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions js/ui/messageTray.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,27 +448,11 @@ var Notification = new Lang.Class({
return;
}

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);
}
} 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);
}
}
let player = global.display.get_sound_player();
if (this._soundName)
player.play_from_theme(this._soundName, this.title, null);
else if (this._soundFile)
player.play_from_file(this._soundFile, this.title, null);
},

// Allow customizing the banner UI:
Expand Down

0 comments on commit 25bfe99

Please sign in to comment.