<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>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.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks, --Aaron V.</DIV><BR><DIV><DIV>On Mar 3, 2006, at 06:40, Dongxu Ma wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">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. <BR><BR>Also, in C++ code, you can find:<BR>---------------------------------------------------------------<BR>### id3v2tag.h ###<BR><PRE class="fragment">00033 <SPAN class="keyword">namespace </SPAN>TagLib {<BR>00034 <BR>
00035 <SPAN class="keyword">class </SPAN>File;<BR>00036 <BR>00038 <BR>00046 <SPAN class="keyword">namespace </SPAN>ID3v2 {<BR>00047 <BR>00048 <SPAN class="keyword">class </SPAN>Header;<BR>00049 <SPAN class="keyword">
class </SPAN>ExtendedHeader;<BR>00050 <SPAN class="keyword">class </SPAN>Footer;<BR>00051 <BR><A name="l00052"></A><A class="code" href="http://developer.kde.org/%7Ewheeler/taglib/api/namespaceTagLib_1_1ID3v2.html#a0">
00052</A> <SPAN class="keyword">typedef</SPAN> <A class="code" href="http://developer.kde.org/%7Ewheeler/taglib/api/classTagLib_1_1List.html">List<Frame *></A> <A class="code" href="http://developer.kde.org/%7Ewheeler/taglib/api/classTagLib_1_1List.html">
FrameList</A>;<BR>------------------------------------<BR>The symbol is declared as a list of TagLib::ID3v2::Frame pointers, while <BR>in Perl I present as an instance. Inside, the same:<BR>RV contains stash -> SV contains memory address
<BR><BR>Currently, in case the return type of C++ method is virtual(interface-like),<BR>I just make the same general stash. Inside C++ code, there might be dynamic <BR>binding. This will possibly mask some extra methods in the real subclass'
<BR>namespace. I refused to take the runtime type identification method since <BR>most of the cases you just get a known namespace once you get something from <BR>C stack.<BR></PRE>Anyone comments me if error words;-)<BR> <BR><DIV><SPAN class="gmail_quote">On 3/3/06, <B class="gmail_sendername"><A href="mailto:taglib-devel-request@kde.org">taglib-devel-request@kde.org</A></B> <<A href="mailto:taglib-devel-request@kde.org">taglib-devel-request@kde.org </A>> wrote:</SPAN><BLOCKQUOTE class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Send taglib-devel mailing list submissions to<BR> <A href="mailto:taglib-devel@kde.org"> taglib-devel@kde.org</A><BR><BR>To subscribe or unsubscribe via the World Wide Web, visit<BR> <A href="https://mail.kde.org/mailman/listinfo/taglib-devel">https://mail.kde.org/mailman/listinfo/taglib-devel</A><BR>or, via email, send a message with subject or body 'help' to <BR> <A href="mailto:taglib-devel-request@kde.org">taglib-devel-request@kde.org</A><BR><BR>You can reach the person managing the list at<BR> <A href="mailto:taglib-devel-owner@kde.org">taglib-devel-owner@kde.org </A><BR><BR>When replying, please edit your Subject line so it is more specific<BR>than "Re: Contents of taglib-devel digest..."<BR><BR><BR>Today's Topics:<BR><BR> 1. perl bindings ID3v2::Frame subclasses (Aaron VonderHaar) <BR><BR><BR>----------------------------------------------------------------------<BR><BR>Message: 1<BR>Date: Thu, 2 Mar 2006 20:06:41 -0800<BR>From: Aaron VonderHaar <<A href="mailto:gruen0aermel@gmail.com">gruen0aermel@gmail.com </A>><BR>Subject: perl bindings ID3v2::Frame subclasses<BR>To: <A href="mailto:taglib-devel@kde.org">taglib-devel@kde.org</A><BR>Message-ID: <<A href="mailto:02F4556B-4800-4097-A5F7-D60FCDD7C6C9@gmail.com">02F4556B-4800-4097-A5F7-D60FCDD7C6C9@gmail.com </A>><BR>Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed<BR><BR>I'm trying to use the Audio::TagLib perl bindings to access ID3v2-<BR>specific frames, but when I iterate through the FrameList, all the <BR>frames seem to be instances of Frame and not of the correct subclasses.<BR><BR>my $file = Audio::TagLib::FileRef->new("test.mp3");<BR>my $tag = Audio::TagLib::ID3v2::Tag->new($file->file, 0);<BR><BR> tie my @frames, ref($tag->frameList()), $tag->frameList();<BR><BR>foreach my $frame (@frames) {<BR> print ref($frame), "\n"; ### This prints<BR>"Audio::TagLib::ID3v2::Frame" for every frame <BR> eval { print $frame->text(), "\n"; }; ### This fails even<BR>for COMM frames<BR>}<BR><BR>How can I determine the class of the frame, and how can I access the<BR>member functions for each subclass? <BR><BR>Thanks,<BR>Aaron V.<BR><BR><BR>------------------------------<BR><BR>_______________________________________________<BR>taglib-devel mailing list<BR><A href="mailto:taglib-devel@kde.org">taglib-devel@kde.org</A><BR> <A href="https://mail.kde.org/mailman/listinfo/taglib-devel">https://mail.kde.org/mailman/listinfo/taglib-devel</A><BR><BR><BR>End of taglib-devel Digest, Vol 21, Issue 2<BR>*******************************************<BR> </BLOCKQUOTE></DIV><BR><BR clear="all"><BR>-- <BR>Cheers, Dongxu</BLOCKQUOTE></DIV><BR></BODY></HTML>