mpcproperties.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2004 by Allan Sandfeld Jensen
00003     email                : kde@carewolf.org
00004  ***************************************************************************/
00005 
00006 /***************************************************************************
00007  *   This library is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU Lesser General Public License version   *
00009  *   2.1 as published by the Free Software Foundation.                     *
00010  *                                                                         *
00011  *   This library is distributed in the hope that it will be useful, but   *
00012  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014  *   Lesser General Public License for more details.                       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with this library; if not, write to the Free Software   *
00018  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA         *
00019  *   02110-1301  USA                                                       *
00020  *                                                                         *
00021  *   Alternatively, this file is available under the Mozilla Public        *
00022  *   License Version 1.1.  You may obtain a copy of the License at         *
00023  *   http://www.mozilla.org/MPL/                                           *
00024  ***************************************************************************/
00025 
00026 #ifndef TAGLIB_MPCPROPERTIES_H
00027 #define TAGLIB_MPCPROPERTIES_H
00028 
00029 #include "taglib_export.h"
00030 #include "audioproperties.h"
00031 
00032 namespace TagLib {
00033 
00034   namespace MPC {
00035 
00036     class File;
00037 
00038     static const uint HeaderSize = 8*7;
00039 
00041 
00047     class TAGLIB_EXPORT Properties : public AudioProperties
00048     {
00049     public:
00056       Properties(const ByteVector &data, long streamLength, ReadStyle style = Average);
00057 
00062       Properties(File *file, long streamLength, ReadStyle style = Average);
00063 
00067       virtual ~Properties();
00068 
00077       virtual int length() const;
00078 
00085       // BIC: make virtual
00086       int lengthInSeconds() const;
00087 
00093       // BIC: make virtual
00094       int lengthInMilliseconds() const;
00095 
00099       virtual int bitrate() const;
00100 
00104       virtual int sampleRate() const;
00105 
00109       virtual int channels() const;
00110 
00114       int mpcVersion() const;
00115 
00116       uint totalFrames() const;
00117       uint sampleFrames() const;
00118 
00123       int trackGain() const;
00124 
00130       int trackPeak() const;
00131 
00136       int albumGain() const;
00137 
00143       int albumPeak() const;
00144 
00145     private:
00146       Properties(const Properties &);
00147       Properties &operator=(const Properties &);
00148 
00149       void readSV7(const ByteVector &data, long streamLength);
00150       void readSV8(File *file, long streamLength);
00151 
00152       class PropertiesPrivate;
00153       PropertiesPrivate *d;
00154     };
00155   }
00156 }
00157 
00158 #endif