Is there a way to get the specific Tag implementation from the generic one?

Michael Helmling michaelhelmling at posteo.de
Mon Sep 29 15:01:10 UTC 2014


Hello Bill,

with which formats does the approach through properties() NOT work? You
only mention that it works with Xipth and ID3v2.

Michael

Am 28.09.2014 um 02:23 schrieb Bill Fraser:
> Hello,
> 
> 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.
> 
> 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).
> 
> 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).
> 
> 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.
> 
> 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.
> 
> So my questions are:
> 1. Why doesn't generic Tag::properties() work with "albumartist"?
> 2. How can I get at the specific Tag implementation being used?
> 
> 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.
> 
> Thanks!
> 
> -- 
> Bill Fraser { http://www.codewise.org/wrf }
> 
> 
> _______________________________________________
> taglib-devel mailing list
> taglib-devel at kde.org
> https://mail.kde.org/mailman/listinfo/taglib-devel
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/taglib-devel/attachments/20140929/a04756eb/attachment.sig>


More information about the taglib-devel mailing list