mpcfile.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_MPCFILE_H
00027 #define TAGLIB_MPCFILE_H
00028 
00029 #include "taglib_export.h"
00030 #include "tfile.h"
00031 #include "tag.h"
00032 
00033 #include "mpcproperties.h"
00034 
00035 #include "tlist.h"
00036 
00037 namespace TagLib {
00038 
00039   class Tag;
00040 
00041   namespace ID3v1 { class Tag; }
00042   namespace APE { class Tag; }
00043 
00045 
00054   namespace MPC {
00055 
00057 
00066     class TAGLIB_EXPORT File : public TagLib::File
00067     {
00068     public:
00073       enum TagTypes {
00075         NoTags  = 0x0000,
00077         ID3v1   = 0x0001,
00079         ID3v2   = 0x0002,
00081         APE     = 0x0004,
00083         AllTags = 0xffff
00084       };
00085 
00091       File(FileName file, bool readProperties = true,
00092            Properties::ReadStyle propertiesStyle = Properties::Average);
00093 
00102       File(IOStream *stream, bool readProperties = true,
00103            Properties::ReadStyle propertiesStyle = Properties::Average);
00104 
00108       virtual ~File();
00109 
00114       virtual TagLib::Tag *tag() const;
00115 
00121       PropertyMap properties() const;
00122 
00123       void removeUnsupportedProperties(const StringList &properties);
00124 
00130       PropertyMap setProperties(const PropertyMap &);
00131 
00136       virtual Properties *audioProperties() const;
00137 
00141       virtual bool save();
00142 
00155       ID3v1::Tag *ID3v1Tag(bool create = false);
00156 
00169       APE::Tag *APETag(bool create = false);
00170 
00180       void strip(int tags = AllTags);
00181 
00186       void remove(int tags = AllTags);
00187 
00188     private:
00189       File(const File &);
00190       File &operator=(const File &);
00191 
00192       void read(bool readProperties, Properties::ReadStyle propertiesStyle);
00193       void scan();
00194       long findAPE();
00195       long findID3v1();
00196       long findID3v2();
00197 
00198       class FilePrivate;
00199       FilePrivate *d;
00200     };
00201   }
00202 }
00203 
00204 #endif