4 // Advanced Volume Mixer
5 // Control programs' volume from gnome volume mixer applet.
7 // Author: Harry Karvonen <harry.karvonen@gmail.com>
10 const Main = imports.ui.main;
11 const Lang = imports.lang;
13 const AVM = imports.misc.extensionUtils.getCurrentExtension();
14 const Settings = AVM.imports.settings;
15 const Panel = AVM.imports.panel;
16 const Mixer = AVM.imports.mixer;
28 Settings.gsettings.connect("changed::", function() {
36 advMixer = new Mixer.AdvancedVolumeMixer();
38 orgIndicator = Main.panel.statusArea.aggregateMenu._volume;
39 orgIndicator._volumeMenu.actor.hide();
41 let pos = Settings.gsettings.get_enum("position");
44 orgIndicator._primaryIndicator.hide();
45 menu = new Panel.AdvancedVolumeMixerStatusButton(advMixer);
48 Main.panel.addToStatusArea("AdvancedVolumeMixer", menu, 999, 'left');
49 } else if (pos == 1) {
50 Main.panel.addToStatusArea("AdvancedVolumeMixer", menu, 999, 'center');
52 Main.panel.addToStatusArea("AdvancedVolumeMixer", menu);
55 advMixer.separatorLastItem(true);
57 orgIndicator.menu.addMenuItem(advMixer);
65 orgIndicator._volumeMenu.actor.show();
66 orgIndicator._primaryIndicator.show();