From 56382e8cd437d5f893a074948e1fed1fa1f6d978 Mon Sep 17 00:00:00 2001 From: Urs Fleisch Date: Fri, 24 Nov 2023 07:49:14 +0100 Subject: [PATCH] Return tag union for tag() of WAV file --- taglib/riff/wav/wavfile.cpp | 4 ++-- taglib/riff/wav/wavfile.h | 8 +++----- tests/test_id3v2framefactory.cpp | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/taglib/riff/wav/wavfile.cpp b/taglib/riff/wav/wavfile.cpp index 570fbd94..f582fcbd 100644 --- a/taglib/riff/wav/wavfile.cpp +++ b/taglib/riff/wav/wavfile.cpp @@ -93,9 +93,9 @@ RIFF::WAV::File::File(IOStream *stream, bool readProperties, Properties::ReadSty RIFF::WAV::File::~File() = default; -ID3v2::Tag *RIFF::WAV::File::tag() const +TagLib::Tag *RIFF::WAV::File::tag() const { - return ID3v2Tag(); + return &d->tag; } ID3v2::Tag *RIFF::WAV::File::ID3v2Tag() const diff --git a/taglib/riff/wav/wavfile.h b/taglib/riff/wav/wavfile.h index fbb65f41..f4a2dcb8 100644 --- a/taglib/riff/wav/wavfile.h +++ b/taglib/riff/wav/wavfile.h @@ -107,12 +107,10 @@ namespace TagLib { File &operator=(const File &) = delete; /*! - * Returns the ID3v2 Tag for this file. - * - * \note This method does not return all the tags for this file for - * backward compatibility. Will be fixed in TagLib 2.0. + * Returns the tag for this file. This will be an RIFF INFO tag, an + * ID3v2 tag or a combination of the two. */ - ID3v2::Tag *tag() const override; + TagLib::Tag *tag() const override; /*! * Returns the ID3v2 Tag for this file. diff --git a/tests/test_id3v2framefactory.cpp b/tests/test_id3v2framefactory.cpp index bdc4cfcb..b3e98547 100644 --- a/tests/test_id3v2framefactory.cpp +++ b/tests/test_id3v2framefactory.cpp @@ -290,7 +290,7 @@ public: return static_cast(f).hasID3v2Tag(); }, [](File &f) { - return static_cast(f).tag(); + return static_cast(f).ID3v2Tag(); }, [](File &f) { static_cast(f).strip();