diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index 44b39f27..506c8c52 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -34,6 +34,7 @@ namespace Vocaluxe.Base private static bool _Playing; private static bool _Disabled; private static bool _CanSing; + private static bool _RepeatSong; public static bool VideoEnabled { @@ -84,6 +85,18 @@ namespace Vocaluxe.Base } } + public static bool RepeatSong + { + get + { + return _RepeatSong; + } + set + { + _RepeatSong = value; + } + } + public static int SongID { get @@ -228,7 +241,14 @@ namespace Vocaluxe.Base bool finished = CSound.IsFinished(_CurrentMusicStream); if (_Playing && (timeToPlay <= CSettings.BackgroundMusicFadeTime || finished)) - Next(); + if (_RepeatSong) + { + CSound.SetPosition(_CurrentMusicStream, 0); + if (_VideoEnabled && _Video != -1) + CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap); + } + else + Next(); } } diff --git a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs index 8e7d8ad9..f1b206b2 100644 --- a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs +++ b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs @@ -134,7 +134,7 @@ namespace Vocaluxe.Screens if (Buttons[htButtons(ButtonPause)].Selected) CBackgroundMusic.Pause(); if (Buttons[htButtons(ButtonRepeat)].Selected) - CBackgroundMusic.Repeat(); + CBackgroundMusic.RepeatSong = !CBackgroundMusic.RepeatSong; if (Buttons[htButtons(ButtonShowVideo)].Selected) VideoPreview = !VideoPreview; if (Buttons[htButtons(ButtonSing)].Selected) @@ -162,7 +162,7 @@ namespace Vocaluxe.Screens if (Buttons[htButtons(ButtonPause)].Selected) CBackgroundMusic.Pause(); if (Buttons[htButtons(ButtonRepeat)].Selected) - CBackgroundMusic.Repeat(); + CBackgroundMusic.RepeatSong = !CBackgroundMusic.RepeatSong; if (Buttons[htButtons(ButtonShowVideo)].Selected) VideoPreview = !VideoPreview; if (Buttons[htButtons(ButtonSing)].Selected) @@ -187,6 +187,7 @@ namespace Vocaluxe.Screens Statics[htStatics(StaticCover)].Visible = !_VideoPreview || !CBackgroundMusic.SongHasVideo; Buttons[htButtons(ButtonToBackgroundVideo)].Pressed = VideoBackground; Buttons[htButtons(ButtonShowVideo)].Pressed = _VideoPreview; + Buttons[htButtons(ButtonRepeat)].Pressed = CBackgroundMusic.RepeatSong; Buttons[htButtons(ButtonSing)].Visible = CBackgroundMusic.CanSing; return true; }