internal static void GetBMEInfo(string file)
{
var commands = new Dictionary <string, string>();
foreach (var line in File.ReadLines(file))
{
if (!line.StartsWith("#"))
{
continue;
}
var command = line.ToUpper().Substring(1).Split(" ").ToList();
if (command.Count > 1)
{
commands.Add(command[0], string.Join(" ", command.GetRange(1, command.Count - 1)));
}
}
if (commands["PLAYER"] == "1")
{
SongInfo songInfo = new SongInfo();
songInfo.Artist = commands["ARTIST"];
songInfo.BPM = float.Parse(commands["BPM"]);
songInfo.Difficulty = (Difficulty)int.Parse(commands["DIFFICULTY"]);
songInfo.Genre = commands["GENRE"];
songInfo.Path = file;
songInfo.PlayLevel = byte.Parse(commands["PLAYLEVEL"]);
songInfo.Title = commands["TITLE"];
songInfo.Total = float.Parse(commands["TOTAL"]);
Songs.Add(songInfo);
}
}