TagLib  2.2.1
matroskatag.h
Go to the documentation of this file.
1 /***************************************************************************
2  * This library is free software; you can redistribute it and/or modify *
3  * it under the terms of the GNU Lesser General Public License version *
4  * 2.1 as published by the Free Software Foundation. *
5  * *
6  * This library is distributed in the hope that it will be useful, but *
7  * WITHOUT ANY WARRANTY; without even the implied warranty of *
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
9  * Lesser General Public License for more details. *
10  * *
11  * You should have received a copy of the GNU Lesser General Public *
12  * License along with this library; if not, write to the Free Software *
13  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
14  * 02110-1301 USA *
15  * *
16  * Alternatively, this file is available under the Mozilla Public *
17  * License Version 1.1. You may obtain a copy of the License at *
18  * http://www.mozilla.org/MPL/ *
19  ***************************************************************************/
20 
21 #ifndef TAGLIB_MATROSKATAG_H
22 #define TAGLIB_MATROSKATAG_H
23 
24 #include <memory>
25 
26 #include "tag.h"
27 #include "tlist.h"
28 #include "matroskaelement.h"
29 #include "matroskasimpletag.h"
30 
31 namespace TagLib {
32  class File;
33 
34  namespace EBML {
35  class MkTags;
36  }
37 
38  namespace Matroska {
41 
43  class TAGLIB_EXPORT Tag : public TagLib::Tag
44 #ifndef DO_NOT_DOCUMENT
45  , private Element
46 #endif
47  {
48  public:
52  Tag();
53 
54  ~Tag() override;
55  String title() const override;
56  String artist() const override;
57  String album() const override;
58  String comment() const override;
59  String genre() const override;
60  unsigned int year() const override;
61  unsigned int track() const override;
62  void setTitle(const String &s) override;
63  void setArtist(const String &s) override;
64  void setAlbum(const String &s) override;
65  void setComment(const String &s) override;
66  void setGenre(const String &s) override;
67  void setYear(unsigned int i) override;
68  void setTrack(unsigned int i) override;
69  bool isEmpty() const override;
70  PropertyMap properties() const override;
71  PropertyMap setProperties(const PropertyMap &propertyMap) override;
72  void removeUnsupportedProperties(const StringList &properties) override;
73 
77  StringList complexPropertyKeys() const override;
78 
85  List<VariantMap> complexProperties(const String &key) const override;
86 
95  bool setComplexProperties(const String &key, const List<VariantMap> &value) override;
96 
100  void addSimpleTag(const SimpleTag &tag);
101 
105  void addSimpleTags(const SimpleTagsList &simpleTags);
106 
110  void insertSimpleTag(unsigned int index, const SimpleTag &tag);
111 
115  void removeSimpleTag(unsigned int index);
116 
120  void removeSimpleTag(const String &name, SimpleTag::TargetTypeValue targetTypeValue,
121  unsigned long long trackUid = 0);
122 
126  // BIC: Merge with the method above
127  void removeSimpleTag(const String &name, SimpleTag::TargetTypeValue targetTypeValue,
128  unsigned long long trackUid, unsigned long long editionUid,
129  unsigned long long chapterUid = 0, unsigned long long attachmentUid = 0);
130 
134  void clearSimpleTags();
135 
139  const SimpleTagsList &simpleTagsList() const;
140 
141  private:
142  friend class File;
143  friend class EBML::MkTags;
144  class TagPrivate;
145 
146  bool setTag(const String &key, const String &value);
147  void setSegmentTitle(const String &title);
148 
149  // private Element implementation
150  ByteVector renderInternal() override;
151 
153  std::unique_ptr<TagPrivate> d;
154  };
155  }
156 }
157 
158 #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
TargetTypeValue
Specifies the level of other elements the tag value applies to.
Definition: matroskasimpletag.h:38
A wide string class suitable for unicode.
Definition: tstring.h:82
A byte vector.
Definition: tbytevector.h:45
Matroska tag implementation.
Definition: matroskatag.h:43
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55
Attribute of Matroska metadata.
Definition: matroskasimpletag.h:34
A list of strings.
Definition: tstringlist.h:43
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
String TAGLIB_EXPORT genre(int index)
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
An implementation of TagLib::File with Matroska specific methods.
Definition: matroskafile.h:39