xiphcomment.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2003 by Scott Wheeler
00003     email                : wheeler@kde.org
00004  ***************************************************************************/
00005 
00006 /***************************************************************************
00007  *   This library is free software; you can redistribute it and/or modify  *
00008  *   it  under the terms of the GNU Lesser General Public License version  *
00009  *   2.1 as published by the Free Software Foundation.                     *
00010  *                                                                         *
00011  *   This library is distributed in the hope that it will be useful, but   *
00012  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014  *   Lesser General Public License for more details.                       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with this library; if not, write to the Free Software   *
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
00019  *   USA                                                                   *
00020  ***************************************************************************/
00021 
00022 #ifndef TAGLIB_VORBISCOMMENT_H
00023 #define TAGLIB_VORBISCOMMENT_H
00024 
00025 #include "tag.h"
00026 #include "tlist.h"
00027 #include "tmap.h"
00028 #include "tstring.h"
00029 #include "tstringlist.h"
00030 #include "tbytevector.h"
00031 
00032 namespace TagLib {
00033 
00034   namespace Ogg {
00035 
00042     typedef Map<String, StringList> FieldListMap;
00043 
00045 
00059     class XiphComment : public TagLib::Tag
00060     {
00061     public:
00065       XiphComment();
00066 
00070       XiphComment(const ByteVector &data);
00071 
00075       virtual ~XiphComment();
00076 
00077       virtual String title() const;
00078       virtual String artist() const;
00079       virtual String album() const;
00080       virtual String comment() const;
00081       virtual String genre() const;
00082       virtual uint year() const;
00083       virtual uint track() const;
00084 
00085       virtual void setTitle(const String &s);
00086       virtual void setArtist(const String &s);
00087       virtual void setAlbum(const String &s);
00088       virtual void setComment(const String &s);
00089       virtual void setGenre(const String &s);
00090       virtual void setYear(uint i);
00091       virtual void setTrack(uint i);
00092 
00093       virtual bool isEmpty() const;
00094 
00098       uint fieldCount() const;
00099 
00136       const FieldListMap &fieldListMap() const;
00137 
00142       String vendorID() const;
00143 
00151       void addField(const String &key, const String &value, bool replace = true);
00152 
00157       void removeField(const String &key, const String &value = String::null);
00158 
00162       ByteVector render() const; // BIC: remove and merge with below
00163 
00171       ByteVector render(bool addFramingBit) const;
00172 
00173     protected:
00178       void parse(const ByteVector &data);
00179 
00180     private:
00181       XiphComment(const XiphComment &);
00182       XiphComment &operator=(const XiphComment &);
00183 
00184       class XiphCommentPrivate;
00185       XiphCommentPrivate *d;
00186     };
00187   }
00188 }
00189 
00190 #endif