Removal of ID3v2 header from FLAC files
David Troendle
david at troendle.org
Wed May 18 17:36:22 CEST 2011
I am still a bit new at this, but I believe the code snippet below will
remove all ID3v2 frames from a TagLib::FLAC::File. However the ID3v2 header
appears to remain because calls to TagLib::FLAC::File::ID3v2 return a
non-NULL. Also, Mp3tag still reports there are ID3v2 tags.
Is there a way to remove the ID3v2 header?
(Using TagLib 1.7.)
Code snippet follows:
void FLACFileTags::RemoveAllID3v2Frames(void)
{
TagLib::ID3v2::Tag *ID3v2Tag = m_FLACFile->ID3v2Tag();
if (!ID3v2Tag)
{
// There are no ID3v2 tags.
return;
}
const TagLib::ID3v2::FrameListMap &FrameMap = ID3v2Tag->frameListMap();
TagLib::ID3v2::FrameListMap::ConstIterator FrameMapIterator;
for (FrameMapIterator = FrameMap.begin(); FrameMapIterator !=
FrameMap.end(); ++FrameMapIterator)
{
ID3v2Tag->removeFrames(FrameMapIterator->first);
}
return;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/taglib-devel/attachments/20110518/98d85be7/attachment.htm
More information about the taglib-devel
mailing list