mirror of
https://github.com/taglib/taglib.git
synced 2025-07-21 06:24:19 -04:00
Merge branch 'master' of https://github.com/supermihi/taglib
This commit is contained in:
@ -31,6 +31,8 @@
|
||||
#include <tstring.h>
|
||||
#include <tdebug.h>
|
||||
#include <tagunion.h>
|
||||
#include <tstringlist.h>
|
||||
#include <tpropertymap.h>
|
||||
|
||||
#include "trueaudiofile.h"
|
||||
#include "id3v1tag.h"
|
||||
@ -126,6 +128,27 @@ TagLib::Tag *TrueAudio::File::tag() const
|
||||
return &d->tag;
|
||||
}
|
||||
|
||||
PropertyMap TrueAudio::File::properties() const
|
||||
{
|
||||
// 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)->properties();
|
||||
if(d->hasID3v1)
|
||||
return d->tag.access<ID3v1::Tag>(ID3v1Index, false)->properties();
|
||||
return PropertyMap();
|
||||
}
|
||||
|
||||
PropertyMap TrueAudio::File::setProperties(const PropertyMap &properties)
|
||||
{
|
||||
if(d->hasID3v2)
|
||||
return d->tag.access<ID3v2::Tag>(ID3v2Index, false)->setProperties(properties);
|
||||
else if(d->hasID3v1)
|
||||
return d->tag.access<ID3v1::Tag>(ID3v1Index, false)->setProperties(properties);
|
||||
else
|
||||
return d->tag.access<ID3v2::Tag>(ID3v2Index, true)->setProperties(properties);
|
||||
}
|
||||
|
||||
TrueAudio::Properties *TrueAudio::File::audioProperties() const
|
||||
{
|
||||
return d->properties;
|
||||
|
@ -124,6 +124,20 @@ namespace TagLib {
|
||||
*/
|
||||
virtual TagLib::Tag *tag() const;
|
||||
|
||||
/*!
|
||||
* Implements the unified property interface -- export function.
|
||||
* If the file contains both ID3v1 and v2 tags, only ID3v2 will be
|
||||
* converted to the PropertyMap.
|
||||
*/
|
||||
PropertyMap properties() const;
|
||||
|
||||
/*!
|
||||
* 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.
|
||||
*/
|
||||
PropertyMap setProperties(const PropertyMap &);
|
||||
|
||||
/*!
|
||||
* Returns the TrueAudio::Properties for this file. If no audio properties
|
||||
* were read then this will return a null pointer.
|
||||
|
Reference in New Issue
Block a user