id3lib
3.8.3
Main Page
Namespaces
Classes
Files
File List
File Members
src
header_tag.h
Go to the documentation of this file.
1
// -*- C++ -*-
2
// $Id: header_tag.h,v 1.2 2002/07/31 13:20:49 t1mpy Exp $
3
4
// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
5
// Copyright 1999, 2000 Scott Thomas Haug
6
// Copyright 2002 Thijmen Klok (thijmen@id3lib.org)
7
8
// This library is free software; you can redistribute it and/or modify it
9
// under the terms of the GNU Library General Public License as published by
10
// the Free Software Foundation; either version 2 of the License, or (at your
11
// option) any later version.
12
//
13
// This library is distributed in the hope that it will be useful, but WITHOUT
14
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
16
// License for more details.
17
//
18
// You should have received a copy of the GNU Library General Public License
19
// along with this library; if not, write to the Free Software Foundation,
20
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
22
// The id3lib authors encourage improvements and optimisations to be sent to
23
// the id3lib coordinator. Please see the README file for details on where to
24
// send such submissions. See the AUTHORS file for a list of people who have
25
// contributed to id3lib. See the ChangeLog file for a list of changes to
26
// id3lib. These files are distributed with id3lib at
27
// http://download.sourceforge.net/id3lib/
28
29
#ifndef _ID3LIB_HEADER_TAG_H_
30
#define _ID3LIB_HEADER_TAG_H_
31
32
#include "
header.h
"
33
34
class
ID3_TagHeader
:
public
ID3_Header
35
{
36
public
:
37
38
enum
39
{
40
HEADER_FLAG_UNSYNC
= 1 << 7,
41
HEADER_FLAG_EXTENDED
= 1 << 6,
42
HEADER_FLAG_EXPERIMENTAL
= 1 << 5,
43
HEADER_FLAG_FOOTER
= 1 << 4
44
};
45
46
enum
47
{
48
EXT_HEADER_FLAG_BIT1
= 1 << 7,
49
EXT_HEADER_FLAG_BIT2
= 1 << 6,
50
EXT_HEADER_FLAG_BIT3
= 1 << 5,
51
EXT_HEADER_FLAG_BIT4
= 1 << 4
52
};
53
54
ID3_TagHeader
() :
ID3_Header
() { ; }
55
virtual
~ID3_TagHeader
() { ; }
56
ID3_TagHeader
(
const
ID3_TagHeader
& rhs) :
ID3_Header
() { *
this
= rhs; }
57
58
bool
SetSpec
(
ID3_V2Spec
);
59
size_t
Size
()
const
;
60
void
Render
(
ID3_Writer
&)
const
;
61
bool
Parse
(
ID3_Reader
&);
62
void
ParseExtended
(
ID3_Reader
&);
63
ID3_TagHeader
&
operator=
(
const
ID3_TagHeader
&hdr)
64
{ this->
ID3_Header::operator=
(hdr);
return
*
this
; }
65
66
bool
SetUnsync
(
bool
b)
67
{
68
bool
changed =
_flags
.
set
(
HEADER_FLAG_UNSYNC
, b);
69
_changed
=
_changed
|| changed;
70
return
changed;
71
}
72
bool
GetUnsync
()
const
{
return
_flags
.
test
(
HEADER_FLAG_UNSYNC
); }
73
bool
SetExtended
(
bool
b)
74
{
75
bool
changed =
_flags
.
set
(
HEADER_FLAG_EXTENDED
, b);
76
_changed
=
_changed
|| changed;
77
return
changed;
78
}
79
bool
GetExtended
()
const
{
return
_flags
.
test
(
HEADER_FLAG_EXTENDED
); }
80
bool
SetExperimental
(
bool
b)
81
{
82
bool
changed =
_flags
.
set
(
HEADER_FLAG_EXPERIMENTAL
, b);
83
_changed
=
_changed
|| changed;
84
return
changed;
85
}
86
bool
GetExperimental
()
const
{
return
_flags
.
test
(
HEADER_FLAG_EXPERIMENTAL
); }
87
bool
SetFooter
(
bool
b)
88
{
89
bool
changed =
_flags
.
set
(
HEADER_FLAG_FOOTER
, b);
90
_changed
=
_changed
|| changed;
91
return
changed;
92
}
93
bool
GetFooter
()
const
{
return
_flags
.
test
(
HEADER_FLAG_FOOTER
); }
94
95
// id3v2 tag header signature: $49 44 33 MM mm GG ss ss ss ss
96
// MM = major version (will never be 0xFF)
97
// mm = minor version (will never be 0xFF)
98
// ff = flags byte
99
// ss = size bytes (less than $80)
100
static
const
char
*
const
ID
;
101
enum
102
{
103
ID_SIZE
= 3,
104
MAJOR_OFFSET
= 3,
105
MINOR_OFFSET
= 4,
106
FLAGS_OFFSET
= 5,
107
SIZE_OFFSET
= 6,
108
SIZE
= 10
// does not include extented headers
109
};
110
111
};
112
113
#endif
/* _ID3LIB_HEADER_TAG_H_ */
Generated on Sun Oct 7 2012 11:33:38 for id3lib by
1.8.1.1