00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
00078
00079 File(const char *file, ID3v2::FrameFactory *frameFactory,
00080 bool readProperties = true,
00081 Properties::ReadStyle propertiesStyle = Properties::Average);
00082
00086 virtual ~File();
00087
00104 virtual Tag *tag() const;
00105
00110 virtual Properties *audioProperties() const;
00111
00126 virtual void save();
00127
00137 void save(int tags);
00138
00153 ID3v2::Tag *ID3v2Tag(bool create = false);
00154
00169 ID3v1::Tag *ID3v1Tag(bool create = false);
00170
00175 void strip(int tags = AllTags);
00176
00182 void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
00183
00187 long firstFrameOffset();
00188
00193 long nextFrameOffset(long position);
00194
00199 long previousFrameOffset(long position);
00200
00204 long lastFrameOffset();
00205
00206 private:
00207 File(const File &);
00208 File &operator=(const File &);
00209
00210 void read(bool readProperties, Properties::ReadStyle propertiesStyle);
00211 long findID3v2();
00212 long findID3v1();
00213
00219 static bool secondSynchByte(char byte);
00220
00221 class FilePrivate;
00222 FilePrivate *d;
00223 };
00224 }
00225 }
00226
00227 #endif