Made im/export functions nonvirtual. Added similar functions to File and

its subclasses. TagLib::File contains a bunch of dynamic_casts to call
the correct specializations.
This commit is contained in:
Michael Helmling
2011-08-28 22:58:40 +02:00
parent fa8159a9d0
commit 5647b2e293
20 changed files with 297 additions and 9 deletions

View File

@ -92,6 +92,16 @@ Ogg::XiphComment *Ogg::FLAC::File::tag() const
return d->comment;
}
TagLib::TagDict Ogg::FLAC::File::toDict(void) const
{
return d->comment->toDict();
}
void Ogg::FLAC::File::fromDict(const TagDict &dict)
{
d->comment->fromDict(dict);
}
Properties *Ogg::FLAC::File::audioProperties() const
{
return d->properties;

View File

@ -89,6 +89,18 @@ namespace TagLib {
*/
virtual XiphComment *tag() const;
/*!
* Implements the unified tag dictionary interface -- export function.
* Returns the contents of the Ogg::XiphComment as TagDict.
*/
TagDict toDict() const;
/*!
* Implements the unified tag dictionary interface -- import function.
* Matches the TagDict's contents to the XiphComment of the file.
*/
void fromDict(const TagDict &);
/*!
* Returns the FLAC::Properties for this file. If no audio properties
* were read then this will return a null pointer.

View File

@ -82,6 +82,16 @@ Ogg::XiphComment *Speex::File::tag() const
return d->comment;
}
TagLib::TagDict Ogg::Speex::File::toDict(void) const
{
return d->comment->toDict();
}
void Ogg::Speex::File::fromDict(const TagDict &dict)
{
d->comment->fromDict(dict);
}
Speex::Properties *Speex::File::audioProperties() const
{
return d->properties;

View File

@ -82,6 +82,17 @@ namespace TagLib {
* TagLib::File::tag().
*/
virtual Ogg::XiphComment *tag() const;
/*!
* Implements the unified tag dictionary interface -- export function.
* Returns the contents of the Ogg::XiphComment as TagDict.
*/
TagDict toDict() const;
/*!
* Implements the unified tag dictionary interface -- import function.
* Matches the TagDict's contents to the XiphComment of the file.
*/
void fromDict(const TagDict &);
/*!
* Returns the Speex::Properties for this file. If no audio properties

View File

@ -85,6 +85,16 @@ Ogg::XiphComment *Vorbis::File::tag() const
return d->comment;
}
TagLib::TagDict Ogg::Vorbis::File::toDict(void) const
{
return d->comment->toDict();
}
void Ogg::Vorbis::File::fromDict(const TagDict &dict)
{
d->comment->fromDict(dict);
}
Vorbis::Properties *Vorbis::File::audioProperties() const
{
return d->properties;

View File

@ -90,6 +90,17 @@ namespace TagLib {
*/
virtual Ogg::XiphComment *tag() const;
/*!
* Implements the unified tag dictionary interface -- export function.
* Returns the contents of the Ogg::XiphComment as TagDict.
*/
TagDict toDict() const;
/*!
* Implements the unified tag dictionary interface -- import function.
* Matches the TagDict's contents to the XiphComment of the file.
*/
void fromDict(const TagDict &);
/*!
* Returns the Vorbis::Properties for this file. If no audio properties
* were read then this will return a null pointer.

View File

@ -147,13 +147,13 @@ namespace TagLib {
* comment is nothing more than a map from tag names to list of values,
* as is the dict interface).
*/
virtual TagDict toDict() const;
TagDict toDict() const;
/*!
* Implements the unified tag dictionary interface -- import function.
* The tags from the given dict will be stored one-to-one in the file.
*/
virtual void fromDict(const TagDict &);
void fromDict(const TagDict &);
/*!
* Returns the vendor ID of the Ogg Vorbis encoder. libvorbis 1.0 as the