~ubuntu-branches/debian/jessie/gnome-shell/jessie

« back to all changes in this revision

Viewing changes to js/ui/status/volume.js

  • Committer: Package Import Robot
  • Author(s): Michael Biebl
  • Date: 2012-05-30 13:19:38 UTC
  • mfrom: (18.1.24 experimental)
  • Revision ID: package-import@ubuntu.com-20120530131938-i3trc1g1p3is2u6x
Tags: 3.4.1-3
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
2
2
 
3
3
const Clutter = imports.gi.Clutter;
4
 
const DBus = imports.dbus;
5
4
const Lang = imports.lang;
6
5
const Mainloop = imports.mainloop;
7
6
const Shell = imports.gi.Shell;
18
17
 
19
18
const VOLUME_NOTIFY_ID = 1;
20
19
 
21
 
function Indicator() {
22
 
    this._init.apply(this, arguments);
23
 
}
24
 
 
25
 
Indicator.prototype = {
26
 
    __proto__: PanelMenu.SystemStatusButton.prototype,
 
20
const Indicator = new Lang.Class({
 
21
    Name: 'VolumeIndicator',
 
22
    Extends: PanelMenu.SystemStatusButton,
27
23
 
28
24
    _init: function() {
29
 
        PanelMenu.SystemStatusButton.prototype._init.call(this, 'audio-volume-muted', null);
 
25
        this.parent('audio-volume-muted', _("Volume"));
30
26
 
31
27
        this._control = new Gvc.MixerControl({ name: 'GNOME Shell Volume Control' });
32
28
        this._control.connect('state-changed', Lang.bind(this, this._onControlStateChanged));
39
35
        this._output = null;
40
36
        this._outputVolumeId = 0;
41
37
        this._outputMutedId = 0;
 
38
        /* Translators: This is the label for audio volume */
42
39
        this._outputTitle = new PopupMenu.PopupMenuItem(_("Volume"), { reactive: false });
43
40
        this._outputSlider = new PopupMenu.PopupSliderMenuItem(0);
44
41
        this._outputSlider.connect('value-changed', Lang.bind(this, this._sliderChanged, '_output'));
215
212
        if (property == '_output' && !this._output.is_muted)
216
213
            this.setIcon(this._volumeToIcon(this._output.volume));
217
214
    }
218
 
};
 
215
});