TagLib API Documentation
flacfile.h
Go to the documentation of this file.
1/***************************************************************************
2 copyright : (C) 2003 by Allan Sandfeld Jensen
3 email : kde@carewolf.org
4 ***************************************************************************/
5
6/***************************************************************************
7 * This library is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU Lesser General Public License version *
9 * 2.1 as published by the Free Software Foundation. *
10 * *
11 * This library is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14 * Lesser General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with this library; if not, write to the Free Software *
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
19 * 02110-1301 USA *
20 * *
21 * Alternatively, this file is available under the Mozilla Public *
22 * License Version 1.1. You may obtain a copy of the License at *
23 * http://www.mozilla.org/MPL/ *
24 ***************************************************************************/
25
26#ifndef TAGLIB_FLACFILE_H
27#define TAGLIB_FLACFILE_H
28
29#include "tfile.h"
30#include "tlist.h"
31#include "taglib_export.h"
32#include "tag.h"
33#include "flacpicture.h"
34#include "flacproperties.h"
35
36namespace TagLib {
37
38 class Tag;
39 namespace ID3v2 { class FrameFactory; class Tag; }
40 namespace ID3v1 { class Tag; }
41 namespace Ogg { class XiphComment; }
42
44
54 namespace FLAC {
55
57
66 {
67 public:
72 enum TagTypes {
74 NoTags = 0x0000,
76 XiphComment = 0x0001,
78 ID3v1 = 0x0002,
80 ID3v2 = 0x0004,
82 AllTags = 0xffff
83 };
84
94 File(FileName file, bool readProperties = true,
96 ID3v2::FrameFactory *frameFactory = nullptr);
97
110 File(FileName file, ID3v2::FrameFactory *frameFactory,
111 bool readProperties = true,
113
126 File(IOStream *stream, bool readProperties = true,
128 ID3v2::FrameFactory *frameFactory = nullptr);
129
145 File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
146 bool readProperties = true,
148
152 ~File() override;
153
154 File(const File &) = delete;
155 File &operator=(const File &) = delete;
156
165 TagLib::Tag *tag() const override;
166
173 PropertyMap properties() const override;
174
176
185
190
195 List<VariantMap> complexProperties(const String &key) const override;
196
201 bool setComplexProperties(const String &key, const List<VariantMap> &value) override;
202
207 Properties *audioProperties() const override;
208
216 bool save() override;
217
235 ID3v2::Tag *ID3v2Tag(bool create = false);
236
254 ID3v1::Tag *ID3v1Tag(bool create = false);
255
273 Ogg::XiphComment *xiphComment(bool create = false);
274
279
284 void removePicture(Picture *picture, bool del = true);
285
290
297 void addPicture(Picture *picture);
298
312 void strip(int tags = AllTags);
313
319 bool hasXiphComment() const;
320
326 bool hasID3v1Tag() const;
327
333 bool hasID3v2Tag() const;
334
342 static bool isSupported(IOStream *stream);
343
344 private:
345 void read(bool readProperties);
346 void scan();
347
348 class FilePrivate;
350 std::unique_ptr<FilePrivate> d;
351 };
352 } // namespace FLAC
353} // namespace TagLib
354
355#endif
ReadStyle
Definition: audioproperties.h:56
@ Average
Read more of the file and make better values guesses.
Definition: audioproperties.h:60
An implementation of TagLib::File with FLAC specific methods.
Definition: flacfile.h:66
void removeUnsupportedProperties(const StringList &) override
static bool isSupported(IOStream *stream)
StringList complexPropertyKeys() const override
bool hasID3v1Tag() const
File(const File &)=delete
Properties * audioProperties() const override
File(FileName file, bool readProperties=true, Properties::ReadStyle propertiesStyle=Properties::Average, ID3v2::FrameFactory *frameFactory=nullptr)
List< VariantMap > complexProperties(const String &key) const override
List< Picture * > pictureList()
bool hasID3v2Tag() const
ID3v1::Tag * ID3v1Tag(bool create=false)
bool save() override
void addPicture(Picture *picture)
bool hasXiphComment() const
TAGLIB_DEPRECATED File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties=true, Properties::ReadStyle propertiesStyle=Properties::Average)
bool setComplexProperties(const String &key, const List< VariantMap > &value) override
Ogg::XiphComment * xiphComment(bool create=false)
PropertyMap setProperties(const PropertyMap &) override
void removePicture(Picture *picture, bool del=true)
TagLib::Tag * tag() const override
PropertyMap properties() const override
TagTypes
Definition: flacfile.h:72
void strip(int tags=AllTags)
ID3v2::Tag * ID3v2Tag(bool create=false)
TAGLIB_DEPRECATED File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties=true, Properties::ReadStyle propertiesStyle=Properties::Average)
File & operator=(const File &)=delete
File(IOStream *stream, bool readProperties=true, Properties::ReadStyle propertiesStyle=Properties::Average, ID3v2::FrameFactory *frameFactory=nullptr)
FLAC picture.
Definition: flacpicture.h:40
An implementation of audio property reading for FLAC.
Definition: flacproperties.h:45
A file class with some useful methods for tag manipulation.
Definition: tfile.h:51
The main class in the ID3v1 implementation.
Definition: id3v1tag.h:115
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:68
The main class in the ID3v2 implementation.
Definition: id3v2tag.h:134
An abstract class that provides operations on a sequence of bytes.
Definition: tiostream.h:65
A generic, implicitly shared list.
Definition: tlist.h:54
Ogg Vorbis comment implementation.
Definition: xiphcomment.h:71
A map for format-independent <key,values> tag representations.
Definition: tpropertymap.h:123
A list of strings.
Definition: tstringlist.h:44
A wide string class suitable for unicode.
Definition: tstring.h:83
A simple, generic interface to common audio metadata fields.
Definition: tag.h:49
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
const char * FileName
Definition: tiostream.h:59
#define TAGLIB_DEPRECATED
Definition: taglib.h:39
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55