Compare commits
2 Commits
84a9a89074
...
1fea2a2e11
Author | SHA1 | Date | |
---|---|---|---|
1fea2a2e11 | |||
2e44a27b2b |
@ -70,6 +70,7 @@ 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)
|
||||||
@ -174,26 +175,34 @@ public class DialAction : EncoderBase
|
|||||||
|
|
||||||
private async Task UpdateStateIfNeeded()
|
private async Task UpdateStateIfNeeded()
|
||||||
{
|
{
|
||||||
if (_currentAudioSession != null)
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
var uiState = new UIState(_currentAudioSession);
|
if (_currentAudioSession != null)
|
||||||
|
|
||||||
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);
|
var uiState = new UIState(_currentAudioSession);
|
||||||
_previousState = uiState;
|
|
||||||
|
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}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.0.1",
|
"Version": "1.1.0",
|
||||||
"CodePath": "FocusVolumeControl",
|
"CodePath": "FocusVolumeControl",
|
||||||
"Category": "Volume Control [dlprows]",
|
"Category": "Volume Control [dlprows]",
|
||||||
"Icon": "Images/pluginIcon",
|
"Icon": "Images/pluginIcon",
|
||||||
|
Loading…
Reference in New Issue
Block a user