1/**************************************************************************
2 copyright : (C) 2005-2007 by Lukáš Lalinský
3 email : lalinsky@gmail.com
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_ASFTAG_H
27#define TAGLIB_ASFTAG_H
28
29#include "tag.h"
30#include "tlist.h"
31#include "tmap.h"
32#include "taglib_export.h"
33#include "asfattribute.h"
34
35namespace TagLib {
36
37 namespace ASF {
38
39 typedef List<Attribute> AttributeList;
40 typedef Map<String, AttributeList> AttributeListMap;
41
42 class TAGLIB_EXPORT Tag : public TagLib::Tag {
43
44 friend class File;
45
46 public:
47
48 Tag();
49
50 virtual ~Tag();
51
52 /*!
53 * Returns the track name.
54 */
55 virtual String title() const;
56
57 /*!
58 * Returns the artist name.
59 */
60 virtual String artist() const;
61
62 /*!
63 * Returns the album name; if no album name is present in the tag
64 * String::null will be returned.
65 */
66 virtual String album() const;
67
68 /*!
69 * Returns the track comment.
70 */
71 virtual String comment() const;
72
73 /*!
74 * Returns the genre name; if no genre is present in the tag String::null
75 * will be returned.
76 */
77 virtual String genre() const;
78
79 /*!
80 * Returns the rating.
81 */
82 virtual String rating() const;
83
84 /*!
85 * Returns the genre name; if no genre is present in the tag String::null
86 * will be returned.
87 */
88 virtual String copyright() const;
89
90 /*!
91 * Returns the year; if there is no year set, this will return 0.
92 */
93 virtual uint year() const;
94
95 /*!
96 * Returns the track number; if there is no track number set, this will
97 * return 0.
98 */
99 virtual uint track() const;
100
101 /*!
102 * Sets the title to \a s.
103 */
104 virtual void setTitle(const String &s);
105
106 /*!
107 * Sets the artist to \a s.
108 */
109 virtual void setArtist(const String &s);
110
111 /*!
112 * Sets the album to \a s. If \a s is String::null then this value will be
113 * cleared.
114 */
115 virtual void setAlbum(const String &s);
116
117 /*!
118 * Sets the comment to \a s.
119 */
120 virtual void setComment(const String &s);
121
122 /*!
123 * Sets the rating to \a s.
124 */
125 virtual void setRating(const String &s);
126
127 /*!
128 * Sets the copyright to \a s.
129 */
130 virtual void setCopyright(const String &s);
131
132 /*!
133 * Sets the genre to \a s.
134 */
135 virtual void setGenre(const String &s);
136
137 /*!
138 * Sets the year to \a i. If \a s is 0 then this value will be cleared.
139 */
140 virtual void setYear(uint i);
141
142 /*!
143 * Sets the track to \a i. If \a s is 0 then this value will be cleared.
144 */
145 virtual void setTrack(uint i);
146
147 /*!
148 * Returns true if the tag does not contain any data. This should be
149 * reimplemented in subclasses that provide more than the basic tagging
150 * abilities in this class.
151 */
152 virtual bool isEmpty() const;
153
154 /*!
155 * Returns a reference to the item list map. This is an AttributeListMap of
156 * all of the items in the tag.
157 *
158 * This is the most powerfull structure for accessing the items of the tag.
159 */
160 AttributeListMap &attributeListMap();
161
162 /*!
163 * Removes the \a key attribute from the tag
164 */
165 void removeItem(const String &name);
166
167 /*!
168 * Sets the \a key attribute to the value of \a attribute. If an attribute
169 * with the \a key is already present, it will be replaced.
170 */
171 void setAttribute(const String &name, const Attribute &attribute);
172
173 /*!
174 * Sets the \a key attribute to the value of \a attribute. If an attribute
175 * with the \a key is already present, it will be added to the list.
176 */
177 void addAttribute(const String &name, const Attribute &attribute);
178
179 PropertyMap properties() const;
180 void removeUnsupportedProperties(const StringList& properties);
181 PropertyMap setProperties(const PropertyMap &properties);
182
183 private:
184
185 class TagPrivate;
186 TagPrivate *d;
187 };
188 }
189}
190#endif
191