Update for pull request #89: Change how setProperties() updates tags.

For file types supporting more than one tag format, setProperties() now always creates the most modern one. Deprecated tags are stripped.
This commit is contained in:
Michael Helmling
2012-12-20 17:28:50 +01:00
parent 6e3391a846
commit b14e6a3570
13 changed files with 43 additions and 49 deletions

View File

@ -168,14 +168,11 @@ void FLAC::File::removeUnsupportedProperties(const StringList &unsupported)
PropertyMap FLAC::File::setProperties(const PropertyMap &properties)
{
PropertyMap result;
if(d->hasID3v1)
result = d->tag.access<ID3v1::Tag>(FlacID3v1Index, false)->setProperties(properties);
d->tag.access<ID3v1::Tag>(FlacID3v1Index, false)->setProperties(properties);
if(d->hasID3v2)
result = d->tag.access<ID3v2::Tag>(FlacID3v2Index, false)->setProperties(properties);
if(d->hasXiphComment || !(d->hasID3v1 || d->hasID3v2))
result = d->tag.access<Ogg::XiphComment>(FlacXiphIndex, true)->setProperties(properties);
return result;
d->tag.access<ID3v2::Tag>(FlacID3v2Index, false)->setProperties(properties);
return d->tag.access<Ogg::XiphComment>(FlacXiphIndex, true)->setProperties(properties);
}
FLAC::Properties *FLAC::File::audioProperties() const

View File

@ -133,8 +133,9 @@ namespace TagLib {
/*!
* Implements the unified property interface -- import function.
* As with the export, only one tag is taken into account. If the file
* has no tag at all, a XiphComment will be created.
* This always creates a Xiph comment, if none exists. The return value
* relates to the Xiph comment only.
* Potential ID3v1 and ID3v2 tags will also be updated.
*/
PropertyMap setProperties(const PropertyMap &);