tags..

Michael Helmling helmling at mathematik.uni-kl.de
Wed Aug 17 08:05:02 UTC 2011


Am 17.08.2011 04:23, schrieb Mathias Panzenböck:
> On 08/17/2011 03:12 AM, Kyle wrote:
>> they arent wrapped up because every format doesnt support them..
>>
>> if you wanted to transfer an image (i assume you mean album art) from
>> one format to the other.. just
>> extract the image from one and store it into the other
>>
>> here is how to extract the image from an mp3
>>
>> ID3v2::FrameList l = Tag->frameList("APIC");
>>
>> if(l.isEmpty())
>> return NULL;
>>
>> ID3v2::AttachedPictureFrame *f =
>> static_cast<ID3v2::AttachedPictureFrame *>(l.front());
>>
>> Size = f->picture().size();
>>
>> char* data = (char*)malloc(Size);
>> memcpy(data, f->picture().data(), Size);
>>
>> return data;
>>
>> you can get any of the non wrapped tags using the frameList.. most of
>> the other formats have
>> something similar
>>
>
> I think thats the problem. You have to write code for each format.
> Wouldn't it be possible to make a more generalized interface? Like a
> hashtable with standardized names. (If not then not. The values have to
> be something similar to QVariant.) If the format supports the tag, the
> hashtable has an appropriate entry. And for writing unsupported tags are
> just ignored.
>
> One could write such a thin on top of taglib, but without proper
> integration I don't know if it would play nice with custom file type
> resolvers.
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.

Michael
>
>> 2011/8/16 <sf_2000 at mail.ru <mailto:sf_2000 at mail.ru>>
>>
>> Здравствуйте, Kyle.
>>
>> It would be also perfect to have support of the tag 'chap' for mp4
>> files...
>>
>> Вы писали Monday, August 15, 2011, 4:34:01 PM:
>>
>> > You can get album artist and composer.. they just arent wrapped up
>> > in neat little ->AlbumArtist()/->Composer() functions
>>
>> --
>> С уважением,
>> Руслан Драгунов mailto:sf_2000 at mail.ru <mailto:sf_2000 at mail.ru>
>>
>> _______________________________________________
>> taglib-devel mailing list
>> taglib-devel at kde.org <mailto:taglib-devel at kde.org>
>> https://mail.kde.org/mailman/listinfo/taglib-devel
>>
>>
>>
>>
>> --
>> -Kyle
>>
>>
>> _______________________________________________
>> taglib-devel mailing list
>> taglib-devel at kde.org
>> https://mail.kde.org/mailman/listinfo/taglib-devel
>
> _______________________________________________
> taglib-devel mailing list
> taglib-devel at kde.org
> https://mail.kde.org/mailman/listinfo/taglib-devel



More information about the taglib-devel mailing list