Added TagLib (with AUTORS and COPYING files)
[someplayer] / src / taglib / ogg / vorbis / vorbisfile.h
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., 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  ***************************************************************************/
25
26 #ifndef TAGLIB_VORBISFILE_H
27 #define TAGLIB_VORBISFILE_H
28
29 #include "taglib_export.h"
30 #include "oggfile.h"
31 #include "xiphcomment.h"
32
33 #include "vorbisproperties.h"
34
35 namespace TagLib {
36
37 /*
38  * This is just to make this appear to be in the Ogg namespace in the
39  * documentation.  The typedef below will make this work with the current code.
40  * In the next BIC version of TagLib this will be really moved into the Ogg
41  * namespace.
42  */
43
44 #ifdef DOXYGEN
45   namespace Ogg {
46 #endif
47
48   //! A namespace containing classes for Vorbis metadata
49
50   namespace Vorbis {
51
52
53     //! An implementation of Ogg::File with Vorbis specific methods
54
55     /*!
56      * This is the central class in the Ogg Vorbis metadata processing collection
57      * of classes.  It's built upon Ogg::File which handles processing of the Ogg
58      * logical bitstream and breaking it down into pages which are handled by
59      * the codec implementations, in this case Vorbis specifically.
60      */
61
62     class TAGLIB_EXPORT File : public Ogg::File
63     {
64     public:
65       /*!
66        * Contructs a Vorbis file from \a file.  If \a readProperties is true the
67        * file's audio properties will also be read using \a propertiesStyle.  If
68        * false, \a propertiesStyle is ignored.
69        */
70       File(FileName file, bool readProperties = true,
71            Properties::ReadStyle propertiesStyle = Properties::Average);
72
73       /*!
74        * Destroys this instance of the File.
75        */
76       virtual ~File();
77
78       /*!
79        * Returns the XiphComment for this file.  XiphComment implements the tag
80        * interface, so this serves as the reimplementation of
81        * TagLib::File::tag().
82        */
83       virtual Ogg::XiphComment *tag() const;
84
85       /*!
86        * Returns the Vorbis::Properties for this file.  If no audio properties
87        * were read then this will return a null pointer.
88        */
89       virtual Properties *audioProperties() const;
90
91       virtual bool save();
92
93     private:
94       File(const File &);
95       File &operator=(const File &);
96
97       void read(bool readProperties, Properties::ReadStyle propertiesStyle);
98
99       class FilePrivate;
100       FilePrivate *d;
101     };
102   }
103
104 /*
105  * To keep compatibility with the current version put Vorbis in the Ogg namespace
106  * only in the docs and provide a typedef to make it work.  In the next BIC
107  * version this will be removed and it will only exist in the Ogg namespace.
108  */
109
110 #ifdef DOXYGEN
111   }
112 #else
113   namespace Ogg { namespace Vorbis { typedef TagLib::Vorbis::File File; } }
114 #endif
115
116 }
117
118 #endif