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., 51 Franklin Street, Fifth Floor, Boston, MA         *
00019  *   02110-1301  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 "flacpicture.h"
00036 #include "taglib_export.h"
00037 
00038 namespace TagLib {
00039 
00040   namespace Ogg {
00041 
00048     typedef Map<String, StringList> FieldListMap;
00049 
00051 
00065     class TAGLIB_EXPORT XiphComment : public TagLib::Tag
00066     {
00067     public:
00071       XiphComment();
00072 
00076       XiphComment(const ByteVector &data);
00077 
00081       virtual ~XiphComment();
00082 
00083       virtual String title() const;
00084       virtual String artist() const;
00085       virtual String album() const;
00086       virtual String comment() const;
00087       virtual String genre() const;
00088       virtual unsigned int year() const;
00089       virtual unsigned int track() const;
00090 
00091       virtual void setTitle(const String &s);
00092       virtual void setArtist(const String &s);
00093       virtual void setAlbum(const String &s);
00094       virtual void setComment(const String &s);
00095       virtual void setGenre(const String &s);
00096       virtual void setYear(unsigned int i);
00097       virtual void setTrack(unsigned int i);
00098 
00099       virtual bool isEmpty() const;
00100 
00104       unsigned int fieldCount() const;
00105 
00142       const FieldListMap &fieldListMap() const;
00143 
00151       PropertyMap properties() const;
00152 
00160       PropertyMap setProperties(const PropertyMap&);
00161 
00165       static bool checkKey(const String&);
00166 
00171       String vendorID() const;
00172 
00180       void addField(const String &key, const String &value, bool replace = true);
00181 
00188       // BIC: remove and merge with below
00189       void removeField(const String &key, const String &value = String::null);
00190 
00196       void removeFields(const String &key);
00197 
00203       void removeFields(const String &key, const String &value);
00204 
00210       void removeAllFields();
00211 
00217       bool contains(const String &key) const;
00218 
00222       ByteVector render() const; // BIC: remove and merge with below
00223 
00231       ByteVector render(bool addFramingBit) const;
00232 
00233 
00237       List<FLAC::Picture *> pictureList();
00238 
00243       void removePicture(FLAC::Picture *picture, bool del = true);
00244 
00248       void removeAllPictures();
00249 
00256       void addPicture(FLAC::Picture *picture);
00257 
00258     protected:
00263       void parse(const ByteVector &data);
00264 
00265     private:
00266       XiphComment(const XiphComment &);
00267       XiphComment &operator=(const XiphComment &);
00268 
00269       class XiphCommentPrivate;
00270       XiphCommentPrivate *d;
00271     };
00272   }
00273 }
00274 
00275 #endif