<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
Simply use<br>
frame->setText(values)<br>
which is also declared with a StringList argument.<br>
<br>
Regards,<br>
Michael<br>
Am 05.10.2013 04:07, schrieb Duke Yin:<br>
</div>
<blockquote
cite="mid:CADzCEdet9DK2u7dXWivxhMAVnQxCXSTxBcQC1KpA0x7AFWrt=g@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>I'm trying to figure out how to write multiple values to an
ID3v2.4 tag. ID3v2.4 spec is to have a single frame where all
values are joined together with a null character. (By
contrast, ID3v2.3 uses a backslash instead of null.
XiphComment uses multiple frames instead of a single frame
with a delimiting character.) I couldn't find any code
examples for ID3v2.4, so I tried two approaches which failed.</div>
<div><br>
</div>
<div>Approach 1: add a new frame for each value</div>
<div>> // for each string {</div>
<div>> TagLib::ID3v2::TextIdentificationFrame *frame = new
TagLib::ID3v2::TextIdentificationFrame(keyStr,
TagLib::String::UTF8);</div>
<div>> id3v2->addFrame(frame);</div>
<div>> frame->setText(str);</div>
<div>> // } close for loop</div>
<div>Result 1: incorrect - multiple frames instead of a single
frame.</div>
<div><br>
</div>
<div>Approach 2: manually separate the values with the null
character</div>
<div>> TagLib::StringList values;</div>
<div>> // { for each string, append the string to "values" }</div>
<div>
<div>> TagLib::ID3v2::TextIdentificationFrame *frame = new
TagLib::ID3v2::TextIdentificationFrame(keyStr,
TagLib::String::UTF8);</div>
<div>> id3v2->addFrame(frame);</div>
<div>> frame->setText(values.toString('\0'));</div>
</div>
<div>Result 2: wrong and inconsistent behaviors:</div>
<div>- All values can be read by foobar2000</div>
<div>- The last value can't be read by Mp3tag, apparently
because the text encoding size is double what Mp3tag would
write with the same input</div>
<div>- All values except the first can't be read by TagLib when
the file is opened again with code similar to <a
moz-do-not-send="true"
href="https://gist.github.com/Horrendus/622816">https://gist.github.com/Horrendus/622816</a>
.</div>
<div>
<br>
</div>
<div>I'm not sure if I'm using the null character correctly in
Approach 2 given how many apps it breaks (although foobar2000
handles it). I'm hoping there's an easy way to write
multiple values to ID3v2.4 that I missed. What is the correct
way to do this?</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
taglib-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:taglib-devel@kde.org">taglib-devel@kde.org</a>
<a class="moz-txt-link-freetext" href="https://mail.kde.org/mailman/listinfo/taglib-devel">https://mail.kde.org/mailman/listinfo/taglib-devel</a>
</pre>
</blockquote>
<br>
</body>
</html>