oggpage.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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