93
93
this.mic_volume_shown = true;
95
95
else if (!value && this.mic_volume_shown) {
96
this.volume_section.remove (this.volume_section.get_n_items () -1);
97
while ((location = find_action(this.volume_section, "indicator.mic-volume")) != -1) {
98
this.volume_section.remove (location);
97
100
this.mic_volume_shown = false;
105
public bool show_high_volume_warning {
107
return this.high_volume_warning_shown;
110
if (value && !this.high_volume_warning_shown) {
111
/* NOTE: Action doesn't really exist, just used to find below when removing */
112
var item = new MenuItem(_("High volume can damage your hearing."), "indicator.high-volume-warning-item");
113
volume_section.append_item (item);
114
this.high_volume_warning_shown = true;
116
else if (!value && this.high_volume_warning_shown) {
118
while ((location = find_action(this.volume_section, "indicator.high-volume-warning-item")) != -1) {
119
this.volume_section.remove (location);
121
this.high_volume_warning_shown = false;
126
int find_action (Menu menu, string in_action) {
127
int n = menu.get_n_items ();
128
for (int i = 0; i < n; i++) {
130
menu.get_item_attribute (i, "action", "s", out action);
131
if (in_action == action)
102
139
public void add_player (MediaPlayer player) {
103
140
if (this.notify_handlers.contains (player))
141
178
Menu volume_section;
142
179
bool mic_volume_shown;
143
180
bool settings_shown = false;
181
bool high_volume_warning_shown = false;
144
182
bool hide_inactive;
145
183
bool hide_players = false;
146
184
HashTable<MediaPlayer, ulong> notify_handlers;