1 /***************************************************************************
2 copyright : (C) 2002 - 2008 by Scott Wheeler
3 email : wheeler@kde.org
4 ***************************************************************************/
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. *
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. *
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
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 ***************************************************************************/
26 #include "taglib_export.h"
28 #include "tbytevectorlist.h"
30 #ifndef TAGLIB_OGGFILE_H
31 #define TAGLIB_OGGFILE_H
35 //! A namespace for the classes used by Ogg-based metadata files
41 //! An implementation of TagLib::File with some helpers for Ogg based formats
44 * This is an implementation of Ogg file page and packet rendering and is of
45 * use to Ogg based formats. While the API is small this handles the
46 * non-trivial details of breaking up an Ogg stream into packets and makes
47 * these available (via subclassing) to the codec meta data implementations.
50 class TAGLIB_EXPORT File : public TagLib::File
56 * Returns the packet contents for the i-th packet (starting from zero)
57 * in the Ogg bitstream.
59 * \warning The requires reading at least the packet header for every page
60 * up to the requested page.
62 ByteVector packet(uint i);
65 * Sets the packet with index \a i to the value \a p.
67 void setPacket(uint i, const ByteVector &p);
70 * Returns a pointer to the PageHeader for the first page in the stream or
71 * null if the page could not be found.
73 const PageHeader *firstPageHeader();
76 * Returns a pointer to the PageHeader for the last page in the stream or
77 * null if the page could not be found.
79 const PageHeader *lastPageHeader();
85 * Contructs an Ogg file from \a file. If \a readProperties is true the
86 * file's audio properties will also be read using \a propertiesStyle. If
87 * false, \a propertiesStyle is ignored.
89 * \note This constructor is protected since Ogg::File shouldn't be
90 * instantiated directly but rather should be used through the codec
91 * specific subclasses.
97 File &operator=(const File &);
100 * Reads the next page and updates the internal "current page" pointer.
103 void writePageGroup(const List<int> &group);