internal static void SetNewArtistName(RawTrack item, string newname) { if (item == unknown) throw new ArgumentException("Cannot alter \"Unknown\""); item.artist = newname; }
/// <summary> /// Creates a new instance of the <see cref="RawTrack"/> that is a copy of the current instance. /// </summary> /// <returns>A new cloned instance of the current object.</returns> public object Clone() { RawTrack rt = new RawTrack(); rt.album = this.album; rt.artist = this.artist; rt.file = this.file; rt.number = this.number; rt.searchstring = this.searchstring; rt.track = this.track; return rt; }
/// <summary> /// Reads metadata from a file to a <see cref="RawTrack"/> item. A return value indicates whether parsing succeeded. The actual parsing is done using <see cref="ParseTrack(string)"/>. /// </summary> /// <param name="filepath">The full path of the file from which to read.</param> /// <param name="item">When the method returns, contains the read metadata, if parsing succeeded, or null if parsing failed. Parsing fails if any exception is thrown from the <see cref="ParseTrack(string)"/> method. This parameter is passed uninitialized.</param> /// <returns>true if the file was parsed successfully; otherwise, false.</returns> public bool TryParseTrack(string filepath, out RawTrack item) { try { item = ParseTrack(filepath); return item != null; } catch { item = null; return false; } }
static RawTrack() { unknown = new RawTrack(); }
public void Load(RawTrack song) { lock (_playerLock) { _soundFile = _soundSystem.CreateSound(song.FullFilename); _isLoaded = true; } }