Compare commits

..

No commits in common. "1fea2a2e1186d258193aeb309872e167b9f388b7" and "84a9a890746f52521543969b390f96a46955ac52" have entirely different histories.

2 changed files with 17 additions and 26 deletions

View File

@ -70,7 +70,6 @@ public class DialAction : EncoderBase
_thread.Start(); _thread.Start();
_currentAudioSession = settings.FallbackBehavior == FallbackBehavior.SystemSounds ? _audioHelper.GetSystemSounds() : _audioHelper.GetSystemVolume(); _currentAudioSession = settings.FallbackBehavior == FallbackBehavior.SystemSounds ? _audioHelper.GetSystemSounds() : _audioHelper.GetSystemVolume();
_ = UpdateStateIfNeeded();
} }
public override async void DialDown(DialPayload payload) public override async void DialDown(DialPayload payload)
@ -175,34 +174,26 @@ public class DialAction : EncoderBase
private async Task UpdateStateIfNeeded() private async Task UpdateStateIfNeeded()
{ {
try if (_currentAudioSession != null)
{ {
if (_currentAudioSession != null) 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;
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 ) await Connection.SetFeedbackAsync(uiState);
{ _previousState = uiState;
Logger.Instance.LogMessage(TracingLevel.ERROR, $"Failed to update screen\n {ex}");
} }
} }

View File

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