<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hi<br><br>I'm not sure if this is the right place to ask this question. If not, can someone please point me to the right place?<br><br>I'm using taglib 1.7 (I started a few weeks back with 1.6.3) to develop an application that can write ID3 tags. I found it pretty easy to use apart from one thing.<br><br>When using TagLib::ID3v2::Tag: the documentation says the following about virtual void TagLib::ID3v2::Tag::setAlbum ( const String & s ) [virtual]<br><div style="margin-left: 40px;">Sets the album to s. If s is String::null then this value will be cleared. <br><br></div>I've found however that passing TagLib::String::null does not clear the tag.<br><br>The following is an
exttract of teh code I'm using:<br><br><div style="margin-left: 40px;">MPEG::File f([theFile UTF8String]);<br>ID3v2::Tag *mp3Tag = f.ID3v2Tag();<br><br>if (mp3Tag) {<br><div style="margin-left: 40px;">mp3Tag->setAlbum([Album length] == 0 ? String::null : [Album cStringUsingEncoding:NSUTF8StringEncoding]);<br>bool result = f.save();<br> if (result = NO) {<br> NSLog(@"tag did not save");<br> }else {<br> NSLog(@"tag did save");<br> }<br></div>}<br><br></div>According to the logging the tag did save successfully, however upon reading the tag again the album field is still set to the old value before submitting String::null. I also changed the code to log whether the Album length is detected as 0 and whether String::null is indeed submitted and it is. I haven't tried this with all the set methods but found the same when using
setComment. For setComment I even tried adding mp3Tag->removeFrames("COMM"); which should remove all comment frames. I then used setComment(String::null) afterwards but was still present and had the old value;<br><br>I'm doing this on MAC OS X using xcode. Can any body please advise where I'm going wrong? I found this while using taglib 1.6.3 and then downloaded 1.7 in the hope that it would resolve the issue;<br>Regards,<br>Mike<br><br><br></div> </div><br>
</body></html>