apefile.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2010 by Alex Novichkov
00003     email                : novichko@atnet.ru
00004 
00005     copyright            : (C) 2006 by Lukáš Lalinský
00006     email                : lalinsky@gmail.com
00007                            (original WavPack implementation)
00008 
00009     copyright            : (C) 2004 by Allan Sandfeld Jensen
00010     email                : kde@carewolf.org
00011                            (original MPC implementation)
00012  ***************************************************************************/
00013 
00014 /***************************************************************************
00015  *   This library is free software; you can redistribute it and/or modify  *
00016  *   it under the terms of the GNU Lesser General Public License version   *
00017  *   2.1 as published by the Free Software Foundation.                     *
00018  *                                                                         *
00019  *   This library is distributed in the hope that it will be useful, but   *
00020  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
00021  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00022  *   Lesser General Public License for more details.                       *
00023  *                                                                         *
00024  *   You should have received a copy of the GNU Lesser General Public      *
00025  *   License along with this library; if not, write to the Free Software   *
00026  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA         *
00027  *   02110-1301  USA                                                       *
00028  *                                                                         *
00029  *   Alternatively, this file is available under the Mozilla Public        *
00030  *   License Version 1.1.  You may obtain a copy of the License at         *
00031  *   http://www.mozilla.org/MPL/                                           *
00032  ***************************************************************************/
00033 
00034 #ifndef TAGLIB_APEFILE_H
00035 #define TAGLIB_APEFILE_H
00036 
00037 #include "tfile.h"
00038 #include "taglib_export.h"
00039 #include "apeproperties.h"
00040 
00041 namespace TagLib {
00042 
00043   class Tag;
00044 
00045   namespace ID3v1 { class Tag; }
00046   namespace APE { class Tag; }
00047 
00049 
00057   namespace APE {
00058 
00060 
00068     class TAGLIB_EXPORT File : public TagLib::File
00069     {
00070     public:
00075       enum TagTypes {
00077         NoTags  = 0x0000,
00079         ID3v1   = 0x0001,
00081         APE     = 0x0002,
00083         AllTags = 0xffff
00084       };
00085 
00091       File(FileName file, bool readProperties = true,
00092            Properties::ReadStyle propertiesStyle = Properties::Average);
00093 
00097       virtual ~File();
00098 
00103       virtual TagLib::Tag *tag() const;
00104 
00109       virtual Properties *audioProperties() const;
00110 
00117       virtual bool save();
00118 
00131       ID3v1::Tag *ID3v1Tag(bool create = false);
00132 
00144       APE::Tag *APETag(bool create = false);
00145 
00154       void strip(int tags = AllTags);
00155 
00156     private:
00157       File(const File &);
00158       File &operator=(const File &);
00159 
00160       void read(bool readProperties, Properties::ReadStyle propertiesStyle);
00161       void scan();
00162       long findID3v1();
00163       long findAPE();
00164 
00165       class FilePrivate;
00166       FilePrivate *d;
00167     };
00168   }
00169 }
00170 
00171 #endif