On Tue, Mar 16, 2010 at 2:01 AM, Jeff Mitchell <span dir="ltr">&lt;<a href="mailto:mitchell@kde.org">mitchell@kde.org</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On 3/13/2010 1:28 PM, Новичков А.А. wrote:<br>
&gt; TagLib::FLAC::File *f=new TagLib::FLAC::File(FILE_NAME(file));<br>
&gt;         {TagLib::Ogg::XiphComment *tag=f-&gt;xiphComment(false);<br>
&gt;         if (tag) {<br>
&gt;             TagLib::Ogg::FieldListMap map=tag-&gt;fieldListMap();<br>
&gt;             TagLib::StringList list;<br>
&gt;             for (TagLib::Ogg::FieldListMap::ConstIterator it =<br>
&gt; map.begin(); it != map.end(); ++it)<br>
&gt;                 list.append((*it).first);<br>
&gt;             for (TagLib::StringList::ConstIterator it=list.begin(); it!<br>
&gt; =list.end(); ++it)<br>
&gt;                 tag-&gt;removeField((*it));<br>
&gt;         } }<br>
&gt;         {TagLib::ID3v1::Tag *tag=f-&gt;ID3v1Tag(false);<br>
&gt;          if (tag) {<br>
&gt;             tag-&gt;setAlbum(&quot;&quot;);<br>
&gt;             tag-&gt;setArtist(&quot;&quot;);<br>
&gt;             tag-&gt;setComment(&quot;&quot;);<br>
&gt;             tag-&gt;setGenre(&quot;&quot;);<br>
&gt;             tag-&gt;setTitle(&quot;&quot;);<br>
&gt;             tag-&gt;setTrack(0);<br>
&gt;             tag-&gt;setYear(0);<br>
&gt;         } }<br>
&gt;        {TagLib::ID3v2::Tag *tag=f-&gt;ID3v2Tag(false);<br>
&gt;         if (tag) {<br>
&gt;             tag-&gt;setAlbum(&quot;&quot;);<br>
&gt;             tag-&gt;setArtist(&quot;&quot;);<br>
&gt;             tag-&gt;setComment(&quot;&quot;);<br>
&gt;             tag-&gt;setGenre(&quot;&quot;);<br>
&gt;             tag-&gt;setTitle(&quot;&quot;);<br>
&gt;             tag-&gt;setTrack(0);<br>
&gt;             tag-&gt;setYear(0);<br>
&gt;             TagLib::ID3v2::FrameListMap map =tag-&gt;frameListMap();<br>
&gt;             TagLib::List&lt;TagLib::ByteVector&gt; list;<br>
&gt;             for (TagLib::ID3v2::FrameListMap::ConstIterator it =<br>
&gt; map.begin(); it != map.end(); ++it)<br>
&gt;                 list.append((*it).first);<br>
&gt;             for (TagLib::List&lt;TagLib::ByteVector&gt;::ConstIterator<br>
&gt; it=list.begin(); it!=list.end(); ++it)<br>
&gt;                 tag-&gt;removeFrames((*it));<br>
&gt;         } }<br>
&gt;         f-&gt;save();<br>
&gt;         delete f;<br>
<br>
Setting the album/artist/genre/etc to an empty string doesn&#39;t strip the<br>
tag, it just makes it empty.<br>
<br>
Just use the various functions to go through the item maps or attribute<br>
maps and remove each item you find. You already do this for two of the<br>
formats above, but with a lot of needless code in front.<br>
<font color="#888888"><br>
--Jeff<br>
<br>
</font><br>_______________________________________________<br>
taglib-devel mailing list<br>
<a href="mailto:taglib-devel@kde.org">taglib-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/taglib-devel" target="_blank">https://mail.kde.org/mailman/listinfo/taglib-devel</a><br>
<br></blockquote><div> </div></div> It is true for stripping the xiph comment or ape tag, however I never successfully cleared the asf tag, taglib always leave<br>empty attributes of artist, comment, copyright, rating, title.<br>
<br clear="all"><br>-- <br>Best Regards<br>