Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 2c9d30f3cf217a6cae41860ebc0d6704 > files > 197

libid3lib3.8_0-devel-3.8.0-0.pre2.1.1mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>src/tag_parse_lyrics3.cpp Source File</title>
<link href="id3lib.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.2.12 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
<hr><h1>src/tag_parse_lyrics3.cpp</h1><a href="tag__parse__lyrics3_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">// $Id: tag_parse_lyrics3.cpp,v 1.29 2001/08/05 21:21:13 abscess Exp $</font>
00002 
00003 <font class="comment">// id3lib: a C++ library for creating and manipulating id3v1/v2 tags</font>
00004 <font class="comment">// Copyright 1999, 2000  Scott Thomas Haug</font>
00005 
00006 <font class="comment">// This library is free software; you can redistribute it and/or modify it</font>
00007 <font class="comment">// under the terms of the GNU Library General Public License as published by</font>
00008 <font class="comment">// the Free Software Foundation; either version 2 of the License, or (at your</font>
00009 <font class="comment">// option) any later version.</font>
00010 <font class="comment">//</font>
00011 <font class="comment">// This library is distributed in the hope that it will be useful, but WITHOUT</font>
00012 <font class="comment">// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or</font>
00013 <font class="comment">// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public</font>
00014 <font class="comment">// License for more details.</font>
00015 <font class="comment">//</font>
00016 <font class="comment">// You should have received a copy of the GNU Library General Public License</font>
00017 <font class="comment">// along with this library; if not, write to the Free Software Foundation,</font>
00018 <font class="comment">// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</font>
00019 
00020 <font class="comment">// The id3lib authors encourage improvements and optimisations to be sent to</font>
00021 <font class="comment">// the id3lib coordinator.  Please see the README file for details on where to</font>
00022 <font class="comment">// send such submissions.  See the AUTHORS file for a list of people who have</font>
00023 <font class="comment">// contributed to id3lib.  See the ChangeLog file for a list of changes to</font>
00024 <font class="comment">// id3lib.  These files are distributed with id3lib at</font>
00025 <font class="comment">// http://download.sourceforge.net/id3lib/</font>
00026 
00027 <font class="preprocessor">#if defined HAVE_CONFIG_H</font>
00028 <font class="preprocessor"></font><font class="preprocessor">#include &lt;config.h&gt;</font>
00029 <font class="preprocessor">#endif</font>
00030 <font class="preprocessor"></font>
00031 
00032 
00033 <font class="preprocessor">#include &lt;stdlib.h&gt;</font>
00034 <font class="preprocessor">#include &lt;ctype.h&gt;</font>
00035 <font class="preprocessor">#include &lt;memory.h&gt;</font>
00036 <font class="preprocessor">#include "<a class="code" href="tag__impl_8h.html">tag_impl.h</a>"</font>
00037 <font class="preprocessor">#include "utils.h"</font>
00038 <font class="preprocessor">#include "helpers.h"</font>
00039 <font class="preprocessor">#include "io_decorators.h"</font>
00040 <font class="preprocessor">#include "io_helpers.h"</font>
00041 <font class="preprocessor">#include "io_strings.h"</font>
00042 
00043 <font class="keyword">using</font> <font class="keyword">namespace </font>dami;
00044 
00045 <font class="keyword">namespace</font>
00046 <font class="keyword"></font>{
00047   <a class="code" href="sized__types_8h.html#a4">uint32</a> readIntegerString(<a class="code" href="class_i_d3___reader.html">ID3_Reader</a>&amp; reader, size_t numBytes)
00048   {
00049     <a class="code" href="sized__types_8h.html#a4">uint32</a> val = 0;
00050     <font class="keywordflow">for</font> (size_t i = 0; i &lt; numBytes &amp;&amp; isdigit(reader.<a class="code" href="class_i_d3___reader.html#a6">peekChar</a>()); ++i)
00051     {
00052       val = (val * 10) + (reader.<a class="code" href="class_i_d3___reader.html#a5">readChar</a>() - <font class="charliteral">'0'</font>);
00053     }
00054     ID3D_NOTICE( <font class="stringliteral">"readIntegerString: val = "</font> &lt;&lt; val );
00055     <font class="keywordflow">return</font> val;
00056   }
00057 
00058   <a class="code" href="sized__types_8h.html#a4">uint32</a> readIntegerString(<a class="code" href="class_i_d3___reader.html">ID3_Reader</a>&amp; reader)
00059   {
00060     <font class="keywordflow">return</font> readIntegerString(reader, reader.<a class="code" href="class_i_d3___reader.html#a10">remainingBytes</a>());
00061   }
00062   
00063   <font class="keywordtype">bool</font> isTimeStamp(<a class="code" href="class_i_d3___reader.html">ID3_Reader</a>&amp; reader)
00064   {
00065     <a class="code" href="class_i_d3___reader.html#s2">ID3_Reader::pos_type</a> cur = reader.<a class="code" href="class_i_d3___reader.html#a3">getCur</a>();
00066     <font class="keywordflow">if</font> (reader.<a class="code" href="class_i_d3___reader.html#a2">getEnd</a>() &lt; cur + 7)
00067     {
00068       <font class="keywordflow">return</font> <font class="keyword">false</font>;
00069     }
00070     <font class="keywordtype">bool</font> its = (<font class="charliteral">'['</font> == reader.<a class="code" href="class_i_d3___reader.html#a5">readChar</a>() &amp;&amp; 
00071                 isdigit(reader.<a class="code" href="class_i_d3___reader.html#a5">readChar</a>()) &amp;&amp; isdigit(reader.<a class="code" href="class_i_d3___reader.html#a5">readChar</a>()) &amp;&amp;
00072                 <font class="charliteral">':'</font> == reader.<a class="code" href="class_i_d3___reader.html#a5">readChar</a>() &amp;&amp; 
00073                 isdigit(reader.<a class="code" href="class_i_d3___reader.html#a5">readChar</a>()) &amp;&amp; isdigit(reader.<a class="code" href="class_i_d3___reader.html#a5">readChar</a>()) &amp;&amp;
00074                 <font class="charliteral">']'</font> == reader.<a class="code" href="class_i_d3___reader.html#a5">readChar</a>());
00075     reader.<a class="code" href="class_i_d3___reader.html#a4">setCur</a>(cur);
00076     <font class="keywordflow">if</font> (its)
00077         {
00078       ID3D_NOTICE( <font class="stringliteral">"isTimeStamp(): found timestamp, cur = "</font> &lt;&lt; 
00079                    reader.<a class="code" href="class_i_d3___reader.html#a3">getCur</a>() );
00080         }
00081     <font class="keywordflow">return</font> its;
00082   }
00083   
00084   <a class="code" href="sized__types_8h.html#a4">uint32</a> readTimeStamp(<a class="code" href="class_i_d3___reader.html">ID3_Reader</a>&amp; reader)
00085   {
00086     reader.<a class="code" href="class_i_d3___reader.html#a9">skipChars</a>(1);
00087     size_t sec = readIntegerString(reader, 2) * 60;
00088     reader.<a class="code" href="class_i_d3___reader.html#a9">skipChars</a>(1);
00089     sec += readIntegerString(reader, 2);
00090     reader.<a class="code" href="class_i_d3___reader.html#a9">skipChars</a>(1);
00091     ID3D_NOTICE( <font class="stringliteral">"readTimeStamp(): timestamp = "</font> &lt;&lt; sec );
00092     <font class="keywordflow">return</font> sec * 1000;
00093   }
00094   
00095   <font class="keywordtype">bool</font> findText(<a class="code" href="class_i_d3___reader.html">ID3_Reader</a>&amp; reader, String text)
00096   {
00097     <font class="keywordflow">if</font> (text.empty())
00098     {
00099       <font class="keywordflow">return</font> <font class="keyword">true</font>;
00100     }
00101     
00102     size_t index = 0;
00103     <font class="keywordflow">while</font> (!reader.<a class="code" href="class_i_d3___reader.html#a11">atEnd</a>())
00104     {
00105       <a class="code" href="class_i_d3___reader.html#s1">ID3_Reader::char_type</a> ch = reader.<a class="code" href="class_i_d3___reader.html#a5">readChar</a>();
00106       <font class="keywordflow">if</font> (ch == text[index])
00107       {
00108         index++;
00109       }
00110       <font class="keywordflow">else</font> <font class="keywordflow">if</font> (ch == text[0])
00111       {
00112         index = 1;
00113       }
00114       <font class="keywordflow">else</font>
00115       {
00116         index = 0;
00117       }
00118       <font class="keywordflow">if</font> (index == text.size())
00119       {
00120         reader.<a class="code" href="class_i_d3___reader.html#a4">setCur</a>(reader.<a class="code" href="class_i_d3___reader.html#a3">getCur</a>() - index);
00121         ID3D_NOTICE( <font class="stringliteral">"findText: found \""</font> &lt;&lt; text &lt;&lt; <font class="stringliteral">"\" at "</font> &lt;&lt; 
00122                      reader.<a class="code" href="class_i_d3___reader.html#a3">getCur</a>() );
00123         <font class="keywordflow">break</font>;
00124       }
00125     }
00126     <font class="keywordflow">return</font> !reader.<a class="code" href="class_i_d3___reader.html#a11">atEnd</a>();
00127   };
00128 
00129   <font class="keywordtype">void</font> lyrics3ToSylt(<a class="code" href="class_i_d3___reader.html">ID3_Reader</a>&amp; reader, <a class="code" href="class_i_d3___writer.html">ID3_Writer</a>&amp; writer)
00130   {
00131     <font class="keywordflow">while</font> (!reader.<a class="code" href="class_i_d3___reader.html#a11">atEnd</a>())
00132     {
00133       <font class="keywordtype">bool</font> lf = <font class="keyword">false</font>;
00134       size_t ms = 0;
00135       size_t count = 0;
00136       <font class="keywordflow">while</font> (isTimeStamp(reader))
00137       {
00138         <font class="comment">// For now, just skip over multiple time stamps</font>
00139         <font class="keywordflow">if</font> (count++ &gt; 0)
00140         {
00141           readTimeStamp(reader);
00142         }
00143         <font class="keywordflow">else</font>
00144         {
00145           ms = readTimeStamp(reader);
00146         }
00147       }
00148       <font class="keywordflow">while</font> (!reader.<a class="code" href="class_i_d3___reader.html#a11">atEnd</a>() &amp;&amp; !isTimeStamp(reader))
00149       {
00150         <a class="code" href="class_i_d3___reader.html#s1">ID3_Reader::char_type</a> ch = reader.<a class="code" href="class_i_d3___reader.html#a5">readChar</a>();
00151         <font class="keywordflow">if</font> (0x0A == ch &amp;&amp; (reader.<a class="code" href="class_i_d3___reader.html#a11">atEnd</a>() || isTimeStamp(reader)))
00152         {
00153           lf = <font class="keyword">true</font>;
00154           <font class="keywordflow">break</font>;
00155         }
00156         <font class="keywordflow">else</font>
00157         {
00158           writer.<a class="code" href="class_i_d3___writer.html#a7">writeChar</a>(ch);
00159         }
00160       }
00161       
00162       <font class="comment">// put synch identifier</font>
00163       writer.<a class="code" href="class_i_d3___writer.html#a7">writeChar</a>(<font class="charliteral">'\0'</font>);
00164       
00165       <font class="comment">// put timestamp</font>
00166       ID3D_NOTICE( <font class="stringliteral">"lyrics3toSylt: ms = "</font> &lt;&lt; ms );
00167       
00168       io::writeBENumber(writer, ms, <font class="keyword">sizeof</font>(<a class="code" href="sized__types_8h.html#a4">uint32</a>));
00169       <font class="keywordflow">if</font> (lf)
00170       {
00171         ID3D_NOTICE( <font class="stringliteral">"lyrics3toSylt: adding lf"</font> );
00172     
00173         <font class="comment">// put the LF</font>
00174         writer.<a class="code" href="class_i_d3___writer.html#a7">writeChar</a>(0x0A);
00175       }
00176     }
00177   }
00178 };
00179 
00180 <font class="keywordtype">bool</font> lyr3::v1::parse(<a class="code" href="class_i_d3___tag_impl.html">ID3_TagImpl</a>&amp; tag, <a class="code" href="class_i_d3___reader.html">ID3_Reader</a>&amp; reader)
00181 {
00182   io::ExitTrigger et(reader);
00183   <a class="code" href="class_i_d3___reader.html#s2">ID3_Reader::pos_type</a> <a class="code" href="class_i_d3___tag_impl.html#a35">end</a> = reader.<a class="code" href="class_i_d3___reader.html#a3">getCur</a>();
00184   <font class="keywordflow">if</font> (<a class="code" href="class_i_d3___tag_impl.html#a35">end</a> &lt; reader.<a class="code" href="class_i_d3___reader.html#a1">getBeg</a>() + 9 + 128)
00185   {
00186     ID3D_NOTICE( <font class="stringliteral">"id3::v1::parse: bailing, not enough bytes to parse, pos = "</font> &lt;&lt; <a class="code" href="class_i_d3___tag_impl.html#a35">end</a> );
00187     <font class="keywordflow">return</font> <font class="keyword">false</font>;
00188   }
00189   reader.<a class="code" href="class_i_d3___reader.html#a4">setCur</a>(<a class="code" href="class_i_d3___tag_impl.html#a35">end</a> - (9 + 128));
00190         
00191   {
00192     <font class="keywordflow">if</font> (io::readText(reader, 9) != <font class="stringliteral">"LYRICSEND"</font> || 
00193         io::readText(reader, 3) != <font class="stringliteral">"TAG"</font>)
00194     {
00195       <font class="keywordflow">return</font> <font class="keyword">false</font>;
00196     }
00197   }
00198         
00199   <font class="comment">// we have a Lyrics3 v1.00 tag</font>
00200   <font class="keywordflow">if</font> (<a class="code" href="class_i_d3___tag_impl.html#a35">end</a> &lt; reader.<a class="code" href="class_i_d3___reader.html#a1">getBeg</a>() + 11 + 9 + 128)
00201   {
00202     <font class="comment">// the file size isn't large enough to actually hold lyrics</font>
00203     ID3D_WARNING( <font class="stringliteral">"id3::v1::parse: not enough data to parse lyrics3"</font> );
00204     <font class="keywordflow">return</font> <font class="keyword">false</font>;
00205   }
00206         
00207   <font class="comment">// reserve enough space for lyrics3 + id3v1 tag</font>
00208   size_t window = <a class="code" href="class_i_d3___tag_impl.html#a35">end</a> - reader.<a class="code" href="class_i_d3___reader.html#a1">getBeg</a>();
00209   size_t lyrDataSize = min&lt;size_t&gt;(window, 11 + 5100 + 9 + 128);
00210   reader.<a class="code" href="class_i_d3___reader.html#a4">setCur</a>(<a class="code" href="class_i_d3___tag_impl.html#a35">end</a> - lyrDataSize);
00211   io::WindowedReader wr(reader, lyrDataSize - (9 + 128));
00212         
00213   <font class="keywordflow">if</font> (!findText(wr, <font class="stringliteral">"LYRICSBEGIN"</font>))
00214   {
00215     ID3D_WARNING( <font class="stringliteral">"id3::v1::parse: couldn't find LYRICSBEGIN, bailing"</font> );
00216     <font class="keywordflow">return</font> <font class="keyword">false</font>;
00217   }
00218   
00219   et.setExitPos(wr.getCur());
00220   wr.skipChars(11);
00221   wr.setBeg(wr.getCur());
00222 
00223   io::LineFeedReader lfr(wr);
00224   String lyrics = io::readText(lfr, wr.remainingBytes());
00225   id3::v2::setLyrics(tag, lyrics, <font class="stringliteral">"Converted from Lyrics3 v1.00"</font>, <font class="stringliteral">"XXX"</font>);
00226 
00227   <font class="keywordflow">return</font> <font class="keyword">true</font>;
00228 }
00229     
00230 <font class="comment">//bool parse(TagImpl&amp; tag, ID3_Reader&amp; reader)</font>
00231 <font class="keywordtype">bool</font> lyr3::v2::parse(<a class="code" href="class_i_d3___tag_impl.html">ID3_TagImpl</a>&amp; tag, <a class="code" href="class_i_d3___reader.html">ID3_Reader</a>&amp; reader)
00232 {
00233   io::ExitTrigger et(reader);
00234   <a class="code" href="class_i_d3___reader.html#s2">ID3_Reader::pos_type</a> <a class="code" href="class_i_d3___tag_impl.html#a35">end</a> = reader.<a class="code" href="class_i_d3___reader.html#a3">getCur</a>();
00235   <font class="keywordflow">if</font> (<a class="code" href="class_i_d3___tag_impl.html#a35">end</a> &lt; reader.<a class="code" href="class_i_d3___reader.html#a1">getBeg</a>() + 6 + 9 + 128)
00236   {
00237     ID3D_NOTICE( <font class="stringliteral">"lyr3::v2::parse: bailing, not enough bytes to parse, pos = "</font> &lt;&lt; reader.<a class="code" href="class_i_d3___reader.html#a3">getCur</a>() );
00238     <font class="keywordflow">return</font> <font class="keyword">false</font>;
00239   }
00240         
00241   reader.<a class="code" href="class_i_d3___reader.html#a4">setCur</a>(<a class="code" href="class_i_d3___tag_impl.html#a35">end</a> - (6 + 9 + 128));
00242   <a class="code" href="sized__types_8h.html#a4">uint32</a> lyrSize = 0;
00243 
00244   <a class="code" href="class_i_d3___reader.html#s2">ID3_Reader::pos_type</a> beg = reader.<a class="code" href="class_i_d3___reader.html#a3">getCur</a>();
00245   lyrSize = readIntegerString(reader, 6);
00246   <font class="keywordflow">if</font> (reader.<a class="code" href="class_i_d3___reader.html#a3">getCur</a>() &lt; beg + 6)
00247   {
00248     ID3D_NOTICE( <font class="stringliteral">"lyr3::v2::parse: couldn't find numeric string, lyrSize = "</font> &lt;&lt;
00249                  lyrSize );
00250     <font class="keywordflow">return</font> <font class="keyword">false</font>;
00251   }
00252   
00253   <font class="keywordflow">if</font> (io::readText(reader, 9) != <font class="stringliteral">"LYRICS200"</font> || 
00254       io::readText(reader, 3) != <font class="stringliteral">"TAG"</font>)
00255   {
00256     <font class="keywordflow">return</font> <font class="keyword">false</font>;
00257   }
00258   
00259   <font class="keywordflow">if</font> (<a class="code" href="class_i_d3___tag_impl.html#a35">end</a> &lt; reader.<a class="code" href="class_i_d3___reader.html#a1">getBeg</a>() + lyrSize + 6 + 9 + 128)
00260   {
00261     ID3D_WARNING( <font class="stringliteral">"lyr3::v2::parse: not enough data to parse tag, lyrSize = "</font> &lt;&lt; lyrSize );
00262     <font class="keywordflow">return</font> <font class="keyword">false</font>;
00263   }
00264   reader.<a class="code" href="class_i_d3___reader.html#a4">setCur</a>(<a class="code" href="class_i_d3___tag_impl.html#a35">end</a> - (lyrSize + 6 + 9 + 128));
00265         
00266   io::WindowedReader wr(reader);
00267   wr.setWindow(wr.getCur(), lyrSize);
00268         
00269   beg = wr.getCur();
00270         
00271   <font class="keywordflow">if</font> (io::readText(wr, 11) != <font class="stringliteral">"LYRICSBEGIN"</font>)
00272   {
00273     <font class="comment">// not a lyrics v2.00 tag</font>
00274     ID3D_WARNING( <font class="stringliteral">"lyr3::v2::parse: couldn't find LYRICSBEGIN, bailing"</font> );
00275     <font class="keywordflow">return</font> <font class="keyword">false</font>;
00276   }
00277         
00278   <font class="keywordtype">bool</font> has_time_stamps = <font class="keyword">false</font>;
00279         
00280   <a class="code" href="class_i_d3___frame.html">ID3_Frame</a>* lyr_frame = <a class="code" href="globals_8h.html#a24">NULL</a>;
00281         
00282   <font class="keywordflow">while</font> (!wr.atEnd())
00283   {
00284     <a class="code" href="sized__types_8h.html#a4">uint32</a> fldSize;
00285           
00286     String fldName = io::readText(wr, 3);
00287     ID3D_NOTICE( <font class="stringliteral">"lyr3::v2::parse: fldName = "</font> &lt;&lt; fldName );
00288     fldSize = readIntegerString(wr, 5);
00289     ID3D_NOTICE( <font class="stringliteral">"lyr3::v2::parse: fldSize = "</font> &lt;&lt; fldSize );
00290           
00291     String fldData;
00292 
00293     io::WindowedReader wr2(wr, fldSize);
00294     io::LineFeedReader lfr(wr2);
00295     
00296     fldData = io::readText(lfr, fldSize);
00297     ID3D_NOTICE( <font class="stringliteral">"lyr3::v2::parse: fldData = \""</font> &lt;&lt; fldData &lt;&lt; <font class="stringliteral">"\""</font> );
00298           
00299     <font class="comment">// the IND field</font>
00300     <font class="keywordflow">if</font> (fldName == <font class="stringliteral">"IND"</font>)
00301     {
00302       has_time_stamps = (fldData.size() &gt; 1 &amp;&amp; fldData[1] == <font class="charliteral">'1'</font>);
00303     }
00304           
00305     <font class="comment">// the TITLE field</font>
00306     <font class="keywordflow">else</font> <font class="keywordflow">if</font> (fldName == <font class="stringliteral">"ETT"</font>)
00307     {
00308       <font class="comment">//tag.setTitle(fldData);</font>
00309       id3::v2::setTitle(tag, fldData);
00310     }
00311           
00312     <font class="comment">// the ARTIST field</font>
00313     <font class="keywordflow">else</font> <font class="keywordflow">if</font> (fldName == <font class="stringliteral">"EAR"</font>)
00314     {
00315       <font class="comment">//tag.setArtist(fldData);</font>
00316       id3::v2::setArtist(tag, fldData);
00317     }
00318           
00319     <font class="comment">// the ALBUM field</font>
00320     <font class="keywordflow">else</font> <font class="keywordflow">if</font> (fldName == <font class="stringliteral">"EAL"</font>)
00321     {
00322       <font class="comment">//tag.setAlbum(fldData);</font>
00323       id3::v2::setAlbum(tag, fldData);
00324     }
00325           
00326     <font class="comment">// the Lyrics/Music AUTHOR field</font>
00327     <font class="keywordflow">else</font> <font class="keywordflow">if</font> (fldName == <font class="stringliteral">"AUT"</font>)
00328     {
00329       <font class="comment">//tag.setAuthor(fldData);</font>
00330       id3::v2::setLyricist(tag, fldData);
00331     }
00332           
00333     <font class="comment">// the INFORMATION field</font>
00334     <font class="keywordflow">else</font> <font class="keywordflow">if</font> (fldName == <font class="stringliteral">"INF"</font>)
00335     {
00336       <font class="comment">//tag.setInfo(fldData);</font>
00337       id3::v2::setComment(tag, fldData, <font class="stringliteral">"Lyrics3 v2.00 INF"</font>, <font class="stringliteral">"XXX"</font>);
00338     }
00339           
00340     <font class="comment">// the LYRICS field</font>
00341     <font class="keywordflow">else</font> <font class="keywordflow">if</font> (fldName == <font class="stringliteral">"LYR"</font>)
00342     {
00343       <font class="comment">// if already found an INF field, use it as description</font>
00344       String desc =  <font class="stringliteral">"Converted from Lyrics3 v2.00"</font>;
00345       <font class="comment">//tag.setLyrics(fldData);</font>
00346       <font class="keywordflow">if</font> (!has_time_stamps)
00347       {
00348         lyr_frame = id3::v2::setLyrics(tag, fldData, desc, <font class="stringliteral">"XXX"</font>);
00349       }
00350       <font class="keywordflow">else</font>
00351       {
00352         <font class="comment">// converts from lyrics3 to SYLT in-place</font>
00353         io::StringReader sr(fldData);
00354         ID3D_NOTICE( <font class="stringliteral">"lyr3::v2::parse: determining synced lyrics"</font> );
00355         BString sylt;
00356         io::BStringWriter sw(sylt);
00357         lyrics3ToSylt(sr, sw);
00358               
00359         lyr_frame = id3::v2::setSyncLyrics(tag, sylt, <a class="code" href="globals_8h.html#a225a213">ID3TSF_MS</a>, desc,
00360                                            <font class="stringliteral">"XXX"</font>, <a class="code" href="globals_8h.html#a224a206">ID3CT_LYRICS</a>);
00361         ID3D_NOTICE( <font class="stringliteral">"lyr3::v2::parse: determined synced lyrics"</font> );
00362       }
00363     }
00364     <font class="keywordflow">else</font> <font class="keywordflow">if</font> (fldName == <font class="stringliteral">"IMG"</font>)
00365     {
00366       <font class="comment">// currently unsupported</font>
00367       ID3D_WARNING( <font class="stringliteral">"lyr3::v2::parse: IMG field unsupported"</font> );
00368     }
00369     <font class="keywordflow">else</font>
00370     {
00371       ID3D_WARNING( <font class="stringliteral">"lyr3::v2::parse: undefined field id: "</font> &lt;&lt; 
00372                     fldName );
00373     }
00374   }
00375 
00376   et.setExitPos(beg);
00377   <font class="keywordflow">return</font> <font class="keyword">true</font>;
00378 }
</pre></div><hr><address><small>Generated on Thu Jan 3 07:35:56 2002 for id3lib by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.gif" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.12 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
 &copy;&nbsp;1997-2001</small></address>
</body>
</html>