fixed bg music stop in songscreen, fixed bg music start in loadscreen

This commit is contained in:
Alexander Eckart committed 2012-05-12 14:39:34 +02:00
1 parent 4d3eed294b
commit b910cc2224
3 files changed
+24 -12

No files matched your search

+9
View File
@@ -156,6 +156,9 @@ namespace Vocaluxe.Base
public static void Play() public static void Play()
{ {
if (_Playing)
return;
if (CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON) if (CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON)
{ {
if (_AllFileNames.Count > 0) if (_AllFileNames.Count > 0)
@@ -181,6 +184,9 @@ namespace Vocaluxe.Base
public static void Stop() public static void Stop()
{ {
if (!_Playing)
return;
if (_VideoEnabled && _Video != -1) if (_VideoEnabled && _Video != -1)
{ {
CVideo.VdClose(_Video); CVideo.VdClose(_Video);
@@ -195,6 +201,9 @@ namespace Vocaluxe.Base
public static void Pause() public static void Pause()
{ {
if (!_Playing)
return;
if (_VideoEnabled && _Video != -1) if (_VideoEnabled && _Video != -1)
{ {
CVideo.VdPause(_Video); CVideo.VdPause(_Video);
+8 -8
View File
@@ -30,6 +30,8 @@ namespace Vocaluxe.Screens
private int _CurrentIntroVideoNr; private int _CurrentIntroVideoNr;
private bool _IntroOutPlayed; private bool _IntroOutPlayed;
private VideoPlayer[] _Intros; private VideoPlayer[] _Intros;
private bool _BGMusicStartet;
public CScreenLoad() public CScreenLoad()
@@ -121,8 +123,7 @@ namespace Vocaluxe.Screens
} }
} }
if (!CBackgroundMusic.Playing) _BGMusicStartet = false;
CBackgroundMusic.Next();
} }
public override void OnShowFinish() public override void OnShowFinish()
@@ -141,9 +142,6 @@ namespace Vocaluxe.Screens
_SongLoaderThread.IsBackground = true; _SongLoaderThread.IsBackground = true;
_SongLoaderThread.Start(); _SongLoaderThread.Start();
_timer.Start(); _timer.Start();
if (!CBackgroundMusic.Playing)
CBackgroundMusic.Next();
} }
public override bool UpdateGame() public override bool UpdateGame()
@@ -172,12 +170,14 @@ namespace Vocaluxe.Screens
CLanguage.Translate("TR_SCREENLOAD_LOADED") + ")"; CLanguage.Translate("TR_SCREENLOAD_LOADED") + ")";
if (CSongs.SongsLoaded && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON && if (CSongs.SongsLoaded && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON &&
CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC) CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC && !_BGMusicStartet)
{ {
CBackgroundMusic.AddOwnMusic(); CBackgroundMusic.AddOwnMusic();
//if (!CBackgroundMusic.Playing) if (!CBackgroundMusic.Playing)
// CBackgroundMusic.Next(); CBackgroundMusic.Next();
_BGMusicStartet = true;
} }
CBackgroundMusic.CanSing = false; CBackgroundMusic.CanSing = false;
+7 -4
View File
@@ -183,16 +183,19 @@ namespace Vocaluxe.Screens
SongMenus[htSongMenus(SongMenu)].Update(); SongMenus[htSongMenus(SongMenu)].Update();
Texts[htTexts(TextCategory)].Text = CSongs.GetActualCategoryName(); Texts[htTexts(TextCategory)].Text = CSongs.GetActualCategoryName();
if (CSongs.Category > 0 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF)
CBackgroundMusic.Disabled = true;
else
CBackgroundMusic.Disabled = false;
int song = SongMenus[htSongMenus(SongMenu)].GetActualSelection(); int song = SongMenus[htSongMenus(SongMenu)].GetActualSelection();
if ((CSongs.Category >= 0 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) && song >= 0 && song < CSongs.VisibleSongs.Length) if ((CSongs.Category >= 0 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) && song >= 0 && song < CSongs.VisibleSongs.Length)
{ {
Texts[htTexts(TextSelection)].Text = CSongs.VisibleSongs[song].Artist + " - " + CSongs.VisibleSongs[song].Title; Texts[htTexts(TextSelection)].Text = CSongs.VisibleSongs[song].Artist + " - " + CSongs.VisibleSongs[song].Title;
CBackgroundMusic.Disabled = true;
} }
else if (CSongs.Category == -1 && song >= 0 && song < CSongs.Categories.Length) else if (CSongs.Category == -1 && song >= 0 && song < CSongs.Categories.Length)
{ {
Texts[htTexts(TextSelection)].Text = CSongs.Categories[song].Name; Texts[htTexts(TextSelection)].Text = CSongs.Categories[song].Name;
CBackgroundMusic.Disabled = false;
} }
else else
Texts[htTexts(TextSelection)].Text = String.Empty; Texts[htTexts(TextSelection)].Text = String.Empty;