TagLib API Documentation

mpegfile.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2002, 2003 by Scott Wheeler
00003     email                : wheeler@kde.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_MPEGFILE_H
00023 #define TAGLIB_MPEGFILE_H
00024 
00025 #include <tfile.h>
00026 
00027 #include "mpegproperties.h"
00028 
00029 namespace TagLib {
00030 
00031   namespace ID3v2 { class Tag; class FrameFactory; }
00032   namespace ID3v1 { class Tag; }
00033 
00035 
00036   namespace MPEG {
00037 
00039 
00046     class File : public TagLib::File
00047     {
00048     public:
00053       enum TagTypes {
00055         NoTags  = 0x0000,
00057         ID3v1   = 0x0001,
00059         ID3v2   = 0x0002,
00061         AllTags = 0xffff
00062       };
00063 
00069       File(const char *file, bool readProperties = true,
00070            Properties::ReadStyle propertiesStyle = Properties::Average);
00071 
00075       virtual ~File();
00076 
00093       virtual Tag *tag() const;
00094 
00099       virtual Properties *audioProperties() const;
00100 
00115       virtual void save();
00116 
00126       void save(int tags);
00127 
00142       ID3v2::Tag *ID3v2Tag(bool create = false);
00143 
00158       ID3v1::Tag *ID3v1Tag(bool create = false);
00159 
00164       void strip(int tags = AllTags);
00165 
00171       void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
00172 
00176       long firstFrameOffset();
00177 
00182       long nextFrameOffset(long position);
00183 
00188       long previousFrameOffset(long position);
00189 
00193       long lastFrameOffset();
00194 
00195     private:
00196       File(const File &);
00197       File &operator=(const File &);
00198 
00199       void read(bool readProperties, Properties::ReadStyle propertiesStyle);
00200       long findID3v2();
00201       long findID3v1();
00202 
00208       static bool secondSynchByte(char byte);
00209 
00210       class FilePrivate;
00211       FilePrivate *d;
00212     };
00213   }
00214 }
00215 
00216 #endif
KDE Logo
This file is part of the documentation for TagLib Version 1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Jan 22 05:44:21 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2003