| TagLib 1.13 |  |

oggpage.h
Go to the documentation of this file.
1/***************************************************************************
2 copyright : (C) 2002 - 2008 by Scott Wheeler
3 email : wheeler@kde.org
4 ***************************************************************************/
5
6/***************************************************************************
7 * This library is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU Lesser General Public License version *
9 * 2.1 as published by the Free Software Foundation. *
10 * *
11 * This library is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14 * Lesser General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with this library; if not, write to the Free Software *
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
19 * 02110-1301 USA *
20 * *
21 * Alternatively, this file is available under the Mozilla Public *
22 * License Version 1.1. You may obtain a copy of the License at *
23 * http://www.mozilla.org/MPL/ *
24 ***************************************************************************/
25
26#ifndef TAGLIB_OGGPAGE_H
27#define TAGLIB_OGGPAGE_H
28
29#include "taglib_export.h"
30#include "tbytevectorlist.h"
31
32 namespace TagLib {
33
34 namespace Ogg {
35
36 class File;
37 class PageHeader;
38
40
52 class TAGLIB_EXPORT Page
53 {
54 public:
58 Page(File *file, long pageOffset);
59
60 virtual ~Page();
61
65 long fileOffset() const;
66
71 const PageHeader *header() const;
72
79 int pageSequenceNumber() const;
80
86 void setPageSequenceNumber(int sequenceNumber);
87
96 TAGLIB_DEPRECATED Page *getCopyWithNewPageSequenceNumber(int sequenceNumber);
97
104 int firstPacketIndex() const;
105
111 void setFirstPacketIndex(int index);
112
119 enum ContainsPacketFlags {
121 DoesNotContainPacket = 0x0000,
123 CompletePacket = 0x0001,
125 BeginsWithPacket = 0x0002,
127 EndsWithPacket = 0x0004
128 };
129
136 ContainsPacketFlags containsPacket(int index) const;
137
141 unsigned int packetCount() const;
142
149 ByteVectorList packets() const;
150
154 int size() const;
155
156 ByteVector render() const;
157
165 enum PaginationStrategy {
172 SinglePagePerGroup,
177 Repaginate
178 };
179
199 static List<Page *> paginate(const ByteVectorList &packets,
200 PaginationStrategy strategy,
201 unsigned int streamSerialNumber,
202 int firstPage,
203 bool firstPacketContinued = false,
204 bool lastPacketCompleted = true,
205 bool containsLastPacket = false);
206
207 protected:
212 Page(const ByteVectorList &packets,
213 unsigned int streamSerialNumber,
214 int pageNumber,
215 bool firstPacketContinued = false,
216 bool lastPacketCompleted = true,
217 bool containsLastPacket = false);
218
219 private:
220 Page(const Page &);
221 Page &operator=(const Page &);
222
223 class PagePrivate;
224 PagePrivate *d;
225 };
226 }
227}
228#endif
TagLib::ByteVectorList
A list of ByteVectors.
Definition: tbytevectorlist.h:42
TagLib::ByteVector
A byte vector.
Definition: tbytevector.h:46
TagLib::List
A generic, implicitly shared list.
Definition: tlist.h:54
TagLib::Ogg::File
An implementation of TagLib::File with some helpers for Ogg based formats.
Definition: oggfile.h:51
TagLib::Ogg::PageHeader
An implementation of the page headers associated with each Ogg::Page.
Definition: oggpageheader.h:48
TagLib::Ogg::Page
An implementation of Ogg pages.
Definition: oggpage.h:53
TagLib::Ogg::Page::pageSequenceNumber
int pageSequenceNumber() const
TagLib::Ogg::Page::render
ByteVector render() const
TagLib::Ogg::Page::packets
ByteVectorList packets() const
TagLib::Ogg::Page::paginate
static List< Page * > paginate(const ByteVectorList &packets, PaginationStrategy strategy, unsigned int streamSerialNumber, int firstPage, bool firstPacketContinued=false, bool lastPacketCompleted=true, bool containsLastPacket=false)
TagLib::Ogg::Page::PaginationStrategy
PaginationStrategy
Definition: oggpage.h:165
TagLib::Ogg::Page::SinglePagePerGroup
@ SinglePagePerGroup
Definition: oggpage.h:172
TagLib::Ogg::Page::setPageSequenceNumber
void setPageSequenceNumber(int sequenceNumber)
TagLib::Ogg::Page::size
int size() const
TagLib::Ogg::Page::Page
Page(File *file, long pageOffset)
TagLib::Ogg::Page::ContainsPacketFlags
ContainsPacketFlags
Definition: oggpage.h:119
TagLib::Ogg::Page::setFirstPacketIndex
void setFirstPacketIndex(int index)
TagLib::Ogg::Page::containsPacket
ContainsPacketFlags containsPacket(int index) const
TagLib::Ogg::Page::~Page
virtual ~Page()
TagLib::Ogg::Page::getCopyWithNewPageSequenceNumber
TAGLIB_DEPRECATED Page * getCopyWithNewPageSequenceNumber(int sequenceNumber)
TagLib::Ogg::Page::header
const PageHeader * header() const
TagLib::Ogg::Page::fileOffset
long fileOffset() const
TagLib::Ogg::Page::firstPacketIndex
int firstPacketIndex() const
TagLib::Ogg::Page::Page
Page(const ByteVectorList &packets, unsigned int streamSerialNumber, int pageNumber, bool firstPacketContinued=false, bool lastPacketCompleted=true, bool containsLastPacket=false)
TagLib::Ogg::Page::packetCount
unsigned int packetCount() const
TagLib
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
TAGLIB_DEPRECATED
#define TAGLIB_DEPRECATED
Definition: taglib.h:54
taglib_export.h
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
tbytevectorlist.h