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 #include "tag.h"
00032
00033 #include "mpegproperties.h"
00034
00035 namespace TagLib {
00036
00037 namespace ID3v2 { class Tag; class FrameFactory; }
00038 namespace ID3v1 { class Tag; }
00039 namespace APE { class Tag; }
00040
00042
00043 namespace MPEG {
00044
00046
00053 class TAGLIB_EXPORT File : public TagLib::File
00054 {
00055 public:
00060 enum TagTypes {
00062 NoTags = 0x0000,
00064 ID3v1 = 0x0001,
00066 ID3v2 = 0x0002,
00068 APE = 0x0004,
00070 AllTags = 0xffff
00071 };
00072
00081 File(FileName file, bool readProperties = true,
00082 Properties::ReadStyle propertiesStyle = Properties::Average);
00083
00093 File(FileName file, ID3v2::FrameFactory *frameFactory,
00094 bool readProperties = true,
00095 Properties::ReadStyle propertiesStyle = Properties::Average);
00096
00106
00107 File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
00108 bool readProperties = true,
00109 Properties::ReadStyle propertiesStyle = Properties::Average);
00110
00114 virtual ~File();
00115
00133 virtual Tag *tag() const;
00134
00141 PropertyMap properties() const;
00142
00143 void removeUnsupportedProperties(const StringList &properties);
00144
00150 PropertyMap setProperties(const PropertyMap &);
00151
00156 virtual Properties *audioProperties() const;
00157
00173 virtual bool save();
00174
00184 bool save(int tags);
00185
00195
00196 bool save(int tags, bool stripOthers);
00197
00210
00211 bool save(int tags, bool stripOthers, int id3v2Version);
00212
00224 ID3v2::Tag *ID3v2Tag(bool create = false);
00225
00237 ID3v1::Tag *ID3v1Tag(bool create = false);
00238
00250 APE::Tag *APETag(bool create = false);
00251
00262 bool strip(int tags = AllTags);
00263
00272
00273 bool strip(int tags, bool freeMemory);
00274
00280 void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
00281
00285 long firstFrameOffset();
00286
00291 long nextFrameOffset(long position);
00292
00297 long previousFrameOffset(long position);
00298
00302 long lastFrameOffset();
00303
00304 private:
00305 File(const File &);
00306 File &operator=(const File &);
00307
00308 void read(bool readProperties, Properties::ReadStyle propertiesStyle);
00309 long findID3v2();
00310 long findID3v1();
00311 void findAPE();
00312
00318 static bool secondSynchByte(char byte);
00319
00320 class FilePrivate;
00321 FilePrivate *d;
00322 };
00323 }
00324 }
00325
00326 #endif