diff --git a/sound150@claudiux/files/sound150@claudiux/5.4/applet.js b/sound150@claudiux/files/sound150@claudiux/5.4/applet.js index e1e510caf79..d864f22ac7b 100644 --- a/sound150@claudiux/files/sound150@claudiux/5.4/applet.js +++ b/sound150@claudiux/files/sound150@claudiux/5.4/applet.js @@ -338,7 +338,7 @@ class VolumeSlider extends PopupMenu.PopupSliderMenuItem { let icon = Gio.Icon.new_for_string(this._volumeToIcon(this._value)); if (this.applet.showOSD) { - Main.osdWindowManager.show(-1, icon, Math.round(volume/this.applet._volumeNorm * 100), null); + Main.osdWindowManager.show(-1, icon, ""+Math.round(volume/this.applet._volumeNorm * 100), null); } @@ -1806,6 +1806,7 @@ class Sound150Applet extends Applet.TextIconApplet { this.settings.bind("tooltipShowArtistTitle", "tooltipShowArtistTitle", this.on_settings_changed); this.settings.bind("alwaysCanChangeMic", "alwaysCanChangeMic", this.on_settings_changed); + this.settings.bind("avoidCrackingAtShutdown", "avoidCrackingAtShutdown", null); this._sounds_settings = new Gio.Settings({ schema_id: CINNAMON_DESKTOP_SOUNDS }); this.settings.setValue("volumeSoundFile", this._sounds_settings.get_string(VOLUME_SOUND_FILE_KEY)); @@ -2206,6 +2207,11 @@ class Sound150Applet extends Applet.TextIconApplet { } on_applet_removed_from_panel() { + if (this.avoidCrackingAtShutdown && this._output && !this._output.is_muted) { + let old_volume = this.volume; + this._toggle_out_mute(); + this.volume = old_volume; + } Main.keybindingManager.removeHotKey("sound-open-" + this.instance_id); Main.keybindingManager.removeHotKey("switch-player-" + this.instance_id); try { @@ -2414,8 +2420,8 @@ class Sound150Applet extends Applet.TextIconApplet { this.set_applet_icon_symbolic_name(icon_name); if (this.showOSD) { //~ Main.osdWindowManager.hideAll(); - Main.osdWindowManager.show(-1, icon, volume, null); - //Main.osdWindowManager.show(0, icon, volume, true); + Main.osdWindowManager.show(-1, icon, ""+volume, null); + //Main.osdWindowManager.show(0, icon, ""+volume, true); } var intervalId = null; intervalId = Util.setInterval(() => { diff --git a/sound150@claudiux/files/sound150@claudiux/5.4/settings-schema.json b/sound150@claudiux/files/sound150@claudiux/5.4/settings-schema.json index ed86cd2199e..86b590df88b 100644 --- a/sound150@claudiux/files/sound150@claudiux/5.4/settings-schema.json +++ b/sound150@claudiux/files/sound150@claudiux/5.4/settings-schema.json @@ -99,7 +99,8 @@ "stepVolume", "magneticOn", "magnetic25On", - "alwaysCanChangeMic" + "alwaysCanChangeMic", + "avoidCrackingAtShutdown" ] }, "sectionSound2": { @@ -361,6 +362,11 @@ "tooltip": "Always show the 'Mute input' switch in the context menu.", "default": true }, + "avoidCrackingAtShutdown": { + "type": "switch", + "description": "Try to avoid loud cracking sound at shutdown", + "default": true + }, "showMediaKeysOSD": { "type": "combobox", "default": "medium", diff --git a/sound150@claudiux/files/sound150@claudiux/6.4/applet.js b/sound150@claudiux/files/sound150@claudiux/6.4/applet.js index 6aaf282a330..6ff098db7e4 100644 --- a/sound150@claudiux/files/sound150@claudiux/6.4/applet.js +++ b/sound150@claudiux/files/sound150@claudiux/6.4/applet.js @@ -1808,6 +1808,7 @@ class Sound150Applet extends Applet.TextIconApplet { this.settings.bind("tooltipShowArtistTitle", "tooltipShowArtistTitle", this.on_settings_changed); this.settings.bind("alwaysCanChangeMic", "alwaysCanChangeMic", this.on_settings_changed); + this.settings.bind("avoidCrackingAtShutdown", "avoidCrackingAtShutdown", null); this._sounds_settings = new Gio.Settings({ schema_id: CINNAMON_DESKTOP_SOUNDS }); this.settings.setValue("volumeSoundFile", this._sounds_settings.get_string(VOLUME_SOUND_FILE_KEY)); @@ -2230,6 +2231,11 @@ class Sound150Applet extends Applet.TextIconApplet { } on_applet_removed_from_panel() { + if (this.avoidCrackingAtShutdown && this._output && !this._output.is_muted) { + let old_volume = this.volume; + this._toggle_out_mute(); + this.volume = old_volume; + } Main.keybindingManager.removeHotKey("sound-open-" + this.instance_id); Main.keybindingManager.removeHotKey("switch-player-" + this.instance_id); try { diff --git a/sound150@claudiux/files/sound150@claudiux/6.4/settings-schema.json b/sound150@claudiux/files/sound150@claudiux/6.4/settings-schema.json index 43dad45df5f..a1bd94853b8 100644 --- a/sound150@claudiux/files/sound150@claudiux/6.4/settings-schema.json +++ b/sound150@claudiux/files/sound150@claudiux/6.4/settings-schema.json @@ -101,7 +101,8 @@ "stepVolume", "magneticOn", "magnetic25On", - "alwaysCanChangeMic" + "alwaysCanChangeMic", + "avoidCrackingAtShutdown" ] }, "sectionSound2": { @@ -377,6 +378,11 @@ "tooltip": "Always show the 'Mute input' switch in the context menu.", "default": true }, + "avoidCrackingAtShutdown": { + "type": "switch", + "description": "Try to avoid loud cracking sound at shutdown", + "default": true + }, "showMediaKeysOSD": { "type": "combobox", "default": "medium", diff --git a/sound150@claudiux/files/sound150@claudiux/CHANGELOG.md b/sound150@claudiux/files/sound150@claudiux/CHANGELOG.md index 3b660052e46..6e31517b9b9 100644 --- a/sound150@claudiux/files/sound150@claudiux/CHANGELOG.md +++ b/sound150@claudiux/files/sound150@claudiux/CHANGELOG.md @@ -1,3 +1,7 @@ +### v7.1.0~20241013 + * Option to try to avoid loud cracking sound at shutdown. + * Fixes https://github.com/linuxmint/cinnamon/issues/12446. + ### v7.0.0~20241011 * Compatible with Cinnamon 6.4. diff --git a/sound150@claudiux/files/sound150@claudiux/metadata.json b/sound150@claudiux/files/sound150@claudiux/metadata.json index 9ec0e46e5e1..ebecbcc0a8f 100644 --- a/sound150@claudiux/files/sound150@claudiux/metadata.json +++ b/sound150@claudiux/files/sound150@claudiux/metadata.json @@ -5,7 +5,7 @@ "max-instances": "1", "description": "Enhanced sound applet", "hide-configuration": false, - "version": "7.0.0", + "version": "7.1.0", "cinnamon-version": [ "2.8", "3.0",