taglib-devel Digest, Vol 21, Issue 2

Dongxu Ma dongxu.ma at gmail.com
Fri Mar 3 15:40:55 CET 2006


Hmmm, I assume you'd like to access the string/text in Frame. In this case
you have to invoke render or toString. The frame is just a container of both
data and meta info. Further, in TagLib, string/text is ALWAYS wrapped as an
instance of String in order to abstract the locale/encoding issue.

Also, in C++ code, you can find:
---------------------------------------------------------------
### id3v2tag.h ###

00033 namespace TagLib {
00034
00035   class File;
00036
00038
00046   namespace ID3v2 {
00047
00048     class Header;
00049     class ExtendedHeader;
00050     class Footer;
00051
00052 <http://developer.kde.org/%7Ewheeler/taglib/api/namespaceTagLib_1_1ID3v2.html#a0>
    typedef List<Frame *>
<http://developer.kde.org/%7Ewheeler/taglib/api/classTagLib_1_1List.html>
FrameList <http://developer.kde.org/%7Ewheeler/taglib/api/classTagLib_1_1List.html>;
------------------------------------
The symbol is declared as a list of TagLib::ID3v2::Frame pointers, while
in Perl I present as an instance. Inside, the same:
RV contains stash -> SV contains memory address

Currently, in case the return type of C++ method is virtual(interface-like),
I just make the same general stash. Inside C++ code, there might be dynamic
binding. This will possibly mask some extra methods in the real subclass'
namespace. I refused to take the runtime type identification method since
most of the cases you just get a known namespace once you get something from
C stack.

Anyone comments me if error words;-)

On 3/3/06, taglib-devel-request at kde.org <taglib-devel-request at kde.org>
wrote:
>
> Send taglib-devel mailing list submissions to
>         taglib-devel at kde.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mail.kde.org/mailman/listinfo/taglib-devel
> or, via email, send a message with subject or body 'help' to
>         taglib-devel-request at kde.org
>
> You can reach the person managing the list at
>         taglib-devel-owner at kde.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of taglib-devel digest..."
>
>
> Today's Topics:
>
>    1. perl bindings ID3v2::Frame subclasses  (Aaron VonderHaar)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 2 Mar 2006 20:06:41 -0800
> From: Aaron VonderHaar <gruen0aermel at gmail.com>
> Subject: perl bindings ID3v2::Frame subclasses
> To: taglib-devel at kde.org
> Message-ID: <02F4556B-4800-4097-A5F7-D60FCDD7C6C9 at gmail.com>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> I'm trying to use the Audio::TagLib perl bindings to access ID3v2-
> specific frames, but when I iterate through the FrameList, all the
> frames seem to be instances of Frame and not of the correct subclasses.
>
> my $file = Audio::TagLib::FileRef->new("test.mp3");
> my $tag = Audio::TagLib::ID3v2::Tag->new($file->file, 0);
>
> tie my @frames, ref($tag->frameList()), $tag->frameList();
>
> foreach my $frame (@frames) {
>          print ref($frame), "\n";  ### This prints
> "Audio::TagLib::ID3v2::Frame" for every frame
>          eval { print $frame->text(), "\n"; };  ### This fails even
> for COMM frames
> }
>
> How can I determine the class of the frame, and how can I access the
> member functions for each subclass?
>
> Thanks,
> Aaron V.
>
>
> ------------------------------
>
> _______________________________________________
> taglib-devel mailing list
> taglib-devel at kde.org
> https://mail.kde.org/mailman/listinfo/taglib-devel
>
>
> End of taglib-devel Digest, Vol 21, Issue 2
> *******************************************
>



--
Cheers, Dongxu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/taglib-devel/attachments/20060303/3440c1f0/attachment.html 


More information about the taglib-devel mailing list