forked from Mirror/Ryujinx
Ava UI: Fix temporary volume not being set after unmute (#5833)
This commit is contained in:
parent
1df6c07f78
commit
ad8d5b9b56
3 changed files with 16 additions and 2 deletions
|
@ -1088,10 +1088,11 @@ namespace Ryujinx.Ava
|
||||||
case KeyboardHotkeyState.ToggleMute:
|
case KeyboardHotkeyState.ToggleMute:
|
||||||
if (Device.IsAudioMuted())
|
if (Device.IsAudioMuted())
|
||||||
{
|
{
|
||||||
Device.SetVolume(ConfigurationState.Instance.System.AudioVolume);
|
Device.SetVolume(_viewModel.VolumeBeforeMute);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
_viewModel.VolumeBeforeMute = Device.GetVolume();
|
||||||
Device.SetVolume(0);
|
Device.SetVolume(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
private string _pauseKey = "F5";
|
private string _pauseKey = "F5";
|
||||||
private string _screenshotKey = "F8";
|
private string _screenshotKey = "F8";
|
||||||
private float _volume;
|
private float _volume;
|
||||||
|
private float _volumeBeforeMute;
|
||||||
private string _backendText;
|
private string _backendText;
|
||||||
|
|
||||||
private bool _canUpdate = true;
|
private bool _canUpdate = true;
|
||||||
|
@ -554,6 +555,17 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float VolumeBeforeMute
|
||||||
|
{
|
||||||
|
get => _volumeBeforeMute;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_volumeBeforeMute = value;
|
||||||
|
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool ShowStatusSeparator
|
public bool ShowStatusSeparator
|
||||||
{
|
{
|
||||||
get => _showStatusSeparator;
|
get => _showStatusSeparator;
|
||||||
|
|
|
@ -436,10 +436,11 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
{
|
{
|
||||||
if (!volumeSplitButton.IsChecked)
|
if (!volumeSplitButton.IsChecked)
|
||||||
{
|
{
|
||||||
ViewModel.AppHost.Device.SetVolume(ConfigurationState.Instance.System.AudioVolume);
|
ViewModel.AppHost.Device.SetVolume(ViewModel.VolumeBeforeMute);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
ViewModel.VolumeBeforeMute = ViewModel.AppHost.Device.GetVolume();
|
||||||
ViewModel.AppHost.Device.SetVolume(0);
|
ViewModel.AppHost.Device.SetVolume(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue