Thread

Posted on Fri Mar 9 12:14:13 2007 by nonos
Extending interface
Hello,

'Taglib' and 'Audio::TagLib' are really useful.
I just need 'composer' and 'bpm' fieds to be present in Tag's functions, because I like the idea of leaving taglib manage all metatag considerations (not to have check file extensions and use frameList for all metatag types).

So, my wish is : you just load the file (mp3, ogg or whatelse) and get title, composer or somethingelse with Audio::TagLib::Tag functions.

I've made a patch for taglib which works : just add virtual methods 'composer()' and 'bpm()' in tag.h and their implementation in all metatag classes.

My problem is with Audio::Taglib

I've done the same thing in '.xs' files : in tag.xs and all '.xs' for metatag types.

for example 'id3v2tag.xs' add :
TagLib::String * TagLib::ID3v2::Tag::composer() CODE: RETVAL = new TagLib::String(THIS->composer()); OUTPUT: RETVAL
The compilation works and I can use this new function Audio::TagLib::Tag->composer()
but the result is false : I get a big number, just like is something wasn't init.

I may have forgotten something : could you help me ?

Cheers,
Nonos
Direct Responses: 4517 | Write a response
Posted on Fri Mar 9 12:32:15 2007 by dongxu in response to 4516
Re: Extending interface
Hello,
Please check the type of the object returned by new function:
my $o = Audio::TagLib::Tag::->composer(); print ref $o, "\n";
If the bless is right, you can get 'Audio::TagLib::String', then you can print the content of that string by
$o->CString()
To completely verify the structure of that object, it is also a good idea to run:
use Devel::Peek; Dump($o);
I assume you might forget to call CString function,
print $o
will show you the C pointer address, which is of course a big number ;-)
I plan to add such operator overload function to make
print $o
work in future version.
-dongxu
Direct Responses: 4518 | Write a response
Posted on Fri Mar 9 12:41:48 2007 by nonos in response to 4517
Re: Extending interface
Thank you for that so quick response :)

I'm so confused : I 've indeed forgotten to call the CString function :(
The shame on me !
I can't count the hours I spend on that so spudid mistake.

Cheers,
Nonos
Direct Responses: 4742 | Write a response
Posted on Mon Apr 2 15:58:58 2007 by nonos in response to 4518
Re: Extending interface
The patchs to extend Audio::TagLib and Taglib are there (add 'composer' and 'bpm' in interface) : patch
Direct Responses: 4778 | 4779 | Write a response
Posted on Fri Apr 6 10:20:40 2007 by dongxu in response to 4742
Re: Extending interface
Really thanks for your patch.
Since the underlying C++ code is involved, a better solution is trying to get patch for cpp merged into taglib itself. Better to ask taglib maillist.
I will firstly update my document about your cool stuff ;-)
cheers, dongxu
Write a response
Posted on Fri Apr 6 10:21:22 2007 by dongxu in response to 4742
Re: Extending interface
Really thanks for your patch.
Since the underlying C++ code is involved, a better solution is trying to get patch for cpp merged into taglib itself. Better to ask taglib maillist.
I will firstly update my document about your cool stuff ;-)
cheers, dongxu
Write a response