Fixed error with no Files in BackgroundMusic folder

This commit is contained in:
Stephan Sundermann committed 2012-02-19 19:57:50 +01:00
1 parent 5fdb3d822c
commit 67e0d72424
1 file changed
+3 -1
+3 -1
View File
@@ -28,9 +28,9 @@ namespace Vocaluxe.Base
foreach (string file in files) foreach (string file in files)
{ {
_BackgroundMusicStreams.Add(CSound.Load(file)); _BackgroundMusicStreams.Add(CSound.Load(file));
}
_CurrentMusicStream = _BackgroundMusicStreams[0]; _CurrentMusicStream = _BackgroundMusicStreams[0];
} }
}
public static void Play() public static void Play()
{ {
@@ -51,11 +51,13 @@ namespace Vocaluxe.Base
public static void Stop() public static void Stop()
{ {
if(_BackgroundMusicStreams.Count > 0)
CSound.FadeAndStop(_BackgroundMusicStreams[_CurrentStreamListIndex], CConfig.BackgroundMusicVolume, CConfig.FadeTime); CSound.FadeAndStop(_BackgroundMusicStreams[_CurrentStreamListIndex], CConfig.BackgroundMusicVolume, CConfig.FadeTime);
} }
public static void Pause() public static void Pause()
{ {
if (_BackgroundMusicStreams.Count > 0)
CSound.Pause(_BackgroundMusicStreams[_CurrentStreamListIndex]); CSound.Pause(_BackgroundMusicStreams[_CurrentStreamListIndex]);
} }