diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index 20a1c8ea..4f315e97 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -90,11 +90,6 @@ namespace Vocaluxe.Base get { return _CurrentPlaylistElement.SongID; } } - public static bool Duet - { - get { return _CurrentPlaylistElement.Duet; } - } - public static bool SongHasVideo { get { return File.Exists(_CurrentPlaylistElement.VideoFilePath); } @@ -581,17 +576,6 @@ namespace Vocaluxe.Base } } - public bool Duet - { - get - { - if (_Song != null) - return _Song.IsDuet; - - return false; - } - } - public CPlaylistElement(CSong song) { MusicFilePath = string.Empty; diff --git a/Vocaluxe/Base/CMain.cs b/Vocaluxe/Base/CMain.cs index 84523016..6ff4068a 100644 --- a/Vocaluxe/Base/CMain.cs +++ b/Vocaluxe/Base/CMain.cs @@ -532,6 +532,11 @@ namespace Vocaluxe.Base return CGame.GetTimeFromBeats(beat, bpm); } + public float GetBeatFromTime(float time, float bpm, float gap) + { + return CGame.GetBeatFromTime(time, bpm, gap); + } + public void AddSong(int songID, EGameMode gameMode) { CGame.AddSong(songID, gameMode); diff --git a/Vocaluxe/GameModes/CGameModes.cs b/Vocaluxe/GameModes/CGameModes.cs index c49ff93e..a7e7d4b2 100644 --- a/Vocaluxe/GameModes/CGameModes.cs +++ b/Vocaluxe/GameModes/CGameModes.cs @@ -52,7 +52,7 @@ namespace Vocaluxe.GameModes { protected override CSong _PrepareSong(CSong song) { - return song; + return (song.IsGameModeAvailable(EGameMode.TR_GAMEMODE_NORMAL)) ? song : null; } } @@ -60,7 +60,7 @@ namespace Vocaluxe.GameModes { protected override CSong _PrepareSong(CSong song) { - return (song.IsDuet) ? song : null; + return (song.IsGameModeAvailable(EGameMode.TR_GAMEMODE_DUET)) ? song : null; } } @@ -68,6 +68,8 @@ namespace Vocaluxe.GameModes { protected override CSong _PrepareSong(CSong song) { + if (!song.IsGameModeAvailable(EGameMode.TR_GAMEMODE_SHORTSONG)) + return null; var newSong = new CSong(song) {Finish = CGame.GetTimeFromBeats(song.ShortEnd.EndBeat, song.BPM) + CSettings.DefaultMedleyFadeOutTime + song.Gap}; // set lines to short mode newSong.Notes.SetMedley(0, song.ShortEnd.EndBeat); @@ -80,6 +82,8 @@ namespace Vocaluxe.GameModes { protected override CSong _PrepareSong(CSong song) { + if (!song.IsGameModeAvailable(EGameMode.TR_GAMEMODE_MEDLEY)) + return null; var newSong = new CSong(song) {Start = CGame.GetTimeFromBeats(song.Medley.StartBeat, song.BPM) - song.Medley.FadeInTime + song.Gap}; if (newSong.Start < 0f) newSong.Start = 0f; diff --git a/Vocaluxe/Lib/Playlist/CPlaylistFile.cs b/Vocaluxe/Lib/Playlist/CPlaylistFile.cs index 3c17a424..6c7f5228 100644 --- a/Vocaluxe/Lib/Playlist/CPlaylistFile.cs +++ b/Vocaluxe/Lib/Playlist/CPlaylistFile.cs @@ -180,7 +180,11 @@ namespace Vocaluxe.Lib.Playlist public void AddSong(int songID) { - var song = new CPlaylistSong {SongID = songID, GameMode = CSongs.GetSong(songID).IsDuet ? EGameMode.TR_GAMEMODE_DUET : EGameMode.TR_GAMEMODE_NORMAL}; + var song = new CPlaylistSong + { + SongID = songID, + GameMode = CSongs.GetSong(songID).IsGameModeAvailable(EGameMode.TR_GAMEMODE_DUET) ? EGameMode.TR_GAMEMODE_DUET : EGameMode.TR_GAMEMODE_NORMAL + }; Songs.Add(song); } diff --git a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs index c48b2f08..9ffe1779 100644 --- a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs +++ b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs @@ -200,7 +200,7 @@ namespace Vocaluxe.Screens CGame.ClearSongs(); var gm = EGameMode.TR_GAMEMODE_NORMAL; - if (CSongs.AllSongs[songNr].IsDuet) + if (CSongs.AllSongs[songNr].IsGameModeAvailable(EGameMode.TR_GAMEMODE_DUET)) gm = EGameMode.TR_GAMEMODE_DUET; CGame.AddSong(songNr, gm); diff --git a/Vocaluxe/SongQueue/CSongQueue.cs b/Vocaluxe/SongQueue/CSongQueue.cs index b23f1288..6bbdc664 100644 --- a/Vocaluxe/SongQueue/CSongQueue.cs +++ b/Vocaluxe/SongQueue/CSongQueue.cs @@ -69,7 +69,7 @@ namespace Vocaluxe.SongQueue private bool _AddSong(int songID, EGameMode gameMode) { - if (gameMode == EGameMode.TR_GAMEMODE_DUET && !CSongs.GetSong(songID).IsDuet) + if (CSongs.GetSong(songID).IsGameModeAvailable(gameMode)) return false; _SongQueue.Add(new SSongQueueEntry(songID, gameMode)); diff --git a/VocaluxeLib/Menu/CPlaylist.cs b/VocaluxeLib/Menu/CPlaylist.cs index 1eecc9f2..1610fd52 100644 --- a/VocaluxeLib/Menu/CPlaylist.cs +++ b/VocaluxeLib/Menu/CPlaylist.cs @@ -971,11 +971,11 @@ namespace VocaluxeLib.Menu if (!mouseEvent.LBH && DragAndDropSongID != -1) { - var gm = EGameMode.TR_GAMEMODE_NORMAL; CSong song = CBase.Songs.GetSongByID(DragAndDropSongID); if (song != null) { + var gm = EGameMode.TR_GAMEMODE_NORMAL; if (song.IsDuet) gm = EGameMode.TR_GAMEMODE_DUET;