Ported trueaudio.

This commit is contained in:
Michael Helmling 2012-02-14 21:32:36 +01:00
parent 48aaaf8dc4
commit 2185d52f56
2 changed files with 14 additions and 14 deletions

View File

@ -127,25 +127,25 @@ TagLib::Tag *TrueAudio::File::tag() const
return &d->tag;
}
TagLib::TagDict TrueAudio::File::toDict(void) const
PropertyMap TrueAudio::File::properties() const
{
// once Tag::toDict() is virtual, this case distinction could actually be done
// once Tag::properties() is virtual, this case distinction could actually be done
// within TagUnion.
if (d->hasID3v2)
return d->tag.access<ID3v2::Tag>(ID3v2Index, false)->toDict();
return d->tag.access<ID3v2::Tag>(ID3v2Index, false)->properties();
if (d->hasID3v1)
return d->tag.access<ID3v1::Tag>(ID3v1Index, false)->toDict();
return TagLib::TagDict();
return d->tag.access<ID3v1::Tag>(ID3v1Index, false)->properties();
return PropertyMap();
}
void TrueAudio::File::fromDict(const TagDict &dict)
PropertyMap TrueAudio::File::setProperties(const PropertyMap &properties)
{
if (d->hasID3v2)
d->tag.access<ID3v2::Tag>(ID3v2Index, false)->fromDict(dict);
return d->tag.access<ID3v2::Tag>(ID3v2Index, false)->setProperties(properties);
else if (d->hasID3v1)
d->tag.access<ID3v1::Tag>(ID3v1Index, false)->fromDict(dict);
return d->tag.access<ID3v1::Tag>(ID3v1Index, false)->setProperties(properties);
else
d->tag.access<ID3v2::Tag>(ID3v2Index, true)->fromDict(dict);
return d->tag.access<ID3v2::Tag>(ID3v2Index, true)->setProperties(properties);
}
TrueAudio::Properties *TrueAudio::File::audioProperties() const

View File

@ -125,18 +125,18 @@ namespace TagLib {
virtual TagLib::Tag *tag() const;
/*!
* Implements the unified tag dictionary interface -- export function.
* Implements the unified property interface -- export function.
* If the file contains both ID3v1 and v2 tags, only ID3v2 will be
* converted to the TagDict.
* converted to the PropertyMap.
*/
TagDict toDict() const;
PropertyMap properties() const;
/*!
* Implements the unified tag dictionary interface -- import function.
* 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, ID3v2 will be created.
*/
void fromDict(const TagDict &);
PropertyMap setProperties(const PropertyMap &);
/*!
* Returns the TrueAudio::Properties for this file. If no audio properties