mirror of
https://github.com/taglib/taglib.git
synced 2025-07-20 14:04:21 -04:00
Implemented dict interface for more formats.
Now supported: MOD files (IT, MOD, S3M, XM), RIFF files (AIFF, WAV), TrueAudio, WavPack.
This commit is contained in:
@ -105,6 +105,25 @@ TagLib::Tag *WavPack::File::tag() const
|
||||
return &d->tag;
|
||||
}
|
||||
|
||||
TagLib::TagDict WavPack::File::toDict(void) const
|
||||
{
|
||||
if (d->hasAPE)
|
||||
return d->tag.access<APE::Tag>(APEIndex, false)->toDict();
|
||||
if (d->hasID3v1)
|
||||
return d->tag.access<ID3v1::Tag>(ID3v1Index, false)->toDict();
|
||||
return TagLib::TagDict();
|
||||
}
|
||||
|
||||
void WavPack::File::fromDict(const TagDict &dict)
|
||||
{
|
||||
if (d->hasAPE)
|
||||
d->tag.access<APE::Tag>(APEIndex, false)->fromDict(dict);
|
||||
else if (d->hasID3v1)
|
||||
d->tag.access<ID3v1::Tag>(ID3v1Index, false)->fromDict(dict);
|
||||
else
|
||||
d->tag.access<APE::Tag>(APE, true)->fromDict(dict);
|
||||
}
|
||||
|
||||
WavPack::Properties *WavPack::File::audioProperties() const
|
||||
{
|
||||
return d->properties;
|
||||
|
@ -106,6 +106,20 @@ namespace TagLib {
|
||||
*/
|
||||
virtual TagLib::Tag *tag() const;
|
||||
|
||||
/*!
|
||||
* Implements the unified tag dictionary interface -- export function.
|
||||
* If the file contains both an APE and an ID3v1 tag, only APE
|
||||
* will be converted to the TagDict.
|
||||
*/
|
||||
TagDict toDict() const;
|
||||
|
||||
/*!
|
||||
* Implements the unified tag dictionary interface -- import function.
|
||||
* As for the export, only one tag is taken into account. If the file
|
||||
* has no tag at all, APE will be created.
|
||||
*/
|
||||
void fromDict(const TagDict &);
|
||||
|
||||
/*!
|
||||
* Returns the MPC::Properties for this file. If no audio properties
|
||||
* were read then this will return a null pointer.
|
||||
|
Reference in New Issue
Block a user