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 "tag.h"
30 #include "tlist.h"
31 #include "tmap.h"
32 #include "tstring.h"
33 #include "tstringlist.h"
34 #include "tbytevector.h"
35 #include "flacpicture.h"
36 #include "taglib_export.h"
37 
38 namespace TagLib {
39 
40  namespace Ogg {
41 
49 
51 
66  {
67  public:
71  XiphComment();
72 
76  XiphComment(const ByteVector &data);
77 
81  virtual ~XiphComment();
82 
83  virtual String title() const;
84  virtual String artist() const;
85  virtual String album() const;
86  virtual String comment() const;
87  virtual String genre() const;
88  virtual unsigned int year() const;
89  virtual unsigned int track() const;
90 
91  virtual void setTitle(const String &s);
92  virtual void setArtist(const String &s);
93  virtual void setAlbum(const String &s);
94  virtual void setComment(const String &s);
95  virtual void setGenre(const String &s);
96  virtual void setYear(unsigned int i);
97  virtual void setTrack(unsigned int i);
98 
99  virtual bool isEmpty() const;
100 
104  unsigned int fieldCount() const;
105 
142  const FieldListMap &fieldListMap() const;
143 
151  PropertyMap properties() const;
152 
160  PropertyMap setProperties(const PropertyMap&);
161 
165  static bool checkKey(const String&);
166 
171  String vendorID() const;
172 
180  void addField(const String &key, const String &value, bool replace = true);
181 
188  // BIC: remove and merge with below
189  void removeField(const String &key, const String &value = String::null);
190 
196  void removeFields(const String &key);
197 
203  void removeFields(const String &key, const String &value);
204 
210  void removeAllFields();
211 
217  bool contains(const String &key) const;
218 
222  ByteVector render() const; // BIC: remove and merge with below
223 
231  ByteVector render(bool addFramingBit) const;
232 
233 
237  List<FLAC::Picture *> pictureList();
238 
243  void removePicture(FLAC::Picture *picture, bool del = true);
244 
248  void removeAllPictures();
249 
256  void addPicture(FLAC::Picture *picture);
257 
258  protected:
263  void parse(const ByteVector &data);
264 
265  private:
266  XiphComment(const XiphComment &);
267  XiphComment &operator=(const XiphComment &);
268 
269  class XiphCommentPrivate;
270  XiphCommentPrivate *d;
271  };
272  }
273 }
274 
275 #endif
A generic, implicitly shared list.
Definition: tlist.h:53
static String null
Definition: tstring.h:528
A map for format-independent tag representations.
Definition: tpropertymap.h:104
Definition: tag.h:46
A wide string class suitable for unicode.
Definition: tstring.h:84
A byte vector.
Definition: tbytevector.h:45
A generic, implicitly shared map.
Definition: tmap.h:43
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
Definition: flacpicture.h:39
Map< String, StringList > FieldListMap
Definition: xiphcomment.h:48
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:65