perl bindings ID3v2::Frame subclasses

Aaron VonderHaar gruen0aermel at gmail.com
Sat Mar 4 21:08:43 CET 2006


Specifically, what I would like access to are the description fields  
in TXXX and COMM frames.  From what you are saying, it sounds like  
this is not possible except by inspecting the ByteVector produced by  
render().  If that is the case, then I think it is a serious  
deficiency in the perl bindings API.

Thanks, --Aaron V.

On Mar 3, 2006, at 06:40, Dongxu Ma wrote:

> 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     typedef List<Frame *>
> FrameList;
> ------------------------------------
> 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/20060304/bd327646/attachment.html 


More information about the taglib-devel mailing list