TagLib  2.2.1
xiphcomment.h
Go to the documentation of this file.
1 /***************************************************************************
2  copyright : (C) 2002 - 2008 by Scott Wheeler
3  email : wheeler@kde.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_VORBISCOMMENT_H
27 #define TAGLIB_VORBISCOMMENT_H
28 
29 #include "tlist.h"
30 #include "tmap.h"
31 #include "tstring.h"
32 #include "tstringlist.h"
33 #include "tbytevector.h"
34 #include "taglib_export.h"
35 #include "tag.h"
36 #include "flacpicture.h"
37 
38 #ifdef _MSC_VER
39 // Explained at end of tpropertymap.cpp
41 #endif
42 
43 namespace TagLib {
44 
45  namespace Ogg {
46 
54 
56 
71  {
72  public:
76  XiphComment();
77 
81  XiphComment(const ByteVector &data);
82 
86  ~XiphComment() override;
87 
88  XiphComment(const XiphComment &) = delete;
89  XiphComment &operator=(const XiphComment &) = delete;
90 
91  String title() const override;
92  String artist() const override;
93  String album() const override;
94  String comment() const override;
95  String genre() const override;
96  unsigned int year() const override;
97  unsigned int track() const override;
98 
99  void setTitle(const String &s) override;
100  void setArtist(const String &s) override;
101  void setAlbum(const String &s) override;
102  void setComment(const String &s) override;
103  void setGenre(const String &s) override;
104  void setYear(unsigned int i) override;
105  void setTrack(unsigned int i) override;
106 
107  bool isEmpty() const override;
108 
112  unsigned int fieldCount() const;
113 
150  const FieldListMap &fieldListMap() const;
151 
159  PropertyMap properties() const override;
160 
168  PropertyMap setProperties(const PropertyMap&) override;
169 
170  StringList complexPropertyKeys() const override;
171  List<VariantMap> complexProperties(const String &key) const override;
172  bool setComplexProperties(const String &key, const List<VariantMap> &value) override;
173 
177  static bool checkKey(const String&);
178 
183  String vendorID() const;
184 
192  void addField(const String &key, const String &value, bool replace = true);
193 
199  void removeFields(const String &key);
200 
206  void removeFields(const String &key, const String &value);
207 
213  void removeAllFields();
214 
220  bool contains(const String &key) const;
221 
229  ByteVector render(bool addFramingBit = true) const;
230 
231 
235  List<FLAC::Picture *> pictureList();
236 
241  void removePicture(FLAC::Picture *picture, bool del = true);
242 
246  void removeAllPictures();
247 
254  void addPicture(FLAC::Picture *picture);
255 
256  protected:
261  void parse(const ByteVector &data);
262 
263  private:
264  class XiphCommentPrivate;
266  std::unique_ptr<XiphCommentPrivate> d;
267  };
268  } // namespace Ogg
269 } // namespace TagLib
270 
271 #endif
A generic, implicitly shared list.
Definition: tlist.h:53
A map for format-independent <key,values> tag representations.
Definition: tpropertymap.h:122
A simple, generic interface to common audio metadata fields.
Definition: tag.h:48
A wide string class suitable for unicode.
Definition: tstring.h:82
A byte vector.
Definition: tbytevector.h:45
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55
A generic, implicitly shared map.
Definition: tmap.h:44
A list of strings.
Definition: tstringlist.h:43
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
FLAC picture.
Definition: flacpicture.h:39
String TAGLIB_EXPORT genre(int index)
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
Ogg Vorbis comment implementation.
Definition: xiphcomment.h:70