xiphcomment.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2002 - 2008 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  *   Alternatively, this file is available under the Mozilla Public        *
00022  *   License Version 1.1.  You may obtain a copy of the License at         *
00023  *   http://www.mozilla.org/MPL/                                           *
00024  ***************************************************************************/
00025 
00026 #ifndef TAGLIB_VORBISCOMMENT_H
00027 #define TAGLIB_VORBISCOMMENT_H
00028 
00029 #include "tag.h"
00030 #include "tlist.h"
00031 #include "tmap.h"
00032 #include "tstring.h"
00033 #include "tstringlist.h"
00034 #include "tbytevector.h"
00035 #include "taglib_export.h"
00036 
00037 namespace TagLib {
00038 
00039   namespace Ogg {
00040 
00047     typedef Map<String, StringList> FieldListMap;
00048 
00050 
00064     class TAGLIB_EXPORT XiphComment : public TagLib::Tag
00065     {
00066     public:
00070       XiphComment();
00071 
00075       XiphComment(const ByteVector &data);
00076 
00080       virtual ~XiphComment();
00081 
00082       virtual String title() const;
00083       virtual String artist() const;
00084       virtual String album() const;
00085       virtual String comment() const;
00086       virtual String genre() const;
00087       virtual uint year() const;
00088       virtual uint track() const;
00089 
00090       virtual void setTitle(const String &s);
00091       virtual void setArtist(const String &s);
00092       virtual void setAlbum(const String &s);
00093       virtual void setComment(const String &s);
00094       virtual void setGenre(const String &s);
00095       virtual void setYear(uint i);
00096       virtual void setTrack(uint i);
00097 
00098       virtual bool isEmpty() const;
00099 
00103       uint fieldCount() const;
00104 
00141       const FieldListMap &fieldListMap() const;
00142 
00147       String vendorID() const;
00148 
00156       void addField(const String &key, const String &value, bool replace = true);
00157 
00162       void removeField(const String &key, const String &value = String::null);
00163 
00169       bool contains(const String &key) const;
00170 
00174       ByteVector render() const; // BIC: remove and merge with below
00175 
00183       ByteVector render(bool addFramingBit) const;
00184 
00185     protected:
00190       void parse(const ByteVector &data);
00191 
00192     private:
00193       XiphComment(const XiphComment &);
00194       XiphComment &operator=(const XiphComment &);
00195 
00196       class XiphCommentPrivate;
00197       XiphCommentPrivate *d;
00198     };
00199   }
00200 }
00201 
00202 #endif