Fix repeating of bg-music.

This commit is contained in:
Florian Küpper committed 2014-08-24 17:38:37 +02:00
1 parent 942c8dca27
commit 46544aee82
3 files changed
+7 -4

No files matched your search

@@ -475,8 +475,6 @@ namespace VocaluxeLib.Menu.SongMenu
{ {
_PreviewNrInternal = -1; _PreviewNrInternal = -1;
CBase.BackgroundMusic.StopPreview();
CSong song = CBase.Songs.GetVisibleSong(nr); CSong song = CBase.Songs.GetVisibleSong(nr);
if (song == null) if (song == null)
return; return;
+1
View File
@@ -163,6 +163,7 @@ namespace VocaluxeLib.Utils.Player
base.TogglePause(); base.TogglePause();
} }
private void _LoadVideo() private void _LoadVideo()
{ {
if (_Song == null) if (_Song == null)
+6 -2
View File
@@ -48,9 +48,9 @@ namespace VocaluxeLib.Utils.Player
} }
public bool RepeatSong; public bool RepeatSong;
public bool IsPlaying { get; private set; } public bool IsPlaying { get; protected set; }
public bool IsFinished { get { return CBase.Sound.IsFinished(_StreamID); } } public bool IsFinished { get { return RepeatSong ? false : CBase.Sound.IsFinished(_StreamID); } }
public CSoundPlayer(bool loop = false) public CSoundPlayer(bool loop = false)
{ {
@@ -131,7 +131,11 @@ namespace VocaluxeLib.Utils.Player
if (timeToPlay <= _FadeTime || finished) if (timeToPlay <= _FadeTime || finished)
{ {
if (RepeatSong) if (RepeatSong)
{
//Set to false for restarting
IsPlaying = false;
Play(); Play();
}
else else
Stop(); Stop();
} }