public void AddTrack(string File) { string fileName = File.Substring(Location.Length); #if NOT_NET4 for (int i = 0; i < Settings.IgnoredFiles.Length; ++i) { if (Settings.IgnoredFiles[i].Equals(fileName)) { return; } } #else if (Settings.IgnoredFiles.Contains(fileName)) { return; } #endif string extension = System.IO.Path.GetExtension(File); #if NOT_NET4 bool valid = false; for (int i = 0; i < Settings.AcceptedFiles.Length; ++i) { if (Settings.AcceptedFiles[i].Equals(extension.ToLower())) { valid = true; } if (valid) { break; } } if (!valid) { throw new UnknownAudioFormatException(fileName); } #else if (!Settings.AcceptedFiles.Contains(extension.ToLower())) { throw new UnknownAudioFormatException(fileName); } #endif Track t = new Track(fileName, Location, engine); LinkedListNode <Track> node = new LinkedListNode <Track>(t); Tracks.AddLast(node); }
public void AddTrack(IAudioSource track) { Tracks.AddLast(track); NewTrackPossiblyAvailable.Set(); }