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 
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  Page* getCopyWithNewPageSequenceNumber(int sequenceNumber);
97 
104  int firstPacketIndex() const;
105 
111  void setFirstPacketIndex(int index);
112 
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 
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
A list of ByteVectors.
Definition: tbytevectorlist.h:41
A generic, implicitly shared list.
Definition: tlist.h:53
Definition: oggpage.h:172
A byte vector.
Definition: tbytevector.h:45
ContainsPacketFlags
Definition: oggpage.h:119
PaginationStrategy
Definition: oggpage.h:165
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
An implementation of TagLib::File with some helpers for Ogg based formats.
Definition: oggfile.h:50
An implementation of Ogg pages.
Definition: oggpage.h:52
An implementation of the page headers associated with each Ogg::Page.
Definition: oggpageheader.h:47