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 #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
00307 bool strip(int tags = AllTags);
00308
00319
00320 bool strip(int tags, bool freeMemory);
00321
00328 void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
00329
00333 long firstFrameOffset();
00334
00339 long nextFrameOffset(long position);
00340
00345 long previousFrameOffset(long position);
00346
00350 long lastFrameOffset();
00351
00357 bool hasID3v1Tag() const;
00358
00364 bool hasID3v2Tag() const;
00365
00371 bool hasAPETag() const;
00372
00373 private:
00374 File(const File &);
00375 File &operator=(const File &);
00376
00377 void read(bool readProperties);
00378 long findID3v2();
00379
00380 class FilePrivate;
00381 FilePrivate *d;
00382 };
00383 }
00384 }
00385
00386 #endif