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

ID3_Frame Class Reference

The representative class of an id3v2 frame. More...

#include <frame.h>

Inheritance diagram for ID3_Frame::

ID3_Speccable List of all members.

Public Methods

 ID3_Frame (ID3_FrameID id=ID3FID_NOFRAME)
 Default constructor; accepts as a default parameter the type of frame to create. More...

 ID3_Frame (const ID3_FrameHeader &)
 ID3_Frame (const ID3_Frame &)
virtual ~ID3_Frame ()
 Destructor. More...

void Clear ()
 Clears the frame of all data and resets the frame such that it can take on the form of any id3v2 frame that id3lib supports. More...

bool SetID (ID3_FrameID id)
 Establishes the internal structure of an ID3_Frame object so that it represents the id3v2 frame indicated by the parameter. More...

ID3_FrameID GetID () const
ID3_FieldField (ID3_FieldID name) const
 Returns a reference to the frame's internal field indicated by the parameter. More...

const char * GetDescription () const
const char * GetTextID () const
ID3_Frame & operator= (const ID3_Frame &)
bool HasChanged () const
size_t Parse (const uchar *buffer, size_t size)
size_t Size ()
size_t Render (uchar *buffer) const
bool Contains (ID3_FieldID fld) const
bool SetSpec (ID3_V2Spec)
ID3_V2Spec GetSpec () const
bool SetCompression (bool b)
 Sets the compression flag within the frame. More...

bool GetCompression () const
 Returns whether or not the compression flag is set. More...

bool BadParse () const
size_t GetDataSize () const

Static Public Methods

const char * GetDescription (ID3_FrameID)

Protected Methods

bool _SetID (ID3_FrameID)
bool _ClearFields ()
void _InitFields ()
void _InitFieldBits ()
void _UpdateFieldDeps ()
bool _SetEncryptionID (uchar id)
uchar _GetEncryptionID () const
bool _SetGroupingID (uchar id)
uchar _GetGroupingID () const

Detailed Description

The representative class of an id3v2 frame.

id3lib defines frames in a funny way. Using some nice c++ conventions, ID3_Frame class objects appear to be quite polymorphic; that is, they can take on many forms. The same ID3_Frame class provides the facilities for the implementation of a complex APIC frame and for a simple text frame.

Author:
Dirk Mahoney
Version:
Id:
frame.cpp,v 1.25 2000/09/14 22:34:11 eldamitri Exp
See also:
ID3_Tag , ID3_Field , ID3_Err


Constructor & Destructor Documentation

ID3_Frame::ID3_Frame ID3_FrameID id = ID3FID_NOFRAME
 

Default constructor; accepts as a default parameter the type of frame to create.

The parameter which will internally set the frame's structure. See SetID() for more details.

Parameters:
id   The type of frame to create
See also:
ID3_FrameID , SetID

ID3_Frame::ID3_Frame const ID3_FrameHeader & hdr
 

ID3_Frame::ID3_Frame const ID3_Frame & frame
 

ID3_Frame::~ID3_Frame [virtual]
 

Destructor.


Member Function Documentation

bool ID3_Frame::BadParse const [inline]
 

void ID3_Frame::Clear
 

Clears the frame of all data and resets the frame such that it can take on the form of any id3v2 frame that id3lib supports.

See also:
ID3_Tag::Clear

bool ID3_Frame::Contains ID3_FieldID fld const [inline]
 

ID3_Field & ID3_Frame::Field ID3_FieldID fieldName const
 

Returns a reference to the frame's internal field indicated by the parameter.

A list of fields that are in given frames appears in <id3/field.cpp>. This method returns a reference to the field in question so that the result can be used as though it were a field itself.

   ID3_TextEnc enc;
   enc = (ID3_TextEnc) myFrame.Field(ID3FN_TEXTENC).Get();
Parameters:
name   The name of the field to be retrieved
Returns:
A reference to the desired field

bool ID3_Frame::GetCompression const [inline]
 

Returns whether or not the compression flag is set.

After parsing a tag, this will indicate whether or not the frame was compressed. After rendering a tag, however, it does not actually indicate if the frame is compressed rendering. It only indicates whether or not compression was attempted. A frame will not be compressed, even whent the compression flag is set, if the "compressed" data is no smaller than the "uncompressed" data.

size_t ID3_Frame::GetDataSize const [inline]
 

const char * ID3_Frame::GetDescription ID3_FrameID id [static]
 

const char * ID3_Frame::GetDescription const
 

ID3_FrameID ID3_Frame::GetID const [inline]
 

ID3_V2Spec ID3_Frame::GetSpec const [virtual]
 

Reimplemented from ID3_Speccable.

const char* ID3_Frame::GetTextID const [inline]
 

bool ID3_Frame::HasChanged const
 

size_t ID3_Frame::Parse const uchar * buffer,
size_t size
 

size_t ID3_Frame::Render uchar * buffer const
 

bool ID3_Frame::SetCompression bool b [inline]
 

Sets the compression flag within the frame.

When the compression flag is is set, compression will be attempted. However, the frame might not actually be compressed after it is rendered if the "compressed" data is no smaller than the "uncompressed" data.

bool ID3_Frame::SetID ID3_FrameID id
 

Establishes the internal structure of an ID3_Frame object so that it represents the id3v2 frame indicated by the parameter.

Given an ID3_FrameID (a list of which is found in <id3/field.h>), SetID() will structure the object according to the frame you wish to implement.

Either using this call or via the constructor, this must be the first command performed on an ID3_Frame object.

   myFrame.SetID(ID3FID_TITLE);
Parameters:
id   The type of frame this frame should be set to
See also:
ID3_FrameID

bool ID3_Frame::SetSpec ID3_V2Spec spec [virtual]
 

Reimplemented from ID3_Speccable.

size_t ID3_Frame::Size
 

bool ID3_Frame::_ClearFields [protected]
 

uchar ID3_Frame::_GetEncryptionID const [inline, protected]
 

uchar ID3_Frame::_GetGroupingID const [inline, protected]
 

void ID3_Frame::_InitFieldBits [protected]
 

void ID3_Frame::_InitFields [protected]
 

bool ID3_Frame::_SetEncryptionID uchar id [inline, protected]
 

bool ID3_Frame::_SetGroupingID uchar id [inline, protected]
 

bool ID3_Frame::_SetID ID3_FrameID id [protected]
 

void ID3_Frame::_UpdateFieldDeps [protected]
 

ID3_Frame & ID3_Frame::operator= const ID3_Frame & rFrame
 


The documentation for this class was generated from the following files:
Generated at Wed Sep 5 16:53:39 2001 for id3lib by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001