<div dir="ltr">Here's what I use in my music player:<div><br></div><div><a href="https://github.com/gogglesmm/gogglesmm/blob/develop/src/GMTag.cpp#L609">https://github.com/gogglesmm/gogglesmm/blob/develop/src/GMTag.cpp#L609</a><br></div><div><br></div><div>Basically, dynamic_casts to get the specific tag container and then query specific things from it.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 27, 2014 at 7:23 PM, Bill Fraser <span dir="ltr"><<a href="mailto:bill.fraser@gmail.com" target="_blank">bill.fraser@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hello,<br><br></div>I'm using TagLib in a program which, among other things, needs to get the "albumartist" field from a bunch of music in different formats.<br><br>I see that the TagLib::Tag generic interface doesn't contain albumartist (presumably because not all tag types have this property), but a number of the specific Tag implementations do have it (ID3v2 and XiphComment, at least).<br><br></div><div>To get at this property, the first thing I tried was to use the generic Tag's properties() method and look for an "albumartist" property, but this doesn't work (though it does work on ID3v2 and XiphComment).<br><br>The next thing I tried was to take the Tag pointer returned by File and dynamic_cast it to ID3v2::Tag*, XiphComment::Tag*, etc., so I could use their properties() methods, but this doesn't work either.<br><br>So it looks like the only way to get this is to figure out the file type myself (based on file extension or whatever) and instantiate the specific Tag implementation myself. This seems kind of round-about to me, since obviously the generic Tag implementation has to do this already to provide me the few fields that it's capable of.<br><br></div><div>So my questions are:<br></div><div>1. Why doesn't generic Tag::properties() work with "albumartist"?<br></div><div>2. How can I get at the specific Tag implementation being used?<br><br></div><div>Everything else I've done with TagLib has been freaking awesome. I love how I don't have to do file type detection -- everything else just works -- so I'll be rather disappointed if I have to start doing that.<br><br>Thanks!<span class="HOEnZb"><font color="#888888"><br clear="all"></font></span></div><span class="HOEnZb"><font color="#888888"><div><div><div><br>-- <br><div dir="ltr">Bill Fraser { <a href="http://www.codewise.org/wrf" target="_blank">http://www.codewise.org/wrf</a> }</div>
</div></div></div></font></span></div>
<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><br></div>