diff --git a/mpeg/id3v2/id3v2tag.cpp b/mpeg/id3v2/id3v2tag.cpp index a3a0d60e..df0395ba 100644 --- a/mpeg/id3v2/id3v2tag.cpp +++ b/mpeg/id3v2/id3v2tag.cpp @@ -250,6 +250,11 @@ const FrameList &ID3v2::Tag::frameList() const return d->frameList; } +const FrameList &ID3v2::Tag::frameList(const ByteVector &frameID) +{ + return d->frameListMap[frameID]; +} + void ID3v2::Tag::addFrame(Frame *frame) { d->frameList.append(frame); diff --git a/mpeg/id3v2/id3v2tag.h b/mpeg/id3v2/id3v2tag.h index ea416174..bcc24130 100644 --- a/mpeg/id3v2/id3v2tag.h +++ b/mpeg/id3v2/id3v2tag.h @@ -199,6 +199,8 @@ namespace TagLib { * * \warning You should not modify this data structure directly, instead * use addFrame() and removeFrame(). + * + * \see frameList() */ const FrameListMap &frameListMap() const; @@ -214,6 +216,19 @@ namespace TagLib { */ const FrameList &frameList() const; + /*! + * Returns the frame list for frames with the id \a frameID or an empty + * list if there are no frames of that type. This is just a convenience + * and is equivalent to: + * + * \code + * frameListMap()[frameID]; + * \endcode + * + * \see frameListMap() + */ + const FrameList &frameList(const ByteVector &frameID); + /*! * Add a frame to the tag. At this point the tag takes ownership of * the frame and will handle freeing its memory.