public static void LoadSongs() { CLog.StartBenchmark(1, "Load Songs"); _SongsLoaded = false; _Songs.Clear(); CLog.StartBenchmark(2, "List Songs"); List<string> files = new List<string>(); foreach (string p in CConfig.SongFolder) { string path = p; files.AddRange(Helper.ListFiles(path, "*.txt", true, true)); files.AddRange(Helper.ListFiles(path, "*.txd", true, true)); } CLog.StopBenchmark(2, "List Songs"); CLog.StartBenchmark(2, "Read TXTs"); foreach (string file in files) { CSong Song = new CSong(); if (Song.ReadTXTSong(file)) { Song.ID = _Songs.Count; _Songs.Add(Song); } } CLog.StopBenchmark(2, "Read TXTs"); CLog.StartBenchmark(2, "Sort Songs"); Sort(CConfig.SongSorting); CLog.StopBenchmark(2, "Sort Songs"); Category = -1; _SongsLoaded = true; if (CConfig.Renderer != ERenderer.TR_CONFIG_SOFTWARE && CConfig.CoverLoading == ECoverLoading.TR_CONFIG_COVERLOADING_ATSTART) { CLog.StartBenchmark(2, "Load Cover"); for (int i = 0; i < _Songs.Count; i++) { CSong song = _Songs[i]; song.ReadNotes(); STexture texture = song.CoverTextureSmall; song.CoverTextureBig = texture; _CoverLoadIndex++; } _CoverLoaded = true; CDataBase.CommitCovers(); CLog.StopBenchmark(2, "Load Cover"); } CLog.StopBenchmark(1, "Load Songs "); }
public static void LoadSongs() { CLog.StartBenchmark(1, "Load Songs"); _SongsLoaded = false; _Songs.Clear(); CLog.StartBenchmark(2, "List Songs"); List<string> files = new List<string>(); foreach (string p in CConfig.SongFolder) { string path = p; files.AddRange(Helper.ListFiles(path, "*.txt", true, true)); files.AddRange(Helper.ListFiles(path, "*.txd", true, true)); } CLog.StopBenchmark(2, "List Songs"); CLog.StartBenchmark(2, "Read TXTs"); foreach (string file in files) { CSong Song = new CSong(); if (Song.ReadTXTSong(file)) { Song.ID = _Songs.Count; _Songs.Add(Song); } } CLog.StopBenchmark(2, "Read TXTs"); CLog.StartBenchmark(2, "Sort Songs"); Sort(CConfig.SongSorting); CLog.StopBenchmark(2, "Sort Songs"); Category = -1; _SongsLoaded = true; CLog.StopBenchmark(1, "Load Songs "); }