Fix nullpointer-exception and bg-music behaviour.
This commit is contained in:
1 parent
be51ba450b
commit
dddb1206b3
4 files changed
+13
-3
No files matched your search
@@ -155,12 +155,12 @@ namespace Vocaluxe.Base
|
||||
|
||||
foreach (string path in soundFiles)
|
||||
_BGMusicFiles.Add(new CPlaylistElement(path));
|
||||
_CurPlayer = _BGPlayer;
|
||||
//Set a default to have a consistent starting point, use SetMusicSource afterwards
|
||||
_MusicSource = EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC;
|
||||
_AddBackgroundMusic();
|
||||
|
||||
SetMusicSource(CConfig.Config.Sound.BackgroundMusicSource);
|
||||
_CurPlayer = _BGPlayer;
|
||||
_Initialized = true;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static void Play()
|
||||
{
|
||||
if (!IsPlayingPreview && CConfig.Config.Sound.BackgroundMusic == EBackgroundMusicOffOn.TR_CONFIG_OFF)
|
||||
if (!IsPlayingPreview && CConfig.Config.Sound.BackgroundMusic != EBackgroundMusicOffOn.TR_CONFIG_ON)
|
||||
return;
|
||||
|
||||
if (IsPlayingPreview || _BGPlayer.SoundLoaded)
|
||||
|
||||
@@ -50,6 +50,11 @@ namespace Vocaluxe.Screens
|
||||
private int _Pos;
|
||||
private bool _IsDuet;
|
||||
|
||||
public override EMusicType CurrentMusicType
|
||||
{
|
||||
get { return CConfig.Config.Sound.BackgroundMusic == EBackgroundMusicOffOn.TR_CONFIG_OFF ? EMusicType.None : EMusicType.Preview; }
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace Vocaluxe.Screens
|
||||
|
||||
public override EMusicType CurrentMusicType
|
||||
{
|
||||
get { return EMusicType.Preview; }
|
||||
get { return CConfig.Config.Sound.BackgroundMusic == EBackgroundMusicOffOn.TR_CONFIG_OFF ? EMusicType.None : EMusicType.Preview; }
|
||||
}
|
||||
|
||||
#region public methods
|
||||
|
||||
@@ -57,6 +57,11 @@ namespace Vocaluxe.Screens
|
||||
private CPoints _Points;
|
||||
private Stopwatch _Timer;
|
||||
|
||||
public override EMusicType CurrentMusicType
|
||||
{
|
||||
get { return CConfig.Config.Sound.BackgroundMusic == EBackgroundMusicOffOn.TR_CONFIG_OFF ? EMusicType.None : EMusicType.Preview; }
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
|
||||
Reference in new issue
Block a user