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
00082 File(FileName file, bool readProperties = true,
00083 Properties::ReadStyle propertiesStyle = Properties::Average);
00084
00094
00095 File(FileName file, ID3v2::FrameFactory *frameFactory,
00096 bool readProperties = true,
00097 Properties::ReadStyle propertiesStyle = Properties::Average);
00098
00111 File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
00112 bool readProperties = true,
00113 Properties::ReadStyle propertiesStyle = Properties::Average);
00114
00118 virtual ~File();
00119
00137 virtual Tag *tag() const;
00138
00145 PropertyMap properties() const;
00146
00147 void removeUnsupportedProperties(const StringList &properties);
00148
00157 PropertyMap setProperties(const PropertyMap &);
00158
00163 virtual Properties *audioProperties() const;
00164
00180 virtual bool save();
00181
00191 bool save(int tags);
00192
00202
00203 bool save(int tags, bool stripOthers);
00204
00217
00218 bool save(int tags, bool stripOthers, int id3v2Version);
00219
00235
00236 bool save(int tags, bool stripOthers, int id3v2Version, bool duplicateTags);
00237
00255 ID3v2::Tag *ID3v2Tag(bool create = false);
00256
00274 ID3v1::Tag *ID3v1Tag(bool create = false);
00275
00293 APE::Tag *APETag(bool create = false);
00294
00305 bool strip(int tags = AllTags);
00306
00315
00316 bool strip(int tags, bool freeMemory);
00317
00323 void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
00324
00328 long firstFrameOffset();
00329
00334 long nextFrameOffset(long position);
00335
00340 long previousFrameOffset(long position);
00341
00345 long lastFrameOffset();
00346
00352 bool hasID3v1Tag() const;
00353
00359 bool hasID3v2Tag() const;
00360
00366 bool hasAPETag() const;
00367
00368 private:
00369 File(const File &);
00370 File &operator=(const File &);
00371
00372 void read(bool readProperties, Properties::ReadStyle propertiesStyle);
00373 long findID3v2();
00374 long findID3v1();
00375 void findAPE();
00376
00382 static bool secondSynchByte(char byte);
00383
00384 class FilePrivate;
00385 FilePrivate *d;
00386 };
00387 }
00388 }
00389
00390 #endif