wavpackfile.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2006 by Lukáš Lalinský
00003     email                : lalinsky@gmail.com
00004 
00005     copyright            : (C) 2004 by Allan Sandfeld Jensen
00006     email                : kde@carewolf.org
00007                            (original MPC implementation)
00008  ***************************************************************************/
00009 
00010 /***************************************************************************
00011  *   This library is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU Lesser General Public License version   *
00013  *   2.1 as published by the Free Software Foundation.                     *
00014  *                                                                         *
00015  *   This library is distributed in the hope that it will be useful, but   *
00016  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
00017  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00018  *   Lesser General Public License for more details.                       *
00019  *                                                                         *
00020  *   You should have received a copy of the GNU Lesser General Public      *
00021  *   License along with this library; if not, write to the Free Software   *
00022  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA         *
00023  *   02110-1301  USA                                                       *
00024  *                                                                         *
00025  *   Alternatively, this file is available under the Mozilla Public        *
00026  *   License Version 1.1.  You may obtain a copy of the License at         *
00027  *   http://www.mozilla.org/MPL/                                           *
00028  ***************************************************************************/
00029 
00030 #ifndef TAGLIB_WVFILE_H
00031 #define TAGLIB_WVFILE_H
00032 
00033 #include "tfile.h"
00034 #include "taglib_export.h"
00035 #include "wavpackproperties.h"
00036 
00037 namespace TagLib {
00038 
00039   class Tag;
00040 
00041   namespace ID3v1 { class Tag; }
00042   namespace APE { class Tag; }
00043 
00045 
00053   namespace WavPack {
00054 
00056 
00064     class TAGLIB_EXPORT File : public TagLib::File
00065     {
00066     public:
00071       enum TagTypes {
00073         NoTags  = 0x0000,
00075         ID3v1   = 0x0001,
00077         APE     = 0x0002,
00079         AllTags = 0xffff
00080       };
00081 
00087       File(FileName file, bool readProperties = true,
00088            Properties::ReadStyle propertiesStyle = Properties::Average);
00089 
00098       File(IOStream *stream, bool readProperties = true,
00099            Properties::ReadStyle propertiesStyle = Properties::Average);
00100 
00104       virtual ~File();
00105 
00110       virtual TagLib::Tag *tag() const;
00111 
00117       PropertyMap properties() const;
00118 
00124       PropertyMap setProperties(const PropertyMap&);
00125 
00130       virtual Properties *audioProperties() const;
00131 
00135       virtual bool save();
00136 
00149       ID3v1::Tag *ID3v1Tag(bool create = false);
00150 
00162       APE::Tag *APETag(bool create = false);
00163 
00172       void strip(int tags = AllTags);
00173 
00174     private:
00175       File(const File &);
00176       File &operator=(const File &);
00177 
00178       void read(bool readProperties, Properties::ReadStyle propertiesStyle);
00179       void scan();
00180       long findID3v1();
00181       long findAPE();
00182 
00183       class FilePrivate;
00184       FilePrivate *d;
00185     };
00186   }
00187 }
00188 
00189 #endif