Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Deletes the ID3 tag of the specified tag family type from the MP3 data.
        /// </summary>
        /// <param name="family">The ID3 tag family type.</param>
        public void DeleteTag(Id3TagFamily family)
        {
            EnsureWritePermissions(Mp3Messages.NoWritePermissions_CannotDeleteTag);
            Id3Handler foundHandler = ExistingHandlers.FirstOrDefault(handler => handler.Family == family);

            if (foundHandler != null)
            {
                foundHandler.DeleteTag(Stream);
                InvalidateExistingHandlers();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Deletes the ID3 tag of the specified tag family type from the MP3 data.
        /// </summary>
        /// <param name="family">The ID3 tag family type.</param>
        public void DeleteTag(Id3TagFamily family)
        {
            EnsureWritePermissions(Id3Messages.NoWritePermissions_CannotDeleteTag);
            IEnumerable <RegisteredId3Handler> registeredHandlers = ExistingHandlers.GetHandlers(family);
            RegisteredId3Handler registeredHandler = registeredHandlers.FirstOrDefault();

            if (registeredHandler != null)
            {
                Id3Handler handler = registeredHandler.Handler;
                handler.DeleteTag(_stream);
                InvalidateExistingHandlers();
            }
        }
Exemplo n.º 4
0
        /// <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);
        }
 internal IEnumerable <RegisteredId3Handler> GetHandlers(Id3TagFamily family)
 {
     return(this.Where(handler => handler.Handler.Family == family));
 }
Exemplo n.º 6
0
 public bool HasTagOfFamily(Id3TagFamily family)
 {
     return(ExistingHandlers.Any(handler => handler.Handler.Family == family));
 }
 public bool HasTagOfFamily(Id3TagFamily family)
 {
     return(false);
 }
 public Id3Tag GetTag(Id3TagFamily family)
 {
     return(null);
 }
 public void DeleteTag(Id3TagFamily family)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 10
0
 public bool HasTagOfFamily(Id3TagFamily family) =>
 ExistingHandlers.Any(handler => handler.Family == family);
Exemplo n.º 11
0
        /// <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 _));
        }
 internal Id3HandlerMetadata(Id3Version version, Id3TagFamily family, Type type)
 {
     Version = version;
     Family  = family;
     Type    = type;
 }