Added TagLib (with AUTORS and COPYING files)
[someplayer] / src / taglib / ogg / vorbis / vorbisproperties.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_VORBISPROPERTIES_H
27 #define TAGLIB_VORBISPROPERTIES_H
28
29 #include "taglib_export.h"
30 #include "audioproperties.h"
31
32 namespace TagLib {
33
34 /*
35  * This is just to make this appear to be in the Ogg namespace in the
36  * documentation.  The typedef below will make this work with the current code.
37  * In the next BIC version of TagLib this will be really moved into the Ogg
38  * namespace.
39  */
40
41 #ifdef DOXYGEN
42   namespace Ogg {
43 #endif
44
45   namespace Vorbis {
46
47     class File;
48
49     //! An implementation of audio property reading for Ogg Vorbis
50
51     /*!
52      * This reads the data from an Ogg Vorbis stream found in the AudioProperties
53      * API.
54      */
55
56     class TAGLIB_EXPORT Properties : public AudioProperties
57     {
58     public:
59       /*!
60        * Create an instance of Vorbis::Properties with the data read from the
61        * Vorbis::File \a file.
62        */
63       Properties(File *file, ReadStyle style = Average);
64
65       /*!
66        * Destroys this VorbisProperties instance.
67        */
68       virtual ~Properties();
69
70       // Reimplementations.
71
72       virtual int length() const;
73       virtual int bitrate() const;
74       virtual int sampleRate() const;
75       virtual int channels() const;
76
77       /*!
78        * Returns the Vorbis version, currently "0" (as specified by the spec).
79        */
80       int vorbisVersion() const;
81
82       /*!
83        * Returns the maximum bitrate as read from the Vorbis identification
84        * header.
85        */
86       int bitrateMaximum() const;
87
88       /*!
89        * Returns the nominal bitrate as read from the Vorbis identification
90        * header.
91        */
92       int bitrateNominal() const;
93
94       /*!
95        * Returns the minimum bitrate as read from the Vorbis identification
96        * header.
97        */
98       int bitrateMinimum() const;
99
100     private:
101       Properties(const Properties &);
102       Properties &operator=(const Properties &);
103
104       void read();
105
106       class PropertiesPrivate;
107       PropertiesPrivate *d;
108     };
109   }
110
111 /*
112  * To keep compatibility with the current version put Vorbis in the Ogg namespace
113  * only in the docs and provide a typedef to make it work.  In the next BIC
114  * version this will be removed and it will only exist in the Ogg namespace.
115  */
116
117 #ifdef DOXYGEN
118   }
119 #else
120   namespace Ogg { namespace Vorbis { typedef TagLib::AudioProperties AudioProperties; } }
121 #endif
122
123 }
124
125 #endif