diff --git a/VocaluxeLib/Songs/CSong.cs b/VocaluxeLib/Songs/CSong.cs index 3dfacbc7..93048cc2 100644 --- a/VocaluxeLib/Songs/CSong.cs +++ b/VocaluxeLib/Songs/CSong.cs @@ -44,6 +44,8 @@ namespace VocaluxeLib.Songs Title = 1, Artist = 2, MP3 = 4, + Instrumental = 5, + Vocals = 6, BPM = 8, MedleyStartBeat = 16, MedleyEndBeat = 32 @@ -97,6 +99,8 @@ namespace VocaluxeLib.Songs public bool Relative; public string MP3FileName = String.Empty; + public string InstrumentalFileName = String.Empty; + public string VocalsFileName = String.Empty; public string CoverFileName = String.Empty; public readonly List BackgroundFileNames = new List(); public string VideoFileName = String.Empty; @@ -230,6 +234,8 @@ namespace VocaluxeLib.Songs Relative = song.Relative; MP3FileName = song.MP3FileName; + InstrumentalFileName = song.InstrumentalFileName; + VocalsFileName = song.VocalsFileName; CoverFileName = song.CoverFileName; BackgroundFileNames = song.BackgroundFileNames; VideoFileName = song.VideoFileName; @@ -318,6 +324,16 @@ namespace VocaluxeLib.Songs return Path.Combine(Folder, MP3FileName); } + public string GetInstrumental() + { + return Path.Combine(Folder, InstrumentalFileName); + } + + public string GetVocals() + { + return Path.Combine(Folder, VocalsFileName); + } + public string GetVideo() { return Path.Combine(Folder, VideoFileName); diff --git a/VocaluxeLib/Songs/CSongLoader.cs b/VocaluxeLib/Songs/CSongLoader.cs index 77eddf3b..2dffc39c 100644 --- a/VocaluxeLib/Songs/CSongLoader.cs +++ b/VocaluxeLib/Songs/CSongLoader.cs @@ -172,6 +172,7 @@ namespace VocaluxeLib.Songs break; case "SOURCE": case "YOUTUBE": + case "PROVIDEDBY": _Song.Source = value; break; case "LENGTH": @@ -190,6 +191,30 @@ namespace VocaluxeLib.Songs return false; } break; + case "INSTRUMENTAL": + if (File.Exists(Path.Combine(_Song.Folder, value))) + { + _Song.InstrumentalFileName = value; + headerFlags |= EHeaderFlags.Instrumental; + } + else + { + CLog.CSongLog.Error("[{SongFileName}] Can't find instrumental audio file: {AudioFile}", CLog.Params(_Song.FileName, Path.Combine(_Song.Folder, value))); + return false; + } + break; + case "VOCALS": + if (File.Exists(Path.Combine(_Song.Folder, value))) + { + _Song.VocalsFileName = value; + headerFlags |= EHeaderFlags.Vocals; + } + else + { + CLog.CSongLog.Error("[{SongFileName}] Can't find vocal audio file: {AudioFile}", CLog.Params(_Song.FileName, Path.Combine(_Song.Folder, value))); + return false; + } + break; case "BPM": if (CHelper.TryParse(value, out _Song.BPM)) {