Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

src/header_tag.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 // $Id: header_tag.h,v 1.1 2000/10/24 16:14:45 eldamitri Exp $
00003 
00004 // id3lib: a C++ library for creating and manipulating id3v1/v2 tags
00005 // Copyright 1999, 2000  Scott Thomas Haug
00006 
00007 // This library is free software; you can redistribute it and/or modify it
00008 // under the terms of the GNU Library General Public License as published by
00009 // the Free Software Foundation; either version 2 of the License, or (at your
00010 // option) any later version.
00011 //
00012 // This library is distributed in the hope that it will be useful, but WITHOUT
00013 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00015 // License for more details.
00016 //
00017 // You should have received a copy of the GNU Library General Public License
00018 // along with this library; if not, write to the Free Software Foundation,
00019 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00020 
00021 // The id3lib authors encourage improvements and optimisations to be sent to
00022 // the id3lib coordinator.  Please see the README file for details on where to
00023 // send such submissions.  See the AUTHORS file for a list of people who have
00024 // contributed to id3lib.  See the ChangeLog file for a list of changes to
00025 // id3lib.  These files are distributed with id3lib at
00026 // http://download.sourceforge.net/id3lib/
00027 
00028 #ifndef _ID3LIB_HEADER_TAG_H_
00029 #define _ID3LIB_HEADER_TAG_H_
00030 
00031 #include "header.h"
00032 
00033 class ID3_TagHeader : public ID3_Header
00034 {
00035 public:
00036 
00037   enum
00038   {
00039     UNSYNC       = 1 << 7,
00040     EXTENDED     = 1 << 6,
00041     EXPERIMENTAL = 1 << 5
00042   };
00043 
00044   ID3_TagHeader() : ID3_Header() { ; }
00045   virtual ~ID3_TagHeader() { ; }
00046   ID3_TagHeader(const ID3_TagHeader& rhs) : ID3_Header() { *this = rhs; }
00047 
00048   bool   SetSpec(ID3_V2Spec);
00049   size_t Size() const;
00050   void Render(ID3_Writer&) const;
00051   bool Parse(ID3_Reader&);
00052   ID3_TagHeader& operator=(const ID3_TagHeader&hdr)
00053   { this->ID3_Header::operator=(hdr); return *this; }
00054 
00055   bool SetUnsync(bool b)
00056   {
00057     bool changed = _flags.set(UNSYNC, b);
00058     _changed = _changed || changed;
00059     return changed;
00060   }
00061   bool GetUnsync() const { return _flags.test(UNSYNC); }
00062   bool SetExtended(bool b)
00063   {
00064     bool changed = _flags.set(EXTENDED, b);
00065     _changed = _changed || changed;
00066     return changed;
00067   }
00068   bool GetExtended() const { return _flags.test(EXTENDED); }
00069   bool SetExperimental(bool b)
00070   {
00071     bool changed = _flags.set(EXPERIMENTAL, b);
00072     _changed = _changed || changed;
00073     return changed;
00074   }
00075   bool GetExperimental() const { return _flags.test(EXPERIMENTAL); }
00076 
00077   // id3v2 tag header signature:  $49 44 33 MM mm GG ss ss ss ss
00078   // MM = major version (will never be 0xFF)
00079   // mm = minor version (will never be 0xFF)
00080   // ff = flags byte 
00081   // ss = size bytes (less than $80)
00082   static const char* const ID;
00083   enum
00084   {
00085     ID_SIZE        = 3,
00086     MAJOR_OFFSET   = 3,
00087     MINOR_OFFSET   = 4,
00088     FLAGS_OFFSET   = 5,
00089     SIZE_OFFSET    = 6,
00090     SIZE           = 10
00091   };
00092   
00093 };
00094 
00095 #endif /* _ID3LIB_HEADER_TAG_H_ */

Generated at Sat Sep 8 15:51:09 2001 for id3lib by doxygen1.2.8 written by Dimitri van Heesch, © 1997-2001