/// <summary> /// Returns a collection of all ID3 tags present in the MP3 data. /// </summary> /// <returns>A collection of all ID3 tags present in the MP3 data.</returns> public IEnumerable <Id3Tag> GetAllTags() { var tags = new Id3Tag[ExistingHandlers.Count]; for (int i = 0; i < tags.Length; i++) { Id3Handler handler = ExistingHandlers[i].Handler; tags[i] = handler.ReadTag(_stream); } return(tags); }
public Id3Tag GetTag(Id3Version version, out object additionalData) { Id3Handler handler = ExistingHandlers.FirstOrDefault(h => h.Version == version); if (handler != null) { return(handler.ReadTag(Stream, out additionalData)); } additionalData = null; return(null); }
public Id3Tag GetTag(Id3TagFamily family, out object additionalData) { Id3Handler familyHandler = ExistingHandlers.FirstOrDefault(handler => handler.Family == family); if (familyHandler != null) { return(familyHandler.ReadTag(Stream, out additionalData)); } additionalData = null; return(null); }
/// <summary> /// Retrieves an ID3 tag of the specified tag family type - version 2.x or version 1.x. /// </summary> /// <param name="family">The ID3 tag family type required.</param> /// <returns>The ID3 tag of the specified tag family type, or null if it doesn't exist.</returns> public Id3Tag GetTag(Id3TagFamily family) { IEnumerable <RegisteredId3Handler> familyHandlers = ExistingHandlers.GetHandlers(family); RegisteredId3Handler familyHandler = familyHandlers.FirstOrDefault(); if (familyHandler == null) { return(null); } Id3Handler handler = familyHandler.Handler; Id3Tag tag = handler.ReadTag(_stream); return(tag); }
/// <summary> /// Retrieves an ID3 tag of the specified version number. /// </summary> /// <param name="version">The tag version number.</param> /// <returns>The ID3 tag of the specified version number, or null if it doesn't exist.</returns> public Id3Tag GetTag(Id3Version version) { Id3Handler handler = ExistingHandlers.FirstOrDefault(h => h.Version == version); return(handler?.ReadTag(Stream, out _)); }
/// <summary> /// Retrieves an ID3 tag of the specified tag family type - version 2.x or version 1.x. /// </summary> /// <param name="family">The ID3 tag family type required.</param> /// <returns>The ID3 tag of the specified tag family type, or null if it doesn't exist.</returns> public Id3Tag GetTag(Id3TagFamily family) { Id3Handler familyHandler = ExistingHandlers.FirstOrDefault(handler => handler.Family == family); return(familyHandler?.ReadTag(Stream, out _)); }