Menu

#75 Adding Size and Render to c_wrapper (code included)

open
nobody
None
5
2007-03-27
2007-03-27
No

Please include my patch here, not sure why Size and Render were left out of the C wrapper...

In src/c_wrapper.cpp:

ID3_C_EXPORT size_t CCONV
ID3Tag_Render(ID3Tag *tag, uchar *buffer, ID3_TagType tt)
{
size_t size = 0;
if (tag)
{
ID3_CATCH(size = reinterpret_cast<ID3_Tag *>(tag)->Render(buffer, tt));
}
return size;
}

ID3_C_EXPORT size_t CCONV
ID3Tag_Size(ID3Tag *tag)
{
size_t size = 0;
if (tag)
{
ID3_CATCH(size = reinterpret_cast<ID3_Tag *>(tag)->Size());
}
return size;
}

In include/id3.h:
ID3_C_EXPORT size_t CCONV ID3Tag_Render (ID3Tag *tag, uchar *buffer, ID3_TagType tt);
ID3_C_EXPORT size_t CCONV ID3Tag_Size (ID3Tag *tag);

I need this for a Perl library that I'm hacking on (MP3::ID3Lib) and will submit patches there when this is updated. Note that Apple puts ID3 tags on AIFF's in a chunk labeled "ID3", and it's good to be able to render them for inclusion in an AIFF when programmatically creating the AIFF.

Thank you!

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.