diff --git a/Handlers/HotkeyHandler.cs b/Handlers/HotkeyHandler.cs
index fcf1e1c..c0680a2 100644
--- a/Handlers/HotkeyHandler.cs
+++ b/Handlers/HotkeyHandler.cs
@@ -28,6 +28,7 @@ namespace unison
private const uint VK_MEDIA_PLAY_PAUSE = 0xB3;
private const uint VK_VOLUME_UP = 0xAF;
private const uint VK_VOLUME_DOWN = 0xAE;
+ private const uint VK_VOLUME_MUTE = 0xAD;
private const uint VK_ENTER = 0x0D;
private MainWindow _appWindow;
@@ -54,6 +55,7 @@ namespace unison
RegisterHotKey(_windowHandle, HOTKEY_ID, MOD_CONTROL, VK_MEDIA_PLAY_PAUSE);
RegisterHotKey(_windowHandle, HOTKEY_ID, MOD_CONTROL, VK_VOLUME_UP);
RegisterHotKey(_windowHandle, HOTKEY_ID, MOD_CONTROL, VK_VOLUME_DOWN);
+ RegisterHotKey(_windowHandle, HOTKEY_ID, MOD_CONTROL, VK_VOLUME_MUTE);
RegisterHotKey(_windowHandle, HOTKEY_ID, MOD_CONTROL | MOD_ALT, VK_ENTER);
}
}
@@ -79,6 +81,9 @@ namespace unison
case VK_VOLUME_UP:
_mpd.VolumeUp();
break;
+ case VK_VOLUME_MUTE:
+ _mpd.VolumeMute();
+ break;
case VK_MEDIA_PLAY_PAUSE:
_mpd.PlayPause();
break;
diff --git a/Handlers/MPDHandler.cs b/Handlers/MPDHandler.cs
index 367ab87..676cf81 100644
--- a/Handlers/MPDHandler.cs
+++ b/Handlers/MPDHandler.cs
@@ -25,6 +25,7 @@ namespace unison
private bool _connected;
public string _version;
private int _currentVolume;
+ private int _previousVolume;
private bool _currentRandom;
private bool _currentRepeat;
private bool _currentSingle;
@@ -449,6 +450,21 @@ namespace unison
SetVolume(_currentVolume);
}
+ public void VolumeMute()
+ {
+ if (_currentVolume == 0)
+ {
+ _currentVolume = _previousVolume;
+ _previousVolume = 0;
+ }
+ else
+ {
+ _previousVolume = _currentVolume;
+ _currentVolume = 0;
+ }
+ SetVolume(_currentVolume);
+ }
+
public void ClearQueue() => SendCommand(new ClearCommand());
public void PlayCommand() => SendCommand(new PlayCommand(0));
diff --git a/Resources/Resources.Designer.cs b/Resources/Resources.Designer.cs
index 68d218a..d6a0eac 100644
--- a/Resources/Resources.Designer.cs
+++ b/Resources/Resources.Designer.cs
@@ -420,6 +420,15 @@ namespace unison.Resources {
}
}
+ ///
+ /// Looks up a localized string similar to Volume mute.
+ ///
+ public static string Settings_VolumeMute {
+ get {
+ return ResourceManager.GetString("Settings_VolumeMute", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Volume offset.
///
diff --git a/Resources/Resources.fr-FR.resx b/Resources/Resources.fr-FR.resx
index 69c75f9..b967c6d 100644
--- a/Resources/Resources.fr-FR.resx
+++ b/Resources/Resources.fr-FR.resx
@@ -237,6 +237,9 @@
Baisse de volume
+
+ Volume en sourdine
+
Écart de volume
diff --git a/Resources/Resources.resx b/Resources/Resources.resx
index 43a6175..fa872bb 100644
--- a/Resources/Resources.resx
+++ b/Resources/Resources.resx
@@ -237,6 +237,9 @@
Volume down
+
+ Volume mute
+
Volume offset
diff --git a/Views/Settings.xaml b/Views/Settings.xaml
index 183c05e..d688dce 100644
--- a/Views/Settings.xaml
+++ b/Views/Settings.xaml
@@ -107,20 +107,23 @@
+
-
+
+
-
+
+