trueaudiofile.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_TRUEAUDIOFILE_H
00031 #define TAGLIB_TRUEAUDIOFILE_H
00032 
00033 #include "tfile.h"
00034 #include "trueaudioproperties.h"
00035 
00036 namespace TagLib {
00037 
00038   class Tag;
00039 
00040   namespace ID3v2 { class Tag; class FrameFactory; }
00041   namespace ID3v1 { class Tag; }
00042 
00044 
00052   namespace TrueAudio {
00053 
00055 
00063     class TAGLIB_EXPORT File : public TagLib::File
00064     {
00065     public:
00070       enum TagTypes {
00072         NoTags  = 0x0000,
00074         ID3v1   = 0x0001,
00076         ID3v2   = 0x0002,
00078         AllTags = 0xffff
00079       };
00080 
00087       File(FileName file, bool readProperties = true,
00088            Properties::ReadStyle propertiesStyle = Properties::Average);
00089 
00099       File(FileName file, ID3v2::FrameFactory *frameFactory,
00100            bool readProperties = true,
00101            Properties::ReadStyle propertiesStyle = Properties::Average);
00102 
00112       File(IOStream *stream, bool readProperties = true,
00113            Properties::ReadStyle propertiesStyle = Properties::Average);
00114 
00127       File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
00128            bool readProperties = true,
00129            Properties::ReadStyle propertiesStyle = Properties::Average);
00130 
00134       virtual ~File();
00135 
00139       virtual TagLib::Tag *tag() const;
00140 
00146       PropertyMap properties() const;
00147 
00153       PropertyMap setProperties(const PropertyMap &);
00154 
00155       void removeUnsupportedProperties(const StringList &properties);
00156 
00161       virtual Properties *audioProperties() const;
00162 
00169       void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
00170 
00174       virtual bool save();
00175 
00193       ID3v1::Tag *ID3v1Tag(bool create = false);
00194 
00212       ID3v2::Tag *ID3v2Tag(bool create = false);
00213 
00222       void strip(int tags = AllTags);
00223 
00229       bool hasID3v1Tag() const;
00230 
00236       bool hasID3v2Tag() const;
00237 
00238     private:
00239       File(const File &);
00240       File &operator=(const File &);
00241 
00242       void read(bool readProperties);
00243 
00244       class FilePrivate;
00245       FilePrivate *d;
00246     };
00247   }
00248 }
00249 
00250 #endif