change default overlapping note strategy to "relax" (i.e. do nothing); fix crash...
[ardour2.git] / libs / taglib / taglib / ogg / oggfile.h
blobe5535f6f3dd2f1f5d9204662002e1c4ea7023862
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. *
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
19 * 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 ***************************************************************************/
26 #include "taglib_export.h"
27 #include "tfile.h"
28 #include "tbytevectorlist.h"
30 #ifndef TAGLIB_OGGFILE_H
31 #define TAGLIB_OGGFILE_H
33 namespace TagLib {
35 //! A namespace for the classes used by Ogg-based metadata files
37 namespace Ogg {
39 class PageHeader;
41 //! An implementation of TagLib::File with some helpers for Ogg based formats
43 /*!
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
52 public:
53 virtual ~File();
55 /*!
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);
64 /*!
65 * Sets the packet with index \a i to the value \a p.
67 void setPacket(uint i, const ByteVector &p);
69 /*!
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();
75 /*!
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();
81 virtual bool save();
83 protected:
84 /*!
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.
93 File(FileName file);
95 private:
96 File(const File &);
97 File &operator=(const File &);
99 /*!
100 * Reads the next page and updates the internal "current page" pointer.
102 bool nextPage();
103 void writePageGroup(const List<int> &group);
105 class FilePrivate;
106 FilePrivate *d;
112 #endif