Ogg kfile-plugin should respect the hints
Ismael Orenstein
ismore at ieg.com.br
Tue Dec 31 13:20:16 GMT 2002
Hey there!
I'm currently writing yet another "program that renames all of your music
based on your id3 tags/ogg comments", but I'm using KDE classes to do so...
so I use KFileMetaInfo and the kfile plugins to retrieve the information of
each file.
As each plugins can define different key/value pairs, there is a "hint"
mechanism, so that you can request for the "Author" of a file and the plugin
will return the key that is associated with him. It may be "Artist", like in
a mp3 or ogg file, but nothing forbids another name, as long as the plugin
writer points the "Author" hint to this key.
The problem is that the ogg kfile-plugin doesn't use all of this hints. At
least it doesn't use the Author and Name ones. I know that the Ogg format
gives enough freedom so that any key can be used (instead of mp3 id3, which
has a fixed field for the artist and name). However, some keys are
standardized by the vorbis spec... shouldn't the hint point to these keys at
least?
The problem with the current situation is that if I want to get the title of a
music I must use info.item("Title") and pray that all kfile plugins adhere to
this standard. Instead, I should be using info.item(KFileMimeTypeInfo::Name)
and I know it will return the correct info all the time.
It is just a matter of adding, near line 78 of kfile_ogg.cpp, something like
that:
item = addItemInfo(group, "Artist", i18n("Artist"), QVariant::String);
setHint(item, KFileMimeTypeInfo::Author);
item = addItemInfo(group, "Title", i18n("Title"), QVariant::String);
setHint(item, KFileMimeTypeInfo::Name);
Best regards,
--
Ismael Orenstein (UIN 1293061)
ismore at ieg.com.br
http://ksnes9x.sourceforge.net
http://ggz.sourceforge.net
More information about the kde-multimedia
mailing list