Class ID3_ExtendedHeader

Description

The extended header contains information that can provide further insight in the structure of the tag, but is not vital to the correct parsing of the tag information; hence the extended header is optional.

Located in /ID3/ExtendedHeader.php (line 55)

ID3_Object
   |
   --ID3_ExtendedHeader
Class Constant Summary
 CRC32 = 32
 RESTRICTED = 16
 UPDATE = 64
Method Summary
ID3_ExtendedHeader __construct ([Reader $reader = null], [ &$options = array()], Array $options)
integer getCrc ()
integer getFlags ( $flags)
integer getPadding ()
integer getRestrictions ()
integer getSize ()
boolean hasFlag (integer $flag)
void setCrc (integer $crc)
void setFlags (integer $flags)
void setPadding (integer $padding)
void setRestrictions (integer $restrictions)
void useCrc (boolean $useCrc)
string __toString ()
Variables

Inherited Variables

Inherited from ID3_Object

ID3_Object::$_reader
Methods
Constructor __construct (line 110)

Constructs the class with given parameters and reads object related data from the ID3v2 tag.

  • access: public
ID3_ExtendedHeader __construct ([Reader $reader = null], [ &$options = array()], Array $options)
  • Reader $reader: The reader object.
  • Array $options: The options array.
  • &$options

Redefinition of:
ID3_Object::__construct()
Constructs the class with given parameters and reads object related data from the ID3v2 tag.
getCrc (line 184)

Returns the CRC-32 data.

  • access: public
integer getCrc ()
getFlags (line 170)

Returns the flags byte.

  • access: public
integer getFlags ( $flags)
  • $flags
getPadding (line 285)

Returns the total padding size, or simply the total tag size excluding the frames and the headers.

  • deprecated: ID3v2.3.0
  • access: public
integer getPadding ()
getRestrictions (line 266)

Returns the restrictions. For some applications it might be desired to

restrict a tag in more ways than imposed by the ID3v2 specification. Note that the presence of these restrictions does not affect how the tag is decoded, merely how it was restricted before encoding. If this flag is set the tag is restricted as follows:

 Restrictions %ppqrrstt

 p - Tag size restrictions

   00   No more than 128 frames and 1 MB total tag size.
   01   No more than 64 frames and 128 KB total tag size.
   10   No more than 32 frames and 40 KB total tag size.
   11   No more than 32 frames and 4 KB total tag size.

 q - Text encoding restrictions

   0    No restrictions
   1    Strings are only encoded with ISO-8859-1 or UTF-8.

 r - Text fields size restrictions

   00   No restrictions
   01   No string is longer than 1024 characters.
   10   No string is longer than 128 characters.
   11   No string is longer than 30 characters.

   Note that nothing is said about how many bytes is used to represent those
   characters, since it is encoding dependent. If a text frame consists of
   more than one string, the sum of the strungs is restricted as stated.

 s - Image encoding restrictions

   0   No restrictions
   1   Images are encoded only with PNG [PNG] or JPEG [JFIF].

 t - Image size restrictions

   00  No restrictions
   01  All images are 256x256 pixels or smaller.
   10  All images are 64x64 pixels or smaller.
   11  All images are exactly 64x64 pixels, unless required otherwise.

  • access: public
integer getRestrictions ()
getSize (line 154)

Returns the extended header size in bytes.

  • access: public
integer getSize ()
hasFlag (line 163)

Checks whether or not the flag is set. Returns true if the flag is set, false otherwise.

  • access: public
boolean hasFlag (integer $flag)
  • integer $flag: The flag to query.
setCrc (line 210)

Sets the CRC-32. The CRC-32 value is calculated of all the frames in the tag and includes padding.

  • access: public
void setCrc (integer $crc)
  • integer $crc: The 32-bit CRC value.
setFlags (line 177)

Sets the flags byte.

  • access: public
void setFlags (integer $flags)
  • integer $flags: The flags byte.
setPadding (line 294)

Sets the total padding size, or simply the total tag size excluding the frames and the headers.

  • deprecated: ID3v2.3.0
  • access: public
void setPadding (integer $padding)
  • integer $padding: The padding size.
setRestrictions (line 273)

Sets the restrictions byte. See #getRestrictions for more.

  • access: public
void setRestrictions (integer $restrictions)
  • integer $restrictions: The restrictions byte.
useCrc (line 196)

Sets whether the CRC-32 should be generated upon tag write.

  • access: public
void useCrc (boolean $useCrc)
  • boolean $useCrc: Whether CRC-32 should be generated.
__toString (line 301)

Returns the header raw data.

  • access: public
string __toString ()

Inherited Methods

Inherited From ID3_Object

ID3_Object::__construct()
ID3_Object::decodeSynchsafe32()
ID3_Object::decodeUnsynchronisation()
ID3_Object::encodeSynchsafe32()
ID3_Object::encodeUnsynchronisation()
ID3_Object::explodeString8()
ID3_Object::explodeString16()
ID3_Object::getOption()
ID3_Object::getOptions()
ID3_Object::setOption()
ID3_Object::setOptions()
ID3_Object::__get()
ID3_Object::__set()
Class Constants
CRC32 = 32 (line 79)
  • since: ID3v2.4.0 A flag to denote that a CRC-32 data is included in the extended header. The CRC is calculated on all the data between the header and footer as indicated by the header's tag length field, minus the extended header. Note that this includes the padding (if there is any), but excludes the footer. The CRC-32 is stored as an 35 bit synchsafe integer, leaving the upper four bits always zeroed.
  • since: ID3v2.3.0 The CRC is calculated before unsynchronisation on the data between the extended header and the padding, i.e. the frames and only the frames.
RESTRICTED = 16 (line 86)

A flag to denote whether or not the tag has restrictions applied on it.

  • since: ID3v2.4.0
UPDATE = 64 (line 65)

A flag to denote that the present tag is an update of a tag found earlier in the present file or stream. If frames defined as unique are found in the present tag, they are to override any corresponding ones found in the earlier tag. This flag has no corresponding data.

  • since: ID3v2.4.0

Documentation generated on Fri, 05 Sep 2008 20:18:38 +0300 by phpDocumentor 1.4.1