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_FLACFILE_H
00027 #define TAGLIB_FLACFILE_H
00028
00029 #include "taglib_export.h"
00030 #include "tfile.h"
00031 #include "tlist.h"
00032 #include "tag.h"
00033
00034 #include "flacpicture.h"
00035 #include "flacproperties.h"
00036
00037 namespace TagLib {
00038
00039 class Tag;
00040 namespace ID3v2 { class FrameFactory; class Tag; }
00041 namespace ID3v1 { class Tag; }
00042 namespace Ogg { class XiphComment; }
00043
00045
00055 namespace FLAC {
00056
00058
00066 class TAGLIB_EXPORT File : public TagLib::File
00067 {
00068 public:
00078 File(FileName file, bool readProperties = true,
00079 Properties::ReadStyle propertiesStyle = Properties::Average);
00080
00090
00091 File(FileName file, ID3v2::FrameFactory *frameFactory,
00092 bool readProperties = true,
00093 Properties::ReadStyle propertiesStyle = Properties::Average);
00094
00107
00108 File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
00109 bool readProperties = true,
00110 Properties::ReadStyle propertiesStyle = Properties::Average);
00111
00115 virtual ~File();
00116
00125 virtual TagLib::Tag *tag() const;
00126
00133 PropertyMap properties() const;
00134
00135 void removeUnsupportedProperties(const StringList &);
00136
00144 PropertyMap setProperties(const PropertyMap &);
00145
00150 virtual Properties *audioProperties() const;
00151
00159 virtual bool save();
00160
00178 ID3v2::Tag *ID3v2Tag(bool create = false);
00179
00197 ID3v1::Tag *ID3v1Tag(bool create = false);
00198
00216 Ogg::XiphComment *xiphComment(bool create = false);
00217
00225 void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
00226
00233 ByteVector streamInfoData();
00234
00241 long streamLength();
00242
00246 List<Picture *> pictureList();
00247
00252 void removePicture(Picture *picture, bool del = true);
00253
00257 void removePictures();
00258
00265 void addPicture(Picture *picture);
00266
00272 bool hasXiphComment() const;
00273
00279 bool hasID3v1Tag() const;
00280
00286 bool hasID3v2Tag() const;
00287
00288 private:
00289 File(const File &);
00290 File &operator=(const File &);
00291
00292 void read(bool readProperties, Properties::ReadStyle propertiesStyle);
00293 void scan();
00294 long findID3v2();
00295 long findID3v1();
00296 ByteVector xiphCommentData() const;
00297 long findPaddingBreak(long nextPageOffset, long targetOffset, bool *isLast);
00298
00299 class FilePrivate;
00300 FilePrivate *d;
00301 };
00302 }
00303 }
00304
00305 #endif