]> granicus.if.org Git - taglib/commitdiff
Found and fixed more missing property interface forwarders.
authorMichael Helmling <helmling@mathematik.uni-kl.de>
Thu, 3 Jan 2013 22:20:15 +0000 (23:20 +0100)
committerMichael Helmling <helmling@mathematik.uni-kl.de>
Thu, 3 Jan 2013 22:20:15 +0000 (23:20 +0100)
Probably due to a copy-and-paste error the implementation of
File::removeUnsupportedProperties() contained cases for several type
which do not reimplement this method; for others the implementation was
missing and is now included.

In addition, the formats Speex and Opus suffered from the same bug as
OggFLAC in the commit before, which is now fixed.

13 files changed:
taglib/ogg/opus/opusfile.cpp
taglib/ogg/opus/opusfile.h
taglib/ogg/speex/speexfile.cpp
taglib/ogg/speex/speexfile.h
taglib/riff/aiff/aifffile.cpp
taglib/riff/aiff/aifffile.h
taglib/riff/wav/wavfile.cpp
taglib/riff/wav/wavfile.h
taglib/toolkit/tfile.cpp
taglib/trueaudio/trueaudiofile.cpp
taglib/trueaudio/trueaudiofile.h
taglib/wavpack/wavpackfile.cpp
taglib/wavpack/wavpackfile.h

index ecbc218d2e60c2e3ef27e9d210beb80d4ef59f9d..8d3af7afb7855f805eb990594abfeff24c0f093d 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <tstring.h>
 #include <tdebug.h>
+#include <tpropertymap.h>
 
 #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;
index 73375af8b0e89c36866814c12fa172531bc7e7ec..736235c60d18e47377fb18f01f66a186afe8d4cc 100644 (file)
@@ -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.
index 8ac86e690a5d4f4aed942ab51ade62f203eeae91..e83f0ad9bd6d6f5c467ddc4316ff2e89780e5cd9 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <tstring.h>
 #include <tdebug.h>
+#include <tpropertymap.h>
 
 #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;
index dfe51ec4d0b1da1bb93f74407e223ac2256812bc..2bbf8f408999e349a243f2beb3bd9798feb22559 100644 (file)
@@ -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:
index ece84f058044351824636553e51114430eaca8b6..19b80c8af4a7a7a575c2d0fa68d70f3f4fe2b8e4 100644 (file)
@@ -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);
index e1284db08dfb0e1dc39d284b0695cfd0fe71655f..f2ce0ba26b84f5065a6b9ae3c195822e0dc6826a 100644 (file)
@@ -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().
index 0ba40665415467670a32ba3e815e503c6ed98a76..43f2d8121eec862e4f5f30e2d2307cc66710d681 100644 (file)
@@ -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
index 18ce2336fa3a3fe1380f41928b544ab794a643b9..980f6e4dcdfe25ad4fd5ecd51cf3faacc4a00187 100644 (file)
@@ -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().
index 7251f3f703e8b78fe41ce28e4e69076f096b29fc..fdb5237f96cedfdb2c841e1ea7650dfcf0cd99dd 100644 (file)
@@ -172,26 +172,16 @@ void File::removeUnsupportedProperties(const StringList &properties)
     dynamic_cast<MPC::File* >(this)->removeUnsupportedProperties(properties);
   else if(dynamic_cast<MPEG::File* >(this))
     dynamic_cast<MPEG::File* >(this)->removeUnsupportedProperties(properties);
-  else if(dynamic_cast<Ogg::FLAC::File* >(this))
-    dynamic_cast<Ogg::FLAC::File* >(this)->removeUnsupportedProperties(properties);
-  else if(dynamic_cast<Ogg::Speex::File* >(this))
-    dynamic_cast<Ogg::Speex::File* >(this)->removeUnsupportedProperties(properties);
-  else if(dynamic_cast<Ogg::Opus::File* >(this))
-    dynamic_cast<Ogg::Opus::File* >(this)->removeUnsupportedProperties(properties);
   else if(dynamic_cast<Ogg::Vorbis::File* >(this))
     dynamic_cast<Ogg::Vorbis::File* >(this)->removeUnsupportedProperties(properties);
   else if(dynamic_cast<RIFF::AIFF::File* >(this))
     dynamic_cast<RIFF::AIFF::File* >(this)->removeUnsupportedProperties(properties);
   else if(dynamic_cast<RIFF::WAV::File* >(this))
     dynamic_cast<RIFF::WAV::File* >(this)->removeUnsupportedProperties(properties);
-  else if(dynamic_cast<S3M::File* >(this))
-    dynamic_cast<S3M::File* >(this)->removeUnsupportedProperties(properties);
   else if(dynamic_cast<TrueAudio::File* >(this))
     dynamic_cast<TrueAudio::File* >(this)->removeUnsupportedProperties(properties);
   else if(dynamic_cast<WavPack::File* >(this))
     dynamic_cast<WavPack::File* >(this)->removeUnsupportedProperties(properties);
-  else if(dynamic_cast<XM::File* >(this))
-    dynamic_cast<XM::File* >(this)->removeUnsupportedProperties(properties);
   else if(dynamic_cast<MP4::File* >(this))
     dynamic_cast<MP4::File* >(this)->removeUnsupportedProperties(properties);
   else if(dynamic_cast<ASF::File* >(this))
index 85e5a21b2b079f7f968027e72b550888e2652595..9bac29f0d8a5bc9f190ff12c1914b4de19891387 100644 (file)
@@ -139,6 +139,12 @@ PropertyMap TrueAudio::File::properties() const
   return PropertyMap();
 }
 
+void TrueAudio::File::removeUnsupportedProperties(const StringList &unsupported)
+{
+  if(d->hasID3v2)
+    d->tag.access<ID3v2::Tag>(TrueAudioID3v2Index, false)->removeUnsupportedProperties(unsupported);
+}
+
 PropertyMap TrueAudio::File::setProperties(const PropertyMap &properties)
 {
   if(d->hasID3v1)
index 1b8a93536820a52c79aa3d0a730568698a95fdc8..be31089ed114ffe433a890d536f21ca14773c140 100644 (file)
@@ -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.
index 78df182d17be7d7ca7490bc079af480e4e15b273..3754ea86d9383a74a78169c8ee1fcc9c2310b024 100644 (file)
@@ -117,6 +117,14 @@ PropertyMap WavPack::File::properties() const
   return PropertyMap();
 }
 
+
+void WavPack::File::removeUnsupportedProperties(const StringList &unsupported)
+{
+  if(d->hasAPE)
+    d->tag.access<APE::Tag>(WavAPEIndex, false)->removeUnsupportedProperties(unsupported);
+}
+
+
 PropertyMap WavPack::File::setProperties(const PropertyMap &properties)
 {
   if(d->hasID3v1)
index 918edca8eff2c36b07139368185ef0ccf63cff17..7d4fafeea4c42477503a7e2408caaa80264057e2 100644 (file)
@@ -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