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
00183 virtual bool save();
00184
00197 bool save(int tags);
00198
00211
00212 bool save(int tags, bool stripOthers);
00213
00229
00230 bool save(int tags, bool stripOthers, int id3v2Version);
00231
00250
00251 bool save(int tags, bool stripOthers, int id3v2Version, bool duplicateTags);
00252
00270 ID3v2::Tag *ID3v2Tag(bool create = false);
00271
00289 ID3v1::Tag *ID3v1Tag(bool create = false);
00290
00308 APE::Tag *APETag(bool create = false);
00309
00322 bool strip(int tags = AllTags);
00323
00334
00335 bool strip(int tags, bool freeMemory);
00336
00343 void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
00344
00348 long firstFrameOffset();
00349
00354 long nextFrameOffset(long position);
00355
00360 long previousFrameOffset(long position);
00361
00365 long lastFrameOffset();
00366
00372 bool hasID3v1Tag() const;
00373
00379 bool hasID3v2Tag() const;
00380
00386 bool hasAPETag() const;
00387
00388 private:
00389 File(const File &);
00390 File &operator=(const File &);
00391
00392 void read(bool readProperties);
00393 long findID3v2(long offset);
00394 long findID3v1();
00395 void findAPE();
00396
00397 class FilePrivate;
00398 FilePrivate *d;
00399 };
00400 }
00401 }
00402
00403 #endif