TagLib  2.0.2
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 "tbytevectorlist.h"
30 #include "taglib.h"
31 #include "taglib_export.h"
32 
33 namespace TagLib {
34 
35  namespace Ogg {
36 
37  class File;
38  class PageHeader;
39 
41 
54  {
55  public:
59  Page(File *file, offset_t pageOffset);
60 
61  ~Page();
62 
63  Page(const Page &) = delete;
64  Page &operator=(const Page &) = delete;
65 
69  offset_t fileOffset() const;
70 
75  const PageHeader *header() const;
76 
83  int pageSequenceNumber() const;
84 
90  void setPageSequenceNumber(int sequenceNumber);
91 
98  int firstPacketIndex() const;
99 
105  void setFirstPacketIndex(int index);
106 
115  DoesNotContainPacket = 0x0000,
117  CompletePacket = 0x0001,
119  BeginsWithPacket = 0x0002,
121  EndsWithPacket = 0x0004
122  };
123 
130  ContainsPacketFlags containsPacket(int index) const;
131 
135  unsigned int packetCount() const;
136 
143  ByteVectorList packets() const;
144 
148  int size() const;
149 
150  ByteVector render() const;
151 
171  Repaginate
172  };
173 
193  static List<Page *> paginate(const ByteVectorList &packets,
194  PaginationStrategy strategy,
195  unsigned int streamSerialNumber,
196  int firstPage,
197  bool firstPacketContinued = false,
198  bool lastPacketCompleted = true,
199  bool containsLastPacket = false);
200 
201  protected:
206  Page(const ByteVectorList &packets,
207  unsigned int streamSerialNumber,
208  int pageNumber,
209  bool firstPacketContinued = false,
210  bool lastPacketCompleted = true,
211  bool containsLastPacket = false);
212 
213  private:
214  class PagePrivate;
216  std::unique_ptr<PagePrivate> d;
217  };
218  } // namespace Ogg
219 } // namespace TagLib
220 #endif
A list of ByteVectors.
Definition: tbytevectorlist.h:41
A generic, implicitly shared list.
Definition: tlist.h:53
Definition: oggpage.h:166
A byte vector.
Definition: tbytevector.h:45
ContainsPacketFlags
Definition: oggpage.h:113
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55
PaginationStrategy
Definition: oggpage.h:159
#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:53
off_t offset_t
Definition: taglib.h:64
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
An implementation of the page headers associated with each Ogg::Page.
Definition: oggpageheader.h:48