![]() |
|
00001 /*************************************************************************** 00002 copyright : (C) 2002, 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_ID3V1TAG_H 00023 #define TAGLIB_ID3V1TAG_H 00024 00025 #include <tag.h> 00026 #include <tbytevector.h> 00027 00028 namespace TagLib { 00029 00030 class File; 00031 00033 00034 namespace ID3v1 { 00035 00037 00055 class StringHandler 00056 { 00057 public: 00062 virtual String parse(const ByteVector &data) const; 00063 00072 virtual ByteVector render(const String &s) const; 00073 }; 00074 00076 00095 class Tag : public TagLib::Tag 00096 { 00097 public: 00101 Tag(); 00102 00107 Tag(File *file, long tagOffset); 00108 00112 virtual ~Tag(); 00113 00118 ByteVector render() const; 00119 00124 static ByteVector fileIdentifier(); 00125 00126 // Reimplementations. 00127 00128 virtual String title() const; 00129 virtual String artist() const; 00130 virtual String album() const; 00131 virtual String comment() const; 00132 virtual String genre() const; 00133 virtual uint year() const; 00134 virtual uint track() const; 00135 00136 virtual void setTitle(const String &s); 00137 virtual void setArtist(const String &s); 00138 virtual void setAlbum(const String &s); 00139 virtual void setComment(const String &s); 00140 virtual void setGenre(const String &s); 00141 virtual void setYear(uint i); 00142 virtual void setTrack(uint i); 00143 00150 static void setStringHandler(const StringHandler *handler); 00151 00152 protected: 00156 void read(); 00160 void parse(const ByteVector &data); 00161 00162 private: 00163 Tag(const Tag &); 00164 Tag &operator=(const Tag &); 00165 00166 class TagPrivate; 00167 TagPrivate *d; 00168 }; 00169 } 00170 } 00171 00172 #endif