TagLib  2.0.2
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 
36 namespace 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,
112  Properties::ReadStyle propertiesStyle = Properties::Average);
113 
126  File(IOStream *stream, bool readProperties = true,
127  Properties::ReadStyle propertiesStyle = Properties::Average,
128  ID3v2::FrameFactory *frameFactory = nullptr);
129 
145  File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
146  bool readProperties = true,
147  Properties::ReadStyle propertiesStyle = Properties::Average);
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 
175  void removeUnsupportedProperties(const StringList &) override;
176 
184  PropertyMap setProperties(const PropertyMap &) override;
185 
189  StringList complexPropertyKeys() const override;
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 
278  List<Picture *> pictureList();
279 
284  void removePicture(Picture *picture, bool del = true);
285 
289  void removePictures();
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
A generic, implicitly shared list.
Definition: tlist.h:53
An implementation of TagLib::File with FLAC specific methods.
Definition: flacfile.h:65
A map for format-independent <key,values> tag representations.
Definition: tpropertymap.h:122
An abstract class that provides operations on a sequence of bytes.
Definition: tiostream.h:64
A simple, generic interface to common audio metadata fields.
Definition: tag.h:48
A file class with some useful methods for tag manipulation.
Definition: tfile.h:50
A wide string class suitable for unicode.
Definition: tstring.h:82
TagTypes
Definition: flacfile.h:72
Read more of the file and make better values guesses.
Definition: audioproperties.h:60
The main class in the ID3v1 implementation.
Definition: id3v1tag.h:114
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:67
const char * FileName
Definition: tiostream.h:59
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55
#define TAGLIB_DEPRECATED
Definition: taglib.h:39
A list of strings.
Definition: tstringlist.h:43
An implementation of audio property reading for FLAC.
Definition: flacproperties.h:44
ReadStyle
Definition: audioproperties.h:56
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
FLAC picture.
Definition: flacpicture.h:39
The main class in the ID3v2 implementation.
Definition: id3v2tag.h:133
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
Ogg Vorbis comment implementation.
Definition: xiphcomment.h:70