id3lib 3.8.3
Classes | Public Member Functions | Static Public Member Functions | List of all members
ID3_Frame Class Reference

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

#include <id3lib_frame.h>

Classes

class  ConstIterator
 
class  Iterator
 

Public Member Functions

 ID3_Frame (ID3_FrameID id=ID3FID_NOFRAME)
 Default constructor; accepts as a default parameter the type of frame to create.
 
 ID3_Frame (const ID3_Frame &)
 
virtual ~ID3_Frame ()
 
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.
 
bool SetID (ID3_FrameID id)
 Establishes the internal structure of an ID3_FrameImpl object so that it represents the id3v2 frame indicated by the parameter.
 
ID3_FrameID GetID () const
 Returns the type of frame that the object represents.
 
ID3_FieldGetField (ID3_FieldID name) const
 
size_t NumFields () const
 
const char * GetDescription () const
 
const char * GetTextID () const
 
ID3_Frameoperator= (const ID3_Frame &)
 
bool HasChanged () const
 
bool Parse (ID3_Reader &)
 
void Render (ID3_Writer &) const
 
size_t Size ()
 
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.
 
bool GetCompression () const
 Returns whether or not the compression flag is set.
 
size_t GetDataSize () const
 
bool SetEncryptionID (uchar id)
 
uchar GetEncryptionID () const
 
bool SetGroupingID (uchar id)
 
uchar GetGroupingID () const
 
IteratorCreateIterator ()
 
ConstIteratorCreateIterator () const
 
ID3_FieldField (ID3_FieldID name) const
 Returns a pointer to the frame's internal field indicated by the parameter.
 

Static Public Member Functions

static const char * GetDescription (ID3_FrameID)
 

Detailed Description

The representative class of an id3v2 frame.

id3lib defines frames in a funny way. Using some nice c++ conventions, ID3_FrameImpl class objects appear to be quite polymorphic; that is, they can take on many forms. The same ID3_FrameImpl 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.35 2002/08/10 10:42:42 t1mpy Exp
See also
ID3_Tag
ID3_Field
ID3_Err

Definition at line 38 of file id3lib_frame.h.

Constructor & Destructor Documentation

◆ ID3_Frame() [1/2]

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
idThe type of frame to create
See also
ID3_FrameID
SetID

Definition at line 62 of file frame.cpp.

◆ ID3_Frame() [2/2]

ID3_Frame::ID3_Frame ( const ID3_Frame & frame)

Definition at line 67 of file frame.cpp.

◆ ~ID3_Frame()

ID3_Frame::~ID3_Frame ( )
virtual

Definition at line 72 of file frame.cpp.

Member Function Documentation

◆ Clear()

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

Definition at line 82 of file frame.cpp.

◆ Contains()

bool ID3_Frame::Contains ( ID3_FieldID fld) const

Definition at line 209 of file frame.cpp.

◆ CreateIterator() [1/2]

ID3_Frame::Iterator * ID3_Frame::CreateIterator ( )

Definition at line 310 of file frame.cpp.

◆ CreateIterator() [2/2]

ID3_Frame::ConstIterator * ID3_Frame::CreateIterator ( ) const

Definition at line 316 of file frame.cpp.

◆ Field()

ID3_Field & ID3_Frame::Field ( ID3_FieldID fieldName) const

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

enc = (ID3_TextEnc) myFrame.GetField(ID3FN_TEXTENC)->Get();
@ ID3FN_TEXTENC
Text encoding (unicode or ASCII)
Definition globals.h:200
ID3_TextEnc
Enumeration of the types of text encodings: ascii or unicode.
Definition globals.h:138
Parameters
nameThe name of the field to be retrieved
Returns
A reference to the desired field

Definition at line 142 of file frame.cpp.

◆ GetCompression()

bool ID3_Frame::GetCompression ( ) const

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.

Definition at line 232 of file frame.cpp.

◆ GetDataSize()

size_t ID3_Frame::GetDataSize ( ) const

Definition at line 237 of file frame.cpp.

◆ GetDescription() [1/2]

const char * ID3_Frame::GetDescription ( ) const

Definition at line 189 of file frame.cpp.

◆ GetDescription() [2/2]

const char * ID3_Frame::GetDescription ( ID3_FrameID id)
static

Definition at line 184 of file frame.cpp.

◆ GetEncryptionID()

uchar ID3_Frame::GetEncryptionID ( ) const

Definition at line 247 of file frame.cpp.

◆ GetField()

ID3_Field * ID3_Frame::GetField ( ID3_FieldID name) const

Definition at line 147 of file frame.cpp.

◆ GetGroupingID()

uchar ID3_Frame::GetGroupingID ( ) const

Definition at line 257 of file frame.cpp.

◆ GetID()

ID3_FrameID ID3_Frame::GetID ( ) const

Returns the type of frame that the object represents.

Useful in conjunction with ID3_Tag::Find() method

Returns
The type, or id, of the frame
See also
ID3_Tag::Find

Definition at line 94 of file frame.cpp.

◆ GetSpec()

ID3_V2Spec ID3_Frame::GetSpec ( ) const

Definition at line 126 of file frame.cpp.

◆ GetTextID()

const char * ID3_Frame::GetTextID ( ) const

Definition at line 194 of file frame.cpp.

◆ HasChanged()

bool ID3_Frame::HasChanged ( ) const

Definition at line 170 of file frame.cpp.

◆ NumFields()

size_t ID3_Frame::NumFields ( ) const

Definition at line 152 of file frame.cpp.

◆ operator=()

ID3_Frame & ID3_Frame::operator= ( const ID3_Frame & rFrame)

Definition at line 175 of file frame.cpp.

◆ Parse()

bool ID3_Frame::Parse ( ID3_Reader & reader)

Definition at line 199 of file frame.cpp.

◆ Render()

void ID3_Frame::Render ( ID3_Writer & writer) const

Definition at line 204 of file frame.cpp.

◆ SetCompression()

bool ID3_Frame::SetCompression ( bool b)

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.

Definition at line 219 of file frame.cpp.

◆ SetEncryptionID()

bool ID3_Frame::SetEncryptionID ( uchar id)

Definition at line 242 of file frame.cpp.

◆ SetGroupingID()

bool ID3_Frame::SetGroupingID ( uchar id)

Definition at line 252 of file frame.cpp.

◆ SetID()

bool ID3_Frame::SetID ( ID3_FrameID id)

Establishes the internal structure of an ID3_FrameImpl 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_FrameImpl object.

myFrame.SetID(ID3FID_TITLE);
@ ID3FID_TITLE
Title/songname/content description.
Definition globals.h:278
Parameters
idThe type of frame this frame should be set to
See also
ID3_FrameID

Definition at line 116 of file frame.cpp.

◆ SetSpec()

bool ID3_Frame::SetSpec ( ID3_V2Spec spec)

Definition at line 121 of file frame.cpp.

◆ Size()

size_t ID3_Frame::Size ( )

Definition at line 164 of file frame.cpp.


The documentation for this class was generated from the following files:

Generated for id3lib by doxygen 1.10.0