oggpage.h
Go to the documentation of this file.
/***************************************************************************
copyright : (C) 2002 - 2008 by Scott Wheeler
email : wheeler@kde.org
***************************************************************************/
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 2.1 as published by the Free Software Foundation. *
* *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#ifndef TAGLIB_OGGPAGE_H
#define TAGLIB_OGGPAGE_H
#include "tbytevectorlist.h"
#include "taglib.h"
#include "taglib_export.h"
namespace TagLib {
namespace Ogg {
class File;
class PageHeader;
class TAGLIB_EXPORT Page
{
public:
Page(File *file, offset_t pageOffset);
~Page();
Page(const Page &) = delete;
Page &operator=(const Page &) = delete;
offset_t fileOffset() const;
const PageHeader *header() const;
int pageSequenceNumber() const;
void setPageSequenceNumber(int sequenceNumber);
int firstPacketIndex() const;
void setFirstPacketIndex(int index);
enum ContainsPacketFlags {
DoesNotContainPacket = 0x0000,
CompletePacket = 0x0001,
BeginsWithPacket = 0x0002,
EndsWithPacket = 0x0004
};
ContainsPacketFlags containsPacket(int index) const;
unsigned int packetCount() const;
ByteVectorList packets() const;
int size() const;
ByteVector render() const;
enum PaginationStrategy {
SinglePagePerGroup,
Repaginate
};
static List<Page *> paginate(const ByteVectorList &packets,
PaginationStrategy strategy,
unsigned int streamSerialNumber,
int firstPage,
bool firstPacketContinued = false,
bool lastPacketCompleted = true,
bool containsLastPacket = false);
protected:
Page(const ByteVectorList &packets,
unsigned int streamSerialNumber,
int pageNumber,
bool firstPacketContinued = false,
bool lastPacketCompleted = true,
bool containsLastPacket = false);
private:
class PagePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<PagePrivate> d;
};
} // namespace Ogg
} // namespace TagLib
#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:49
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::Page
Page(const Page &)=delete
TagLib::Ogg::Page::~Page
~Page()
TagLib::Ogg::Page::PaginationStrategy
PaginationStrategy
Definition oggpage.h:159
TagLib::Ogg::Page::SinglePagePerGroup
@ SinglePagePerGroup
Definition oggpage.h:166
TagLib::Ogg::Page::Repaginate
@ Repaginate
Definition oggpage.h:171
TagLib::Ogg::Page::operator=
Page & operator=(const Page &)=delete
TagLib::Ogg::Page::setPageSequenceNumber
void setPageSequenceNumber(int sequenceNumber)
TagLib::Ogg::Page::size
int size() const
TagLib::Ogg::Page::ContainsPacketFlags
ContainsPacketFlags
Definition oggpage.h:113
TagLib::Ogg::Page::DoesNotContainPacket
@ DoesNotContainPacket
No part of the packet is contained in the page.
Definition oggpage.h:115
TagLib::Ogg::Page::CompletePacket
@ CompletePacket
The packet is wholly contained in the page.
Definition oggpage.h:117
TagLib::Ogg::Page::BeginsWithPacket
@ BeginsWithPacket
The page starts with the given packet.
Definition oggpage.h:119
TagLib::Ogg::Page::EndsWithPacket
@ EndsWithPacket
The page ends with the given packet.
Definition oggpage.h:121
TagLib::Ogg::Page::setFirstPacketIndex
void setFirstPacketIndex(int index)
TagLib::Ogg::Page::Page
Page(File *file, offset_t pageOffset)
TagLib::Ogg::Page::containsPacket
ContainsPacketFlags containsPacket(int index) const
TagLib::Ogg::Page::header
const PageHeader * header() const
TagLib::Ogg::Page::fileOffset
offset_t 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::Ogg
A namespace for the classes used by Ogg-based metadata files.
Definition flacfile.h:41
TagLib
A namespace for all TagLib related classes and functions.
Definition apefile.h:41
TagLib::offset_t
off_t offset_t
Definition taglib.h:64
taglib.h
taglib_export.h
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition taglib_export.h:40
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition taglib_export.h:55
tbytevectorlist.h