68e2d4ca4805a1c12b44701ce6bb92124ed62c81
[someplayer] / src / taglib / asf / asfproperties.cpp
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., 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 #ifdef HAVE_CONFIG_H
27 #include <config.h>
28 #endif
29
30 #ifdef WITH_ASF
31
32 #include <tdebug.h>
33 #include <tstring.h>
34 #include "asfproperties.h"
35
36 using namespace TagLib;
37
38 class ASF::Properties::PropertiesPrivate
39 {
40 public:
41   PropertiesPrivate(): length(0), bitrate(0), sampleRate(0), channels(0) {}
42   int length;
43   int bitrate;
44   int sampleRate;
45   int channels;
46 };
47
48 ////////////////////////////////////////////////////////////////////////////////
49 // public members
50 ////////////////////////////////////////////////////////////////////////////////
51
52 ASF::Properties::Properties() : AudioProperties(AudioProperties::Average)
53 {
54   d = new PropertiesPrivate;
55 }
56
57 ASF::Properties::~Properties()
58 {
59   if(d)
60     delete d;  
61 }
62
63 int ASF::Properties::length() const
64 {
65   return d->length;
66 }
67
68 int ASF::Properties::bitrate() const
69 {
70   return d->bitrate;
71 }
72
73 int ASF::Properties::sampleRate() const
74 {
75   return d->sampleRate;
76 }
77
78 int ASF::Properties::channels() const
79 {
80   return d->channels;
81
82
83 ////////////////////////////////////////////////////////////////////////////////
84 // private members
85 ////////////////////////////////////////////////////////////////////////////////
86
87 void ASF::Properties::setLength(int length)
88 {
89   d->length = length;
90 }
91
92 void ASF::Properties::setBitrate(int length)
93 {
94   d->bitrate = length;
95 }
96
97 void ASF::Properties::setSampleRate(int length)
98 {
99   d->sampleRate = length;
100 }
101
102 void ASF::Properties::setChannels(int length)
103 {
104   d->channels = length;
105 }
106
107 #endif