Constructing an ID3v2::Frame without a file

Scott Wheeler wheeler at kde.org
Fri Aug 9 17:02:17 BST 2019


On 09/08/2019 17:59, Fred Gleason wrote:
> On Fri, 2019-08-09 at 00:27 +0200, Scott Wheeler wrote:
>> You can either create an instance of MPEG::File using an IOStream
>> (rather than a File), or you can use ID3v2::FrameFactory::createFrame
>> to
>> create frames directly from a ByteArray:
> ID3v2::FrameFactory::createFrame() is not a static method, which means
> that I a need ID3v2::FrameFactory instance to work with. However, there
> are no public constructors for ID3v2::FrameFactory!
>
> How does one get a ID3v2::FrameFactory without a file present?

You use the instance() method:

https://taglib.org/api/classTagLib_1_1ID3v2_1_1FrameFactory.html#a6ab4884405b6b1c6d9f68f9f7514fb45

That's called a "singleton" and such is common in object-oriented design:

https://en.wikipedia.org/wiki/Singleton_pattern

-Scott



More information about the taglib-devel mailing list