Пример #1
0
        private Tag FindMpcTag(TagTypes type, bool create)
        {
            switch (type)
            {
            case TagTypes.Id3v2:
            {
                if (create && id3v2Tag == null)
                {
                    id3v2Tag = new Id3v2Tag();

                    if (tag != null)
                    {
                        TagLib.Tag.Duplicate(tag, id3v2Tag, true);
                    }

                    tag.SetTags(apeTag, id3v2Tag, id3v1Tag);
                }
                return(id3v2Tag);
            }

            case TagTypes.Id3v1:
            {
                if (create && id3v1Tag == null)
                {
                    id3v1Tag = new Id3v1Tag();

                    if (tag != null)
                    {
                        TagLib.Tag.Duplicate(tag, id3v1Tag, true);
                    }

                    tag.SetTags(apeTag, id3v2Tag, id3v1Tag);
                }
                return(id3v1Tag);
            }

            case TagTypes.Ape:
            {
                if (create && apeTag == null)
                {
                    apeTag = new ApeTag();

                    if (tag != null)
                    {
                        TagLib.Tag.Duplicate(tag, apeTag, true);
                    }

                    tag.SetTags(apeTag, id3v2Tag, id3v1Tag);
                }
                return(apeTag);
            }

            default:
                return(null);
            }
        }
Пример #2
0
        private Tag FindFlacTag(TagTypes type, bool create)
        {
            switch (type)
            {
            case TagTypes.Id3v1:
            {
                if (create && id3v1_tag == null)
                {
                    id3v1_tag = new Id3v1Tag();

                    if (tag != null)
                    {
                        TagLib.Tag.Duplicate(tag, id3v1_tag, true);
                    }

                    tag.SetTags(comment, id3v2_tag, id3v1_tag);
                }
                return(id3v1_tag);
            }

            case TagTypes.Id3v2:
            {
                if (create && id3v2_tag == null)
                {
                    id3v2_tag = new Id3v2Tag();

                    if (tag != null)
                    {
                        TagLib.Tag.Duplicate(tag, id3v2_tag, true);
                    }

                    tag.SetTags(comment, id3v2_tag, id3v1_tag);
                }
                return(id3v2_tag);
            }

            case TagTypes.Xiph:
            {
                if (create && comment == null)
                {
                    comment = new OggXiphComment();

                    if (tag != null)
                    {
                        TagLib.Tag.Duplicate(tag, comment, true);
                    }

                    tag.SetTags(comment, id3v2_tag, id3v1_tag);
                }
                return(comment);
            }

            default:
                return(null);
            }
        }