xref: /MusicPlayer2/MusicPlayer2/taglib/aiffproperties.h (revision 2661106a96494c0a7dfab38bf1ae7b9565882443)
1 /***************************************************************************
2     copyright            : (C) 2008 by Scott Wheeler
3     email                : [email protected]
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., 51 Franklin Street, Fifth Floor, Boston, MA         *
19  *   02110-1301  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_AIFFPROPERTIES_H
27 #define TAGLIB_AIFFPROPERTIES_H
28 
29 #include "audioproperties.h"
30 
31 namespace TagLib {
32 
33   namespace RIFF {
34 
35     namespace AIFF {
36 
37       class File;
38 
39       //! An implementation of audio property reading for AIFF
40 
41       /*!
42        * This reads the data from an AIFF stream found in the AudioProperties
43        * API.
44        */
45 
46       class TAGLIB_EXPORT Properties : public AudioProperties
47       {
48       public:
49         /*!
50          * Create an instance of AIFF::Properties with the data read from the
51          * ByteVector \a data.
52          *
53          * \deprecated
54          */
55         TAGLIB_DEPRECATED Properties(const ByteVector &data, ReadStyle style);
56 
57         /*!
58          * Create an instance of AIFF::Properties with the data read from the
59          * AIFF::File \a file.
60          */
61         Properties(File *file, ReadStyle style);
62 
63         /*!
64          * Destroys this AIFF::Properties instance.
65          */
66         virtual ~Properties();
67 
68         /*!
69          * Returns the length of the file in seconds.  The length is rounded down to
70          * the nearest whole second.
71          *
72          * \note This method is just an alias of lengthInSeconds().
73          *
74          * \deprecated
75          */
76         TAGLIB_DEPRECATED virtual int length() const;
77 
78         /*!
79          * Returns the length of the file in seconds.  The length is rounded down to
80          * the nearest whole second.
81          *
82          * \see lengthInMilliseconds()
83          */
84         // BIC: make virtual
85         int lengthInSeconds() const;
86 
87         /*!
88          * Returns the length of the file in milliseconds.
89          *
90          * \see lengthInSeconds()
91          */
92         // BIC: make virtual
93         int lengthInMilliseconds() const;
94 
95         /*!
96          * Returns the average bit rate of the file in kb/s.
97          */
98         virtual int bitrate() const;
99 
100         /*!
101          * Returns the sample rate in Hz.
102          */
103         virtual int sampleRate() const;
104 
105         /*!
106          * Returns the number of audio channels.
107          */
108         virtual int channels() const;
109 
110         /*!
111          * Returns the number of bits per audio sample.
112          */
113         int bitsPerSample() const;
114 
115         /*!
116          * Returns the number of bits per audio sample.
117          *
118          * \note This method is just an alias of bitsPerSample().
119          *
120          * \deprecated
121          */
122         TAGLIB_DEPRECATED int sampleWidth() const;
123 
124         /*!
125          * Returns the number of sample frames
126          */
127         unsigned int sampleFrames() const;
128 
129         /*!
130          * Returns true if the file is in AIFF-C format, false if AIFF format.
131          */
132         bool isAiffC() const;
133 
134         /*!
135          * Returns the compression type of the AIFF-C file.  For example, "NONE" for
136          * not compressed, "ACE2" for ACE 2-to-1.
137          *
138          * If the file is in AIFF format, always returns an empty vector.
139          *
140          * \see isAiffC()
141          */
142         ByteVector compressionType() const;
143 
144         /*!
145          * Returns the concrete compression name of the AIFF-C file.
146          *
147          * If the file is in AIFF format, always returns an empty string.
148          *
149          * \see isAiffC()
150          */
151         String compressionName() const;
152 
153       private:
154         Properties(const Properties &);
155         Properties &operator=(const Properties &);
156 
157         void read(File *file);
158 
159         class PropertiesPrivate;
160         PropertiesPrivate *d;
161       };
162     }
163   }
164 }
165 
166 #endif
167