chapterframe.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2013 by Lukas Krejci
00003     email                : krejclu6@fel.cvut.cz
00004  ***************************************************************************/
00005 
00006 /***************************************************************************
00007  *   This library is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU Lesser General Public License version   *
00009  *   2.1 as published by the Free Software Foundation.                     *
00010  *                                                                         *
00011  *   This library is distributed in the hope that it will be useful, but   *
00012  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014  *   Lesser General Public License for more details.                       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with this library; if not, write to the Free Software   *
00018  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA         *
00019  *   02110-1301  USA                                                       *
00020  *                                                                         *
00021  *   Alternatively, this file is available under the Mozilla Public        *
00022  *   License Version 1.1.  You may obtain a copy of the License at         *
00023  *   http://www.mozilla.org/MPL/                                           *
00024  ***************************************************************************/
00025 
00026 #ifndef TAGLIB_CHAPTERFRAME
00027 #define TAGLIB_CHAPTERFRAME
00028 
00029 #include "id3v2tag.h"
00030 #include "id3v2frame.h"
00031 #include "taglib_export.h"
00032 
00033 namespace TagLib {
00034 
00035   namespace ID3v2 {
00036 
00042 
00043 
00044     class TAGLIB_EXPORT ChapterFrame : public ID3v2::Frame
00045     {
00046       friend class FrameFactory;
00047 
00048     public:
00053       ChapterFrame(const ID3v2::Header *tagHeader, const ByteVector &data);
00054 
00064       ChapterFrame(const ByteVector &elementID,
00065                    unsigned int startTime, unsigned int endTime,
00066                    unsigned int startOffset, unsigned int endOffset,
00067                    const FrameList &embeddedFrames = FrameList());
00068 
00072       virtual ~ChapterFrame();
00073 
00080       ByteVector elementID() const;
00081 
00087       unsigned int startTime() const;
00088 
00094       unsigned int endTime() const;
00095 
00103       unsigned int startOffset() const;
00104 
00112       unsigned int endOffset() const;
00113 
00120       void setElementID(const ByteVector &eID);
00121 
00127       void setStartTime(const unsigned int &sT);
00128 
00134       void setEndTime(const unsigned int &eT);
00135 
00142       void setStartOffset(const unsigned int &sO);
00143 
00150       void setEndOffset(const unsigned int &eO);
00151 
00166       const FrameListMap &embeddedFrameListMap() const;
00167 
00179       const FrameList &embeddedFrameList() const;
00180 
00192       const FrameList &embeddedFrameList(const ByteVector &frameID) const;
00193 
00201       void addEmbeddedFrame(Frame *frame);
00202 
00210       void removeEmbeddedFrame(Frame *frame, bool del = true);
00211 
00219       void removeEmbeddedFrames(const ByteVector &id);
00220 
00221       virtual String toString() const;
00222 
00223       PropertyMap asProperties() const;
00224 
00232       static ChapterFrame *findByElementID(const Tag *tag, const ByteVector &eID);
00233 
00234     protected:
00235       virtual void parseFields(const ByteVector &data);
00236       virtual ByteVector renderFields() const;
00237 
00238     private:
00239       ChapterFrame(const ID3v2::Header *tagHeader, const ByteVector &data, Header *h);
00240       ChapterFrame(const ChapterFrame &);
00241       ChapterFrame &operator=(const ChapterFrame &);
00242 
00243       class ChapterFramePrivate;
00244       ChapterFramePrivate *d;
00245     };
00246   }
00247 }
00248 
00249 #endif