From 80af92a715f0981b21051e4b10a164d415e3232c Mon Sep 17 00:00:00 2001 From: Michael Helmling Date: Thu, 3 Jan 2013 23:00:17 +0100 Subject: [PATCH] Add forwarders for the property interface to Ogg::FLAC::File. Fixes an infinite method resolution recursion in File::properties() and File::setProperties(). Thanks to Sebastian Rachuj for pointing out this bug. --- taglib/ogg/flac/oggflacfile.cpp | 11 +++++++++++ taglib/ogg/flac/oggflacfile.h | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/taglib/ogg/flac/oggflacfile.cpp b/taglib/ogg/flac/oggflacfile.cpp index b73c5f57..510c01f8 100644 --- a/taglib/ogg/flac/oggflacfile.cpp +++ b/taglib/ogg/flac/oggflacfile.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include "oggflacfile.h" @@ -94,6 +95,16 @@ Ogg::XiphComment *Ogg::FLAC::File::tag() const return d->comment; } +PropertyMap Ogg::FLAC::File::properties() const +{ + return d->comment->properties(); +} + +PropertyMap Ogg::FLAC::File::setProperties(const PropertyMap &properties) +{ + return d->comment->setProperties(properties); +} + Properties *Ogg::FLAC::File::audioProperties() const { return d->properties; diff --git a/taglib/ogg/flac/oggflacfile.h b/taglib/ogg/flac/oggflacfile.h index 8558cfdf..770884a7 100644 --- a/taglib/ogg/flac/oggflacfile.h +++ b/taglib/ogg/flac/oggflacfile.h @@ -92,12 +92,28 @@ namespace TagLib { */ virtual XiphComment *tag() const; + + /*! * Returns the FLAC::Properties for this file. If no audio properties * were read then this will return a null pointer. */ virtual Properties *audioProperties() 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 &); + + /*! * Save the file. This will primarily save and update the XiphComment. * Returns true if the save is successful.