Permalink
Browse files

Added sound devices

  • Loading branch information...
1 parent 5c2b928 commit 3312935100452eb0f30d505f943665e67b7a293b @clefebvre clefebvre committed Dec 14, 2011
Showing with 14 additions and 1 deletion.
  1. +14 −1 js/ui/status/volume.js
View
@@ -800,9 +800,12 @@ Indicator.prototype = {
this._inputSlider.connect('drag-end', Lang.bind(this, this._notifyVolumeChange));
this.menu.addMenuItem(this._inputTitle);
this.menu.addMenuItem(this._inputSlider);
- this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
+ this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this.menu.addSettingsAction(_("Sound Settings"), 'gnome-sound-panel.desktop');
+ this._selectDeviceItem = new PopupMenu.PopupSubMenuMenuItem(_("Output device..."));
+ this.menu.addMenuItem(this._selectDeviceItem);
+
if (this._showInput){
this._inputTitle.actor.show();
this._inputSlider.actor.show();
@@ -906,6 +909,16 @@ Indicator.prototype = {
this._outputSlider.setValue(0);
this.setIconName('audio-volume-muted-symbolic');
}
+ let sinks = this._control.get_sinks();
+ this._selectDeviceItem.menu.removeAll();
+ for (let i = 0; i < sinks.length; i++) {
+ let description = sinks[i].get_description();
+ if (sinks[i].get_id() == this._output.get_id()) {
+ description = "* " + sinks[i].get_description();
+ }
+ let menuItem = new PopupMenu.PopupMenuItem(description);
+ this._selectDeviceItem.menu.addMenuItem(menuItem);
+ }
},
_readInput: function() {

0 comments on commit 3312935

Please sign in to comment.