tagpy: auto_ptr in python?

112 Views Asked by At

I'm not a professional, I'm just frustrated that almost no linux audio players support the id3v2 composer tag, and I'd like to figure out how to add it. Taglib doesn't support the composer tag directly, but there is a workaround by building the tag up from scratch. I'm trying to translate that into tagpy.

The following lines are supposed to create a new id3v2 frame and add it to a new framelist.

newframe = tagpy.id3v2.TextIdentificationFrame( 'TCOM' )
newframe.setText( "Bruckner" )
newframelist = tagpy.id3v2.FrameList()
newframelist.append( newframelist )

But the last line throws an error.

newframelist.append( newframelist )
Boost.Python.ArgumentError: Python argument types in
id3v2_FrameList.append(id3v2_FrameList, id3v2_FrameList) did not match C++ signature:
append(TagLib::List<TagLib::ID3v2::Frame*> {lvalue}, std::auto_ptr<TagLib::ID3v2::Frame>)

Am I not using the append command correctly? Is there another way to do this? Is the problem with tagpy, i.e. it fails to wrap the append method correctly?

Note that replacing the last line with "newframelist[ 0 ] = newframe" throws a similar error.

newframelist[ 0 ] = newframe
Boost.Python.ArgumentError: Python argument types in
id3v2_FrameList.__setitem__(id3v2_FrameList, int, id3v2_TextIdentificationFrame) did not match C++ signature:
__setitem__(TagLib::List<TagLib::ID3v2::Frame*> {lvalue}, unsigned int, std::auto_ptr<TagLib::ID3v2::Frame>)
1

There are 1 best solutions below

0
On

I was trying to do it at too low a level. All I needed was to use id3v2.tag.addTag().