Skip to content

Commit

Permalink
Merge pull request #276 from MediaPortal/MP1-5199-Fix_volume_OSD_pres…
Browse files Browse the repository at this point in the history
…entation_on_the_screen

MP1-5199: Fix volume OSD presentation on the screen
  • Loading branch information
andrewjswan committed Feb 23, 2024
2 parents 3c65b50 + 135ace2 commit 74d95a0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mediaportal/Configuration/Sections/GeneralVolume.cs
Expand Up @@ -78,8 +78,8 @@ public override void LoadSettings()
{
string isSettingExist = reader.GetValueAsString("volume", "handler", "");
int volumeStyle = reader.GetValueAsInt("volume", "handler", 1);
bool isDigital = reader.GetValueAsBool("volume", "digital", true);
mpCBHideWinOSD.Checked = reader.GetValueAsBool("volume", "hideWindowsOSD", false);
bool isDigital = reader.GetValueAsBool("volume", "digital", false);
mpCBHideWinOSD.Checked = reader.GetValueAsBool("volume", "hideWindowsOSD", true);

_useClassicHandler.Checked = volumeStyle == 0;
_useWindowsHandler.Checked = volumeStyle == 1;
Expand Down
13 changes: 11 additions & 2 deletions mediaportal/Core/Player/VolumeHandler.cs
Expand Up @@ -109,7 +109,9 @@ public VolumeHandler(int[] volumeTable)

_showVolumeOSD = true;

VolumeOSD = new HideVolumeOSD.HideVolumeOSDLib(IsMuted);
if (VolumeOSD == null)
VolumeOSD = new HideVolumeOSD.HideVolumeOSDLib(IsMuted);

VolumeOSD.HideOSD();

_showVolumeOSD = tempShowVolumeOSD;
Expand Down Expand Up @@ -174,7 +176,9 @@ public VolumeHandler(int[] volumeTable)

_showVolumeOSD = true;

VolumeOSD = new HideVolumeOSD.HideVolumeOSDLib(IsMuted);
if (VolumeOSD == null)
VolumeOSD = new HideVolumeOSD.HideVolumeOSDLib(IsMuted);

VolumeOSD.HideOSD();

_showVolumeOSD = tempShowVolumeOSD;
Expand Down Expand Up @@ -368,6 +372,11 @@ public static void Dispose()
_instance._mixer.SafeDispose();
_instance._mixer = null;
}

//Restore native Windows Volume OSD
if (VolumeOSD != null)
VolumeOSD.ShowOSD();

_instance = null;
GUIGraphicsContext.VolumeHandler = null;
}
Expand Down

0 comments on commit 74d95a0

Please sign in to comment.