Exemplo n.º 1
0
        public bool ID3SetFieldValue(string value)
        {
            if (Encoding.UTF8.GetByteCount(value) == value.Length)
            {
                return(CheckResult(NativeMethods.id3tag_set_fieldvalue(context, value)));
            }

            // Value is Unicode.  Encode as UCS2 with BOM and terminator.
            byte[] data = UCS2.GetBytes(value);
            return(CheckResult(NativeMethods.id3tag_set_fieldvalue_utf16(context, data)));
        }
Exemplo n.º 2
0
        public bool ID3SetComment(string comment)
        {
            if (Encoding.UTF8.GetByteCount(comment) == comment.Length)
            {
                return(CheckResult(NativeMethods.id3tag_set_comment(context, comment)));
            }

            // Comment is Unicode.  Encode as UCS2 with BOM and terminator.
            byte[] data = UCS2.GetBytes(comment);
            return(CheckResult(NativeMethods.id3tag_set_comment_utf16(context, "zxx", (byte[])null, data)));
        }