Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

oggpage.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2003 by Scott Wheeler
00003     email                : wheeler@kde.org
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
00019  *   USA                                                                   *
00020  ***************************************************************************/
00021 
00022 #ifndef TAGLIB_OGGPAGE_H
00023 #define TAGLIB_OGGPAGE_H
00024 
00025 #include <tbytevectorlist.h>
00026 
00027 namespace TagLib {
00028 
00029   namespace Ogg {
00030 
00031     class File;
00032     class PageHeader;
00033 
00035 
00047     class Page
00048     {
00049     public:
00053       Page(File *file, long pageOffset);
00054 
00055       virtual ~Page();
00056 
00060       long fileOffset() const;
00061 
00066       const PageHeader *header() const;
00067 
00074       int firstPacketIndex() const;
00075 
00081       void setFirstPacketIndex(int index);
00082 
00089       enum ContainsPacketFlags {
00091         DoesNotContainPacket = 0x0000,
00093         CompletePacket       = 0x0001,
00095         BeginsWithPacket     = 0x0002,
00097         EndsWithPacket       = 0x0004
00098       };
00099 
00106       ContainsPacketFlags containsPacket(int index) const;
00107 
00111       uint packetCount() const;
00112 
00119       ByteVectorList packets() const;
00120 
00124       int size() const;
00125 
00126       ByteVector render() const;
00127 
00135       enum PaginationStrategy {
00142         SinglePagePerGroup,
00147         Repaginate
00148       };
00149 
00169       static List<Page *> paginate(const ByteVectorList &packets,
00170                                    PaginationStrategy strategy,
00171                                    uint streamSerialNumber,
00172                                    int firstPage,
00173                                    bool firstPacketContinued = false,
00174                                    bool lastPacketCompleted = true,
00175                                    bool containsLastPacket = false);
00176 
00177     protected:
00182       Page(const ByteVectorList &packets,
00183            uint streamSerialNumber,
00184            int pageNumber,
00185            bool firstPacketContinued = false,
00186            bool lastPacketCompleted = true,
00187            bool containsLastPacket = false);
00188 
00189     private:
00190       Page(const Page &);
00191       Page &operator=(const Page &);
00192 
00193       class PagePrivate;
00194       PagePrivate *d;
00195     };
00196   }
00197 }
00198 #endif

Generated on Mon Jun 7 12:51:47 2004 for TagLib by doxygen 1.3.4