Fixed error with no Files in BackgroundMusic folder
This commit is contained in:
1 parent
5fdb3d822c
commit
67e0d72424
1 file changed
+3
-1
@@ -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]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user