Class: TagLib::ID3v2::FrameFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/TagLib_doc.rb

Overview

A factory for creating ID3v2 frames during parsing. .

This factory abstracts away the frame creation process and instantiates the appropriate ID3v2::Frame subclasses based on the contents of the data.Reimplementing this factory is the key to adding support for frame types not directly supported by TagLib to your application. To do so you would subclass this factory reimplement createFrame(). Then by setting your factory to be the default factory in ID3v2::Tag constructor or with MPEG::File::setID3v2FrameFactory() you can implement behavior that will allow for new ID3v2::Frame subclasses (also provided by you) to be used.This implements both abstract factory and singleton patterns of which more information is available on the web and in software design textbooks (Notably Design Patters).You do not need to use this factory to create new frames to add to an ID3v2::Tag. You can instantiate frame subclasses directly (with new) and add them to a tag using ID3v2::Tag::addFrame() ID3v2::Tag::addFrame()