tags..

Michael Helmling helmling at mathematik.uni-kl.de
Sat Aug 27 21:03:25 UTC 2011


Am 17.08.2011 10:51, schrieb Lukáš Lalinský:
> On Wed, Aug 17, 2011 at 10:05 AM, Michael Helmling
> <helmling at mathematik.uni-kl.de>  wrote:
>> In case you are interested, I am working on a taglib wrapper which I call
>> 'UTagLib' (U for unified) which realizes exactly that:
>> https://github.com/supermihi/UTagLib
>>
>> It aims to provide a general tag interface via a map string ->  list of
>> strings (to support multiple values for the same tag, as most formats do).
>> The approach is inspired by the python library 'mutagen' which does things
>> similarly.
>> Background routines try their best to realize this unified approach in
>> various formats. FLAC and Ogg are simple since they handle tags in this way,
>> ID3 support is a bit more involved because tag names not specified are
>> mapped to TXXX frames etc.
>> The wrapper is in a very early stage and not well tested yet, however it
>> seems to work for FLAC, Ogg and MP3 which are the only formats I use.
> I had a similar idea, but the implementation was a little different.
> There would be an generic tag container (string->stringlist) that
> would be completely independent of the file format. Every file format
> implementation would then have two functions to import and export the
> internal tags into the generic container. For now these functions
> would be non-virtual and you would have to dynamic_cast the pointers
> to get the right functionality, but in TagLib 2 we would simply make
> them virtual and everything would just work.
>
> What do you think about this approach? Would you be interested to work
> on this as part of TagLib, not a separate library?
>
> Lukas
Hi Lukas,

I have created a taglib fork on github 
(https://github.com/supermihi/taglib) implementing this idea. The 
TagLib::Tag class is augmented by two virtual functions
virtual TagDict toDict() const
and
virtual void fromdict(const TagDict &)
where TagDict is a typedef for Map<String, StringList>. I guess your 
remark about not using virtual functions at the moment has something to 
do with binary compatibility or so? The implementation with virtual 
functions is of coures easier; in particular it allowed me to write 
python3 bindings using Cython (they are also on github) with no more 
than 150 lines of code. I found this very exciting since the lack of a 
generic tagging library for python3 is the reason for my interest in 
this topic. :-)
The fork contains a generic translation for the tags specified in the 
Tag base class and specialized import/export functions for ID3v2, 
XiphComment and APE.
I'd be happy to hear your opinion how my implementation fits to your 
idea described above!

Michael


More information about the taglib-devel mailing list