Skip to content

Commit

Permalink
SettingsView now sets the AudioManager.MasterSongVolume
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed Jan 28, 2024
1 parent a7fe26a commit 5c34e35
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Engines/FlatRedBallXNA/FlatRedBall/Audio/AudioManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public static float MasterSoundVolume
} = 1.0f;

static float? masterSongVolume = null;

/// <summary>
/// The default volume for playing songs, applied when calling Play(Song). Ranges between 0 and 1.
/// </summary>
public static float? MasterSongVolume
{
get => masterSongVolume;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ private void HandleMusicValueChanged(object sender, EventArgs e)
if(IsAutoApplyingChangesToEngine)
{
#if !__IOS__

MediaPlayer.Volume = (float)MusicVolumePercentage / 100;
// MediaPlayer.Volume is handled by AudioManager.MasterSongVolume
//MediaPlayer.Volume = (float)MusicVolumePercentage / 100;
AudioManager.MasterSongVolume = (float)MusicVolumePercentage / 100;
#endif
}

Expand Down

0 comments on commit 5c34e35

Please sign in to comment.