Skip to content

Constructor for UserTextIdentificationFrame not working has expected #107

@jameswyper

Description

@jameswyper

I'm trying to create id3v2 tags with UserTextIdentificationFrames. The documentation says that the constructor for this frame type is inherited from TextIdentificationFrame. However,

userframe = TagLib::ID3v2::UserTextIdentificationFrame.new("UserFrame",TagLib::String::UTF8)

results in

Uncaught exception: Wrong arguments for overloaded method 'UserTextIdentificationFrame.new'.
Possible C/C++ prototypes are:
    UserTextIdentificationFrame.new(TagLib::String::Type encoding)
    UserTextIdentificationFrame.new()
    UserTextIdentificationFrame.new(TagLib::ByteVector const &data)
    UserTextIdentificationFrame.new(TagLib::String const &description, TagLib::StringList const &values, TagLib::String::Type encoding)
    UserTextIdentificationFrame.new(TagLib::String const &description, TagLib::StringList const &values)

From the error message I'd expect a constructor of the form

userframe = TagLib::ID3v2::UserTextIdentificationFrame.new("UserFrame",["Some User Text"],TagLib::String::UTF8)

to work, but that gives the same error.

userframe = TagLib::ID3v2::UserTextIdentificationFrame.new(TagLib::String::UTF8)
userframe.description = "UserFrame"
userframe.text = "Some User Text"

appears to work.

Glancing at the taglib source code I think that the constructor for UserTextIdentificationFrame genuinely is different to TextIdentificationFrame (so I believe the documentation isn't correct) but I don't understand why at least one of the correct forms reported by the error message doesn't work. I'm not ruling out my own ignorance, so I'd appreciate any guidance. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions