volume: Port to MetaSoundPlayer for emitting sounds
Move away from ShellGlobal API, which is too tightly coupled to libcanberra-gtk. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/327
This commit is contained in:
parent
25bfe99ed5
commit
a6002652d0
@ -57,6 +57,7 @@ var StreamSlider = new Lang.Class({
|
|||||||
});
|
});
|
||||||
|
|
||||||
this._stream = null;
|
this._stream = null;
|
||||||
|
this._volumeCancellable = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
get stream() {
|
get stream() {
|
||||||
@ -129,11 +130,14 @@ var StreamSlider = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_notifyVolumeChange() {
|
_notifyVolumeChange() {
|
||||||
global.cancel_theme_sound(VOLUME_NOTIFY_ID);
|
if (this._volumeCancellable)
|
||||||
global.play_theme_sound(VOLUME_NOTIFY_ID,
|
this._volumeCancellable.cancel();
|
||||||
'audio-volume-change',
|
|
||||||
_("Volume changed"),
|
this._volumeCancellable = new Gio.Cancellable();
|
||||||
Clutter.get_current_event ());
|
let player = global.display.get_sound_player();
|
||||||
|
player.play_from_theme('audio-volume-change',
|
||||||
|
_("Volume changed"),
|
||||||
|
this._volumeCancellable);
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateVolume() {
|
_updateVolume() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user