[TagLib 2.0] Tag property interface.

Peter van Hardenberg pvh at songbirdnest.com
Wed Jun 4 02:50:09 CEST 2008


I agree a Tag property interface for the next 5 years should not look like the current one. Instead, I envision something like this (in the Tag namespace, of course):

/* An enumeration of all Property types TagLib understands. */
enum Property {
    Title,
    Genre,
    Artist,
    TrackNumber,
    ...
};

/*
 * set(Property, String)
 *
 * set the desired property to the provided value.
 * returns bool indicating success
 */
bool set(Property p, String value);

/*
 * void remove(Property)
 *
 * unset the desired property on the tag, removing all values for the property.
 */
void remove(Property p);

/*
 * String get(Property)
 * 
 * get the desired property.
 */
String get(Property p);

/*
 * bool supports(Property)
 * 
 * returns whether the Tag object has support for that property
 */
bool supports(Property p);

/*
 * list<Property> supported()
 *
 * return a list of all supported properties on the Tag
 */
list<Property> supported();

/*
 * list<Property> available()
 *
 * return a list of all existing values on the Tag
 */ 

Of course, this interface has two immediately obvious deficiencies. It does not have support for multiple values. Second, it only provides support for String values on the base Tag. Are these problems that should be fixed, and if so, how would you suggest changing the interface?

-pvh


More information about the taglib-devel mailing list