d->genre = ID3v1::genreIndex(s);
}
-void ID3v1::Tag::setYear(uint i)
+void ID3v1::Tag::setYear(TagLib::uint i)
{
d->year = i > 0 ? String::number(i) : String::null;
}
-void ID3v1::Tag::setTrack(uint i)
+void ID3v1::Tag::setTrack(TagLib::uint i)
{
d->track = i < 256 ? i : 0;
}
+TagLib::uint ID3v1::Tag::genreNumber() const
+{
+ return d->genre;
+}
+
+void ID3v1::Tag::setGenreNumber(TagLib::uint i)
+{
+ d->genre = i < 256 ? i : 255;
+}
+
void ID3v1::Tag::setStringHandler(const StringHandler *handler)
{
if (handler)
virtual String album() const;
virtual String comment() const;
virtual String genre() const;
- virtual uint year() const;
- virtual uint track() const;
+ virtual TagLib::uint year() const;
+ virtual TagLib::uint track() const;
virtual void setTitle(const String &s);
virtual void setArtist(const String &s);
virtual void setAlbum(const String &s);
virtual void setComment(const String &s);
virtual void setGenre(const String &s);
- virtual void setYear(uint i);
- virtual void setTrack(uint i);
+ virtual void setYear(TagLib::uint i);
+ virtual void setTrack(TagLib::uint i);
+
+ /*!
+ * Returns the genre in number.
+ *
+ * /note Normally 255 indicates that this tag contains no genre.
+ */
+ TagLib::uint genreNumber() const;
+
+ /*!
+ * Sets the genre in number to \a i.
+ *
+ * /note Valid value is from 0 up to 255. Normally 255 indicates that
+ * this tag contains no genre.
+ */
+ void setGenreNumber(TagLib::uint i);
/*!
* Sets the string handler that decides how the ID3v1 data will be