mpegfile.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef TAGLIB_MPEGFILE_H
00027 #define TAGLIB_MPEGFILE_H
00028
00029 #include "taglib_export.h"
00030 #include "tfile.h"
00031
00032 #include "mpegproperties.h"
00033
00034 namespace TagLib {
00035
00036 namespace ID3v2 { class Tag; class FrameFactory; }
00037 namespace ID3v1 { class Tag; }
00038 namespace APE { class Tag; }
00039
00041
00042 namespace MPEG {
00043
00045
00052 class TAGLIB_EXPORT File : public TagLib::File
00053 {
00054 public:
00059 enum TagTypes {
00061 NoTags = 0x0000,
00063 ID3v1 = 0x0001,
00065 ID3v2 = 0x0002,
00067 APE = 0x0004,
00069 AllTags = 0xffff
00070 };
00071
00080 File(FileName file, bool readProperties = true,
00081 Properties::ReadStyle propertiesStyle = Properties::Average);
00082
00089
00090 File(FileName file, ID3v2::FrameFactory *frameFactory,
00091 bool readProperties = true,
00092 Properties::ReadStyle propertiesStyle = Properties::Average);
00093
00097 virtual ~File();
00098
00116 virtual Tag *tag() const;
00117
00122 virtual Properties *audioProperties() const;
00123
00139 virtual bool save();
00140
00150 bool save(int tags);
00151
00161
00162 bool save(int tags, bool stripOthers);
00163
00175 ID3v2::Tag *ID3v2Tag(bool create = false);
00176
00188 ID3v1::Tag *ID3v1Tag(bool create = false);
00189
00201 APE::Tag *APETag(bool create = false);
00202
00213 bool strip(int tags = AllTags);
00214
00223
00224 bool strip(int tags, bool freeMemory);
00225
00231 void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
00232
00236 long firstFrameOffset();
00237
00242 long nextFrameOffset(long position);
00243
00248 long previousFrameOffset(long position);
00249
00253 long lastFrameOffset();
00254
00255 private:
00256 File(const File &);
00257 File &operator=(const File &);
00258
00259 void read(bool readProperties, Properties::ReadStyle propertiesStyle);
00260 long findID3v2();
00261 long findID3v1();
00262 void findAPE();
00263
00269 static bool secondSynchByte(char byte);
00270
00271 class FilePrivate;
00272 FilePrivate *d;
00273 };
00274 }
00275 }
00276
00277 #endif