1 /**************************************************************************
2     copyright            : (C) 2005-2007 by Lukáš Lalinský
3     email                : lalinsky@gmail.com
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_ASFPROPERTIES_H
27 #define TAGLIB_ASFPROPERTIES_H
28 
29 #include "audioproperties.h"
30 #include "tstring.h"
31 #include "taglib_export.h"
32 
33 namespace TagLib {
34 
35   namespace ASF {
36 
37     //! An implementation of ASF audio properties
38     class TAGLIB_EXPORT Properties : public AudioProperties
39     {
40     public:
41 
42       /*!
43        * Audio codec types can be used in ASF file.
44        */
45       enum Codec
46       {
47         /*!
48          * Couldn't detect the codec.
49          */
50         Unknown = 0,
51 
52         /*!
53          * Windows Media Audio 1
54          */
55         WMA1,
56 
57         /*!
58          * Windows Media Audio 2 or above
59          */
60         WMA2,
61 
62         /*!
63          * Windows Media Audio 9 Professional
64          */
65         WMA9Pro,
66 
67         /*!
68          * Windows Media Audio 9 Lossless
69          */
70         WMA9Lossless,
71       };
72 
73       /*!
74        * Creates an instance of ASF::Properties.
75        */
76       Properties();
77 
78       /*!
79        * Destroys this ASF::Properties instance.
80        */
81       virtual ~Properties();
82 
83       /*!
84        * Returns the length of the file in seconds.  The length is rounded down to
85        * the nearest whole second.
86        *
87        * \note This method is just an alias of lengthInSeconds().
88        *
89        * \deprecated
90        */
91       virtual int length() const;
92 
93       /*!
94        * Returns the length of the file in seconds.  The length is rounded down to
95        * the nearest whole second.
96        *
97        * \see lengthInMilliseconds()
98        */
99       // BIC: make virtual
100       int lengthInSeconds() const;
101 
102       /*!
103        * Returns the length of the file in milliseconds.
104        *
105        * \see lengthInSeconds()
106        */
107       // BIC: make virtual
108       int lengthInMilliseconds() const;
109 
110       /*!
111        * Returns the average bit rate of the file in kb/s.
112        */
113       virtual int bitrate() const;
114 
115       /*!
116        * Returns the sample rate in Hz.
117        */
118       virtual int sampleRate() const;
119 
120       /*!
121        * Returns the number of audio channels.
122        */
123       virtual int channels() const;
124 
125       /*!
126        * Returns the number of bits per audio sample.
127        */
128       int bitsPerSample() const;
129 
130       /*!
131        * Returns the codec used in the file.
132        *
133        * \see codecName()
134        * \see codecDescription()
135        */
136       Codec codec() const;
137 
138       /*!
139        * Returns the concrete codec name, for example "Windows Media Audio 9.1"
140        * used in the file if available, otherwise an empty string.
141        *
142        * \see codec()
143        * \see codecDescription()
144        */
145       String codecName() const;
146 
147       /*!
148        * Returns the codec description, typically contains the encoder settings,
149        * for example "VBR Quality 50, 44kHz, stereo 1-pass VBR" if available,
150        * otherwise an empty string.
151        *
152        * \see codec()
153        * \see codecName()
154        */
155       String codecDescription() const;
156 
157       /*!
158        * Returns whether or not the file is encrypted.
159        */
160       bool isEncrypted() const;
161 
162 #ifndef DO_NOT_DOCUMENT
163       // deprecated
164       void setLength(int value);
165 
166       void setLengthInMilliseconds(int value);
167       void setBitrate(int value);
168       void setSampleRate(int value);
169       void setChannels(int value);
170       void setBitsPerSample(int value);
171       void setCodec(int value);
172       void setCodecName(const String &value);
173       void setCodecDescription(const String &value);
174       void setEncrypted(bool value);
175 #endif
176 
177     private:
178       class PropertiesPrivate;
179       PropertiesPrivate *d;
180     };
181 
182   }
183 
184 }
185 
186 #endif
187