diff --git a/Vocaluxe/Lib/Sound/Playback/CPlaybackBase.cs b/Vocaluxe/Lib/Sound/Playback/CPlaybackBase.cs index 62bbec70..d8f08ffe 100644 --- a/Vocaluxe/Lib/Sound/Playback/CPlaybackBase.cs +++ b/Vocaluxe/Lib/Sound/Playback/CPlaybackBase.cs @@ -1,4 +1,4 @@ -#region license +#region license // This file is part of Vocaluxe. // // Vocaluxe is free software: you can redistribute it and/or modify @@ -73,9 +73,12 @@ namespace Vocaluxe.Lib.Sound.Playback if (!_Initialized) return; float volumeF = volume.Clamp(0, 100) / 100f; - foreach (IAudioStream stream in _Streams) - if(!stream.IsFading) - stream.VolumeMax = volumeF; + lock (_Streams) + { + foreach (IAudioStream stream in _Streams) + if (!stream.IsFading) + stream.VolumeMax = volumeF; + } _GlobalVolume = volumeF; } @@ -318,4 +321,4 @@ namespace Vocaluxe.Lib.Sound.Playback } } } -} \ No newline at end of file +} diff --git a/VocaluxeLib/Menu/CNameSelection.cs b/VocaluxeLib/Menu/CNameSelection.cs index cdae1dd6..98dbff9d 100644 --- a/VocaluxeLib/Menu/CNameSelection.cs +++ b/VocaluxeLib/Menu/CNameSelection.cs @@ -1,4 +1,4 @@ -#region license +#region license // This file is part of Vocaluxe. // // Vocaluxe is free software: you can redistribute it and/or modify @@ -272,8 +272,16 @@ namespace VocaluxeLib.Menu //Normal activation else if (active) { - SelectedID = _VisibleProfiles.ElementAt(0); - _ActualSelection = 0; + if (_VisibleProfiles.Count > 0) + { + SelectedID = _VisibleProfiles.ElementAt(0); + _ActualSelection = 0; + } + else + { + SelectedID = Guid.Empty; + _ActualSelection = -1; + } _Player = player; _PlayerSelector.Color = CBase.Themes.GetPlayerColor(player); _PlayerSelector.Visible = true; @@ -497,4 +505,4 @@ namespace VocaluxeLib.Menu } #endregion ThemeEdit } -} \ No newline at end of file +}