diff --git a/taglib/ogg/opus/opusfile.cpp b/taglib/ogg/opus/opusfile.cpp index ecbc218d..8d3af7af 100644 --- a/taglib/ogg/opus/opusfile.cpp +++ b/taglib/ogg/opus/opusfile.cpp @@ -31,6 +31,7 @@ #include #include +#include #include "opusfile.h" @@ -82,6 +83,16 @@ Ogg::XiphComment *Opus::File::tag() const return d->comment; } +PropertyMap Opus::File::properties() const +{ + return d->comment->properties(); +} + +PropertyMap Opus::File::setProperties(const PropertyMap &properties) +{ + return d->comment->setProperties(properties); +} + Opus::Properties *Opus::File::audioProperties() const { return d->properties; diff --git a/taglib/ogg/opus/opusfile.h b/taglib/ogg/opus/opusfile.h index 73375af8..736235c6 100644 --- a/taglib/ogg/opus/opusfile.h +++ b/taglib/ogg/opus/opusfile.h @@ -86,6 +86,18 @@ namespace TagLib { */ virtual Ogg::XiphComment *tag() const; + /*! + * Implements the unified property interface -- export function. + * This forwards directly to XiphComment::properties(). + */ + PropertyMap properties() const; + + /*! + * Implements the unified tag dictionary interface -- import function. + * Like properties(), this is a forwarder to the file's XiphComment. + */ + PropertyMap setProperties(const PropertyMap &); + /*! * Returns the Opus::Properties for this file. If no audio properties * were read then this will return a null pointer. diff --git a/taglib/ogg/speex/speexfile.cpp b/taglib/ogg/speex/speexfile.cpp index 8ac86e69..e83f0ad9 100644 --- a/taglib/ogg/speex/speexfile.cpp +++ b/taglib/ogg/speex/speexfile.cpp @@ -31,6 +31,7 @@ #include #include +#include #include "speexfile.h" @@ -84,6 +85,16 @@ Ogg::XiphComment *Speex::File::tag() const return d->comment; } +PropertyMap Speex::File::properties() const +{ + return d->comment->properties(); +} + +PropertyMap Speex::File::setProperties(const PropertyMap &properties) +{ + return d->comment->setProperties(properties); +} + Speex::Properties *Speex::File::audioProperties() const { return d->properties; diff --git a/taglib/ogg/speex/speexfile.h b/taglib/ogg/speex/speexfile.h index dfe51ec4..2bbf8f40 100644 --- a/taglib/ogg/speex/speexfile.h +++ b/taglib/ogg/speex/speexfile.h @@ -86,12 +86,26 @@ namespace TagLib { */ virtual Ogg::XiphComment *tag() const; + /*! + * Implements the unified property interface -- export function. + * This forwards directly to XiphComment::properties(). + */ + PropertyMap properties() const; + + /*! + * Implements the unified tag dictionary interface -- import function. + * Like properties(), this is a forwarder to the file's XiphComment. + */ + PropertyMap setProperties(const PropertyMap &); + /*! * Returns the Speex::Properties for this file. If no audio properties * were read then this will return a null pointer. */ virtual Properties *audioProperties() const; + + virtual bool save(); private: diff --git a/taglib/riff/aiff/aifffile.cpp b/taglib/riff/aiff/aifffile.cpp index ece84f05..19b80c8a 100644 --- a/taglib/riff/aiff/aifffile.cpp +++ b/taglib/riff/aiff/aifffile.cpp @@ -90,6 +90,11 @@ PropertyMap RIFF::AIFF::File::properties() const return d->tag->properties(); } +void RIFF::AIFF::File::removeUnsupportedProperties(const StringList &unsupported) +{ + d->tag->removeUnsupportedProperties(unsupported); +} + PropertyMap RIFF::AIFF::File::setProperties(const PropertyMap &properties) { return d->tag->setProperties(properties); diff --git a/taglib/riff/aiff/aifffile.h b/taglib/riff/aiff/aifffile.h index e1284db0..f2ce0ba2 100644 --- a/taglib/riff/aiff/aifffile.h +++ b/taglib/riff/aiff/aifffile.h @@ -92,6 +92,8 @@ namespace TagLib { */ PropertyMap properties() const; + void removeUnsupportedProperties(const StringList &properties); + /*! * Implements the unified property interface -- import function. * This method forwards to ID3v2::Tag::setProperties(). diff --git a/taglib/riff/wav/wavfile.cpp b/taglib/riff/wav/wavfile.cpp index 0ba40665..43f2d812 100644 --- a/taglib/riff/wav/wavfile.cpp +++ b/taglib/riff/wav/wavfile.cpp @@ -103,12 +103,17 @@ RIFF::Info::Tag *RIFF::WAV::File::InfoTag() const PropertyMap RIFF::WAV::File::properties() const { - return d->tag.properties(); + return tag()->properties(); +} + +void RIFF::WAV::File::removeUnsupportedProperties(const StringList &unsupported) +{ + tag()->removeUnsupportedProperties(unsupported); } PropertyMap RIFF::WAV::File::setProperties(const PropertyMap &properties) { - return d->tag.setProperties(properties); + return tag()->setProperties(properties); } RIFF::WAV::Properties *RIFF::WAV::File::audioProperties() const diff --git a/taglib/riff/wav/wavfile.h b/taglib/riff/wav/wavfile.h index 18ce2336..980f6e4d 100644 --- a/taglib/riff/wav/wavfile.h +++ b/taglib/riff/wav/wavfile.h @@ -117,6 +117,8 @@ namespace TagLib { */ PropertyMap properties() const; + void removeUnsupportedProperties(const StringList &properties); + /*! * Implements the unified property interface -- import function. * This method forwards to ID3v2::Tag::setProperties(). diff --git a/taglib/toolkit/tfile.cpp b/taglib/toolkit/tfile.cpp index 7251f3f7..fdb5237f 100644 --- a/taglib/toolkit/tfile.cpp +++ b/taglib/toolkit/tfile.cpp @@ -172,26 +172,16 @@ void File::removeUnsupportedProperties(const StringList &properties) dynamic_cast(this)->removeUnsupportedProperties(properties); else if(dynamic_cast(this)) dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); else if(dynamic_cast(this)) dynamic_cast(this)->removeUnsupportedProperties(properties); else if(dynamic_cast(this)) dynamic_cast(this)->removeUnsupportedProperties(properties); else if(dynamic_cast(this)) dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); else if(dynamic_cast(this)) dynamic_cast(this)->removeUnsupportedProperties(properties); else if(dynamic_cast(this)) dynamic_cast(this)->removeUnsupportedProperties(properties); - else if(dynamic_cast(this)) - dynamic_cast(this)->removeUnsupportedProperties(properties); else if(dynamic_cast(this)) dynamic_cast(this)->removeUnsupportedProperties(properties); else if(dynamic_cast(this)) diff --git a/taglib/trueaudio/trueaudiofile.cpp b/taglib/trueaudio/trueaudiofile.cpp index 85e5a21b..9bac29f0 100644 --- a/taglib/trueaudio/trueaudiofile.cpp +++ b/taglib/trueaudio/trueaudiofile.cpp @@ -139,6 +139,12 @@ PropertyMap TrueAudio::File::properties() const return PropertyMap(); } +void TrueAudio::File::removeUnsupportedProperties(const StringList &unsupported) +{ + if(d->hasID3v2) + d->tag.access(TrueAudioID3v2Index, false)->removeUnsupportedProperties(unsupported); +} + PropertyMap TrueAudio::File::setProperties(const PropertyMap &properties) { if(d->hasID3v1) diff --git a/taglib/trueaudio/trueaudiofile.h b/taglib/trueaudio/trueaudiofile.h index 1b8a9353..be31089e 100644 --- a/taglib/trueaudio/trueaudiofile.h +++ b/taglib/trueaudio/trueaudiofile.h @@ -144,6 +144,8 @@ namespace TagLib { */ PropertyMap setProperties(const PropertyMap &); + void removeUnsupportedProperties(const StringList &properties); + /*! * Returns the TrueAudio::Properties for this file. If no audio properties * were read then this will return a null pointer. diff --git a/taglib/wavpack/wavpackfile.cpp b/taglib/wavpack/wavpackfile.cpp index 78df182d..3754ea86 100644 --- a/taglib/wavpack/wavpackfile.cpp +++ b/taglib/wavpack/wavpackfile.cpp @@ -117,6 +117,14 @@ PropertyMap WavPack::File::properties() const return PropertyMap(); } + +void WavPack::File::removeUnsupportedProperties(const StringList &unsupported) +{ + if(d->hasAPE) + d->tag.access(WavAPEIndex, false)->removeUnsupportedProperties(unsupported); +} + + PropertyMap WavPack::File::setProperties(const PropertyMap &properties) { if(d->hasID3v1) diff --git a/taglib/wavpack/wavpackfile.h b/taglib/wavpack/wavpackfile.h index 918edca8..7d4fafee 100644 --- a/taglib/wavpack/wavpackfile.h +++ b/taglib/wavpack/wavpackfile.h @@ -116,6 +116,8 @@ namespace TagLib { */ PropertyMap properties() const; + void removeUnsupportedProperties(const StringList &properties); + /*! * Implements the unified property interface -- import function. * Creates an APE tag if it does not exists and calls setProperties() on