Skip to content

Commit e1c8e1a

Browse files
committed
don't hide smtc when external control disabled
1 parent 905018a commit e1c8e1a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

LLin.OSIntegrations/Windows/WindowsMediaIntegration.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ public bool Shuffle
108108

109109
public bool AllowExternalControl
110110
{
111-
set => smtc.IsEnabled = value;
111+
// set => smtc.IsEnabled = value;
112+
get; set;
112113
}
113114

114115
//endregion Controls
@@ -148,7 +149,8 @@ private void smtcPlaybackRateChangeRequested(SystemMediaTransportControls sender
148149
private void smtcPlaybackPositionChangeRequested(SystemMediaTransportControls sender,
149150
PlaybackPositionChangeRequestedEventArgs args)
150151
{
151-
SetPosition?.Invoke(args.RequestedPlaybackPosition.Milliseconds);
152+
if (AllowExternalControl)
153+
SetPosition?.Invoke(args.RequestedPlaybackPosition.Milliseconds);
152154
}
153155

154156
private void smtcPropertyChanged(SystemMediaTransportControls sender,
@@ -160,6 +162,8 @@ private void smtcPropertyChanged(SystemMediaTransportControls sender,
160162
private void smtcButtonPressed(SystemMediaTransportControls sender,
161163
SystemMediaTransportControlsButtonPressedEventArgs args)
162164
{
165+
if (!AllowExternalControl)
166+
return;
163167
switch (args.Button)
164168
{
165169
case SystemMediaTransportControlsButton.Play:

0 commit comments

Comments
 (0)