TagLib  2.0.2
TagLib::ID3v2::AttachedPictureFrame Class Reference

An ID3v2 attached picture frame implementation. More...

#include <attachedpictureframe.h>

Inheritance diagram for TagLib::ID3v2::AttachedPictureFrame:
[legend]
Collaboration diagram for TagLib::ID3v2::AttachedPictureFrame:
[legend]

Public Member Functions

 AttachedPictureFrame ()
 
 AttachedPictureFrame (const ByteVector &data)
 
 ~AttachedPictureFrame () override
 
 AttachedPictureFrame (const AttachedPictureFrame &)=delete
 
AttachedPictureFrameoperator= (const AttachedPictureFrame &)=delete
 
String toString () const override
 
StringList toStringList () const override
 
String::Type textEncoding () const
 
void setTextEncoding (String::Type t)
 
String mimeType () const
 
void setMimeType (const String &m)
 
Type type () const
 
void setType (Type t)
 
String description () const
 
void setDescription (const String &desc)
 
ByteVector picture () const
 
void setPicture (const ByteVector &p)
 
- Public Member Functions inherited from TagLib::ID3v2::Frame
virtual ~Frame ()
 
 Frame (const Frame &)=delete
 
Frameoperator= (const Frame &)=delete
 
ByteVector frameID () const
 
unsigned int size () const
 
unsigned int headerSize () const
 
void setData (const ByteVector &data)
 
virtual void setText (const String &text)
 
ByteVector render () const
 
Headerheader () const
 

Protected Member Functions

void parseFields (const ByteVector &data) override
 
ByteVector renderFields () const override
 
- Protected Member Functions inherited from TagLib::ID3v2::Frame
 Frame (const ByteVector &data)
 
 Frame (Header *h)
 
void setHeader (Header *h, bool deleteCurrent=true)
 
void parse (const ByteVector &data)
 
ByteVector fieldData (const ByteVector &frameData) const
 
String readStringField (const ByteVector &data, String::Type encoding, int *position=nullptr)
 
String::Type checkTextEncoding (const StringList &fields, String::Type encoding) const
 
virtual PropertyMap asProperties () const
 

Protected Attributes

TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE std::unique_ptr< AttachedPictureFramePrivate > d
 

Friends

class FrameFactory
 

Additional Inherited Members

- Static Public Member Functions inherited from TagLib::ID3v2::Frame
static ByteVector textDelimiter (String::Type t)
 
static ByteVector keyToFrameID (const String &)
 
static String frameIDToKey (const ByteVector &)
 
- Static Public Attributes inherited from TagLib::ID3v2::Frame
static const String instrumentPrefix
 
static const String commentPrefix
 
static const String lyricsPrefix
 
static const String urlPrefix
 
- Static Protected Member Functions inherited from TagLib::ID3v2::Frame
static void splitProperties (const PropertyMap &original, PropertyMap &singleFrameProperties, PropertyMap &tiplProperties, PropertyMap &tmclProperties)
 

Detailed Description

An ID3v2 attached picture frame implementation.

This is an implementation of ID3v2 attached pictures. Pictures may be included in tags, one per APIC frame (but there may be multiple APIC frames in a single tag). These pictures are usually in either JPEG or PNG format.

Constructor & Destructor Documentation

◆ AttachedPictureFrame() [1/3]

TagLib::ID3v2::AttachedPictureFrame::AttachedPictureFrame ( )

Constructs an empty picture frame. The description, content and text encoding should be set manually.

References AttachedPictureFrame().

Referenced by AttachedPictureFrame(), AttachedPictureFrame(), AttachedPictureFrame(), operator=(), and ~AttachedPictureFrame().

◆ AttachedPictureFrame() [2/3]

TagLib::ID3v2::AttachedPictureFrame::AttachedPictureFrame ( const ByteVector & data)
explicit

Constructs an AttachedPicture frame based on data.

References AttachedPictureFrame().

◆ ~AttachedPictureFrame()

TagLib::ID3v2::AttachedPictureFrame::~AttachedPictureFrame ( )
override

Destroys the AttachedPictureFrame instance.

References AttachedPictureFrame().

◆ AttachedPictureFrame() [3/3]

TagLib::ID3v2::AttachedPictureFrame::AttachedPictureFrame ( const AttachedPictureFrame & )
delete

Member Function Documentation

◆ description()

String TagLib::ID3v2::AttachedPictureFrame::description ( ) const

Returns a text description of the image.

See also
setDescription()
textEncoding()
setTextEncoding()

References description().

Referenced by description().

◆ mimeType()

String TagLib::ID3v2::AttachedPictureFrame::mimeType ( ) const

Returns the mime type of the image. This should in most cases be "image/png" or "image/jpeg".

References mimeType().

Referenced by mimeType().

◆ operator=()

AttachedPictureFrame & TagLib::ID3v2::AttachedPictureFrame::operator= ( const AttachedPictureFrame & )
delete

◆ parseFields()

void TagLib::ID3v2::AttachedPictureFrame::parseFields ( const ByteVector & data)
overrideprotectedvirtual

Called by parse() to parse the field data. It makes this information available through the public API. This must be overridden by the subclasses.

Implements TagLib::ID3v2::Frame.

Reimplemented in TagLib::ID3v2::AttachedPictureFrameV22.

References parseFields().

Referenced by parseFields().

◆ picture()

ByteVector TagLib::ID3v2::AttachedPictureFrame::picture ( ) const

Returns the image data as a ByteVector.

Note
ByteVector has a data() method that returns a const char * which should make it easy to export this data to external programs.
See also
setPicture()
mimeType()

References picture().

Referenced by picture().

◆ renderFields()

ByteVector TagLib::ID3v2::AttachedPictureFrame::renderFields ( ) const
overrideprotectedvirtual

Render the field data back to a binary format in a ByteVector. This must be overridden by subclasses.

Implements TagLib::ID3v2::Frame.

References renderFields(), and TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE.

Referenced by renderFields().

◆ setDescription()

void TagLib::ID3v2::AttachedPictureFrame::setDescription ( const String & desc)

Sets a textual description of the image to desc.

See also
description()
textEncoding()
setTextEncoding()

References setDescription().

Referenced by setDescription().

◆ setMimeType()

void TagLib::ID3v2::AttachedPictureFrame::setMimeType ( const String & m)

Sets the mime type of the image. This should in most cases be "image/png" or "image/jpeg".

References setMimeType().

Referenced by setMimeType().

◆ setPicture()

void TagLib::ID3v2::AttachedPictureFrame::setPicture ( const ByteVector & p)

Sets the image data to p. p should be of the type specified in this frame's mime-type specification.

See also
picture()
mimeType()
setMimeType()

References setPicture().

Referenced by setPicture().

◆ setTextEncoding()

void TagLib::ID3v2::AttachedPictureFrame::setTextEncoding ( String::Type t)

Set the text encoding used for the description.

See also
description()

References setTextEncoding().

Referenced by setTextEncoding().

◆ setType()

void TagLib::ID3v2::AttachedPictureFrame::setType ( Type t)

Sets the type for the image.

See also
Type
type()

References setType().

Referenced by setType().

◆ textEncoding()

String::Type TagLib::ID3v2::AttachedPictureFrame::textEncoding ( ) const

Returns the text encoding used for the description.

See also
setTextEncoding()
description()

References textEncoding().

Referenced by textEncoding().

◆ toString()

String TagLib::ID3v2::AttachedPictureFrame::toString ( ) const
overridevirtual

Returns a string containing the description and mime-type

Implements TagLib::ID3v2::Frame.

References toString().

Referenced by toString().

◆ toStringList()

StringList TagLib::ID3v2::AttachedPictureFrame::toStringList ( ) const
overridevirtual

Returns a string list containing the description and mime-type.

Reimplemented from TagLib::ID3v2::Frame.

References toStringList().

Referenced by toStringList().

◆ type()

Type TagLib::ID3v2::AttachedPictureFrame::type ( ) const

Returns the type of the image.

See also
Type
setType()

References type().

Referenced by type().

Friends And Related Symbol Documentation

◆ FrameFactory

friend class FrameFactory
friend

References FrameFactory.

Referenced by FrameFactory.

Member Data Documentation

◆ d

TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE std::unique_ptr<AttachedPictureFramePrivate> TagLib::ID3v2::AttachedPictureFrame::d
protected

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