Support "album artist" and "artist sort" in TagLib::Tag interface?

Jason Voegele jason at
Fri Jan 9 21:18:02 CET 2009

On Friday 09 January 2009 09:28:55 am Ralf Engels wrote:
> I would propose that TagLib::Tag implements a dummy function for this
> meta informations.
> Then we would be free to add more without further problems.
> And you could add your album artists.

I rather like the idea of a generic "catch all" function that could handle 
arbitrary tags.  This would allow for adding new tags without breaking the 
API.  Maybe something like the following set of functions, similar to what is 
already present in the XiphComment class?

void 	addField (const String &key, const String &value, bool replace=true);
void 	removeField (const String &key, const String &value=String::null);
bool 	contains (const String &key) const;

And possibly a "supports field" kind of function too?

bool supportsField(const String &key) const;

XiphComment and APE::Tag would, of course, always return true for any 
supportsField(...) call.

I think something like the above would allow for arbitrary extension of the 
set of tags supported by the abstract API, and would allow individual Tag 
implementations to decide how to handle the various tags.  For instance, ID3v2 
could map addField("ARTISTSORT") to the TSOP tag, etc.

Any other arguments for or against adding generic tag handling such as 
described above?

Jason Voegele
"Floggings will continue until morale improves."
		-- anonymous flyer being distributed at Exxon USA

More information about the taglib-devel mailing list