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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
00019  *   USA                                                                   *
00020  ***************************************************************************/
00021 
00022 #ifndef TAGLIB_MPCFILE_H
00023 #define TAGLIB_MPCFILE_H
00024 
00025 #include "tfile.h"
00026 
00027 #include "mpcproperties.h"
00028 
00029 namespace TagLib {
00030 
00031   class Tag;
00032 
00033   namespace ID3v1 { class Tag; }
00034   namespace APE { class Tag; }
00035 
00037 
00046   namespace MPC {
00047 
00049 
00058     class File : public TagLib::File
00059     {
00060     public:
00065       enum TagTypes {
00067         NoTags  = 0x0000,
00069         ID3v1   = 0x0001,
00071         ID3v2   = 0x0002,
00073         APE     = 0x0004,
00075         AllTags = 0xffff
00076       };
00077 
00083       File(const char *file, bool readProperties = true,
00084            Properties::ReadStyle propertiesStyle = Properties::Average);
00085 
00089       virtual ~File();
00090 
00095       virtual TagLib::Tag *tag() const;
00096 
00101       virtual Properties *audioProperties() const;
00102 
00106       virtual bool save();
00107 
00120       ID3v1::Tag *ID3v1Tag(bool create = false);
00121 
00134       APE::Tag *APETag(bool create = false);
00135 
00144       void remove(int tags = AllTags);
00145 
00146     private:
00147       File(const File &);
00148       File &operator=(const File &);
00149 
00150       void read(bool readProperties, Properties::ReadStyle propertiesStyle);
00151       void scan();
00152       long findAPE();
00153       long findID3v1();
00154       long findID3v2();
00155 
00156       class FilePrivate;
00157       FilePrivate *d;
00158     };
00159   }
00160 }
00161 
00162 #endif