00001 /*************************************************************************** 00002 copyright : (C) 2005 by Andy Leadbetter 00003 email : andrew.leadbetter@gmail.com 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, * 00019 * MA 02110-1301 USA * 00020 ***************************************************************************/ 00021 #ifndef TAGLIB_MP4TAG_H 00022 #define TAGLIB_MP4TAG_H 00023 00024 #include <tag.h> 00025 #include "mp4file.h" 00026 #include <mp4.h> 00027 00028 namespace TagLib { 00029 00030 namespace MP4 { 00034 class Tag : public TagLib::Tag 00035 { 00036 public: 00037 static const int Undefined = -1; 00038 00039 Tag(); 00040 00044 void readTags( MP4FileHandle mp4file); 00045 00049 virtual ~Tag(); 00050 00055 virtual String title() const { return m_title; } 00056 00061 virtual String artist() const { return m_artist; } 00062 00067 virtual String album() const { return m_album; } 00068 00073 virtual String comment() const { return m_comment; } 00074 00079 virtual String genre() const { return m_genre; } 00080 00085 virtual String composer() const { return m_composer; } 00086 00090 virtual uint year() const { return m_year; } 00091 00096 virtual uint track() const { return m_track; } 00097 00102 virtual uint disk() const { return m_disk; } 00103 00107 virtual uint bpm() const { return m_bpm; } 00108 00113 virtual const ByteVector &cover() const { return m_image; } 00114 00119 virtual int compilation() const { return m_compilation; } 00120 00125 virtual void setTitle(const String &s) { m_title = s; } 00126 00131 virtual void setArtist(const String &s) { m_artist = s; } 00132 00137 virtual void setAlbum(const String &s) { m_album = s; } 00138 00143 virtual void setComment(const String &s) { m_comment = s; } 00144 00152 virtual void setGenre(const String &s) { m_genre = s; } 00153 00157 virtual void setYear(uint i) { m_year = i; } 00158 00162 virtual void setTrack(uint i) { m_track = i; } 00163 00167 virtual void setDisk(uint i) { m_disk = i; } 00168 00172 virtual void setBpm(uint i) { m_bpm = i; } 00173 00177 virtual void setCompilation(bool compilation) { m_compilation = compilation ? 1 : 0; } 00178 00183 virtual void setComposer(const String &s) { m_composer = s; } 00184 00189 virtual void setCover(const ByteVector &i) { m_image = i; } 00190 00196 virtual bool isEmpty() const; 00197 00209 static void duplicate(const Tag *source, Tag *target, bool overwrite = true); 00210 00211 protected: 00212 String m_title; 00213 String m_artist; 00214 String m_album; 00215 String m_comment; 00216 String m_genre; 00217 String m_composer; 00218 uint m_year; 00219 uint m_track; 00220 uint m_disk; 00221 uint m_bpm; 00222 int m_compilation; 00223 ByteVector m_image; 00224 }; 00225 } 00226 } 00227 #endif