Compare commits

..

2 Commits

Author SHA1 Message Date
1fea2a2e11 Made the display update sooner when launching steam deck software 2023-09-10 22:16:16 -06:00
2e44a27b2b Update manifest 2023-09-10 22:10:00 -06:00
2 changed files with 26 additions and 17 deletions

View File

@ -70,6 +70,7 @@ public class DialAction : EncoderBase
_thread.Start();
_currentAudioSession = settings.FallbackBehavior == FallbackBehavior.SystemSounds ? _audioHelper.GetSystemSounds() : _audioHelper.GetSystemVolume();
_ = UpdateStateIfNeeded();
}
public override async void DialDown(DialPayload payload)
@ -174,26 +175,34 @@ public class DialAction : EncoderBase
private async Task UpdateStateIfNeeded()
{
if (_currentAudioSession != null)
try
{
var uiState = new UIState(_currentAudioSession);
if (_previousState != null && uiState != null &&
uiState.Title == _previousState.Title &&
uiState.Value.Value == _previousState.Value.Value &&
uiState.Value.Opacity == _previousState.Value.Opacity &&
uiState.Indicator.Value == _previousState.Indicator.Value &&
uiState.Indicator.Opacity == _previousState.Indicator.Opacity &&
uiState.icon.Value == _previousState.icon.Value &&
uiState.icon.Opacity == _previousState.icon.Opacity
)
if (_currentAudioSession != null)
{
return;
}
await Connection.SetFeedbackAsync(uiState);
_previousState = uiState;
var uiState = new UIState(_currentAudioSession);
if (_previousState != null && uiState != null &&
uiState.Title == _previousState.Title &&
uiState.Value.Value == _previousState.Value.Value &&
uiState.Value.Opacity == _previousState.Value.Opacity &&
uiState.Indicator.Value == _previousState.Indicator.Value &&
uiState.Indicator.Opacity == _previousState.Indicator.Opacity &&
uiState.icon.Value == _previousState.icon.Value &&
uiState.icon.Opacity == _previousState.icon.Opacity
)
{
return;
}
await Connection.SetFeedbackAsync(uiState);
_previousState = uiState;
}
}
catch (Exception ex )
{
Logger.Instance.LogMessage(TracingLevel.ERROR, $"Failed to update screen\n {ex}");
}
}

View File

@ -33,7 +33,7 @@
"Name": "Focused Application Volume",
"Description": "Control the volume of the focused application",
"URL": "https://github.com/dlprows/FocusVolumeControl",
"Version": "1.0.1",
"Version": "1.1.0",
"CodePath": "FocusVolumeControl",
"Category": "Volume Control [dlprows]",
"Icon": "Images/pluginIcon",