Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > ca44e7e21c4b6cd5e0c5fdfbf12b4de7 > files > 117

libnjb-devel-2.2.6-6.fc12.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>libnjb: /builddir/build/BUILD/libnjb-2.2.6/src/songid.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_a231d544ee85f784af5e92462fb4d8ea.html">src</a>
  </div>
</div>
<div class="contents">
<h1>songid.c File Reference</h1><code>#include &lt;stdlib.h&gt;</code><br>
<code>#include &lt;string.h&gt;</code><br>
<code>#include &quot;<a class="el" href="libnjb_8h_source.html">libnjb.h</a>&quot;</code><br>
<code>#include &quot;base.h&quot;</code><br>
<code>#include &quot;njb_error.h&quot;</code><br>
<code>#include &quot;defs.h&quot;</code><br>
<code>#include &quot;<a class="el" href="protocol3_8h_source.html">protocol3.h</a>&quot;</code><br>
<code>#include &quot;byteorder.h&quot;</code><br>
<code>#include &quot;unicode.h&quot;</code><br>
<code>#include &quot;songid.h&quot;</code><br>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="songid_8c.html#45b5269914f6344786abba0c71be9f9c">UNICODE_ON_NJB1</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="songid_8c.html#ca3add068262c65430b3ded8522391f4">FR_UNI_TITLE</a>&nbsp;&nbsp;&nbsp;&quot;UNI_TITLE&quot;</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="songid_8c.html#d3f108464292f93a1d456dea47971d2e">FR_UNI_ALBUM</a>&nbsp;&nbsp;&nbsp;&quot;UNI_ALBUM&quot;</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="songid_8c.html#be77c2c86a1e4bc8af488aacad287939">FR_UNI_GENRE</a>&nbsp;&nbsp;&nbsp;&quot;UNI_GENRE&quot;</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="songid_8c.html#2b7618b982e8bc6a07c8a94fd76b83fd">FR_UNI_ARTIST</a>&nbsp;&nbsp;&nbsp;&quot;UNI_ARTIST&quot;</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="songid_8c.html#e3eb27dfbd7ad393f3c379d01286c659">FR_UNI_FNAME</a>&nbsp;&nbsp;&nbsp;&quot;UNI_FNAME&quot;</td></tr>

<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structnjb__songid__struct.html">njb_songid_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tagapi.html#g78703030798af2be6808335c6542aa6d">NJB_Songid_New</a> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structnjb__songid__struct.html">njb_songid_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="songid_8c.html#b4fd686d31cb66af604ab8cd1b285046">songid_unpack</a> (void *data, size_t nbytes)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="songid_8c.html#1dcd88c13e7b209d9a5b6e31e71ff6e6">songid_pack</a> (<a class="el" href="structnjb__songid__struct.html">njb_songid_t</a> *song, u_int32_t *tagsize)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="songid_8c.html#4a04f572c79d5f5c4b813ba8c1932f6b">songid_pack3</a> (<a class="el" href="structnjb__songid__struct.html">njb_songid_t</a> *song, u_int32_t *tagsize)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tagapi.html#g0f78d8cde327dd995f7008935e295c37">NJB_Songid_Addframe</a> (<a class="el" href="structnjb__songid__struct.html">njb_songid_t</a> *song, <a class="el" href="structnjb__songid__frame__struct.html">njb_songid_frame_t</a> *frame)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tagapi.html#g188d05568998e787366804565e9fcfb5">NJB_Songid_Destroy</a> (<a class="el" href="structnjb__songid__struct.html">njb_songid_t</a> *songid)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tagapi.html#g8eada6cbbc26c6aa18f3c22a20d38756">NJB_Songid_Reset_Getframe</a> (<a class="el" href="structnjb__songid__struct.html">njb_songid_t</a> *song)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structnjb__songid__frame__struct.html">njb_songid_frame_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tagapi.html#g0013c681283968bf65b564beb8109e5b">NJB_Songid_Getframe</a> (<a class="el" href="structnjb__songid__struct.html">njb_songid_t</a> *song)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structnjb__songid__frame__struct.html">njb_songid_frame_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tagapi.html#ge02110b5c20cddfcf92bbdbdeeef4039">NJB_Songid_Findframe</a> (<a class="el" href="structnjb__songid__struct.html">njb_songid_t</a> *song, const char *label)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="songid_8c.html#4c7679ba70de1bdabcfe90c2e6308008">songid_sanity_check</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, <a class="el" href="structnjb__songid__struct.html">njb_songid_t</a> *songid)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structnjb__songid__frame__struct.html">njb_songid_frame_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tagapi.html#g0423c3d42d53466d75bb9bf903601285">NJB_Songid_Frame_New_String</a> (const char *label, const char *value)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structnjb__songid__frame__struct.html">njb_songid_frame_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tagapi.html#gbcbe1903a855d72b5e2b933c041a98bf">NJB_Songid_Frame_New_Codec</a> (const char *value)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structnjb__songid__frame__struct.html">njb_songid_frame_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tagapi.html#g144e0f1fbe75bd301c62dcae56d9d3af">NJB_Songid_Frame_New_Uint16</a> (const char *label, u_int16_t value)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structnjb__songid__frame__struct.html">njb_songid_frame_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tagapi.html#g3d4fa0c440b4377a662ff986ba10cddf">NJB_Songid_Frame_New_Uint32</a> (const char *label, u_int32_t value)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tagapi.html#g3bb4c23e9166574fdb5f25d082a38b84">NJB_Songid_Frame_Destroy</a> (<a class="el" href="structnjb__songid__frame__struct.html">njb_songid_frame_t</a> *frame)</td></tr>

<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="songid_8c.html#60db410c9e82d9e61b1bf0be607922ed">__sub_depth</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="songid_8c.html#c04b373ed657c74d96015d8935eb57b0">njb_unicode_flag</a></td></tr>

</table>
<hr><h2>Detailed Description</h2>
This file contains the functions that are used for manipulating all song/track metadata, such as artist, title etc. <hr><h2>Define Documentation</h2>
<a class="anchor" name="d3f108464292f93a1d456dea47971d2e"></a><!-- doxytag: member="songid.c::FR_UNI_ALBUM" ref="d3f108464292f93a1d456dea47971d2e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define FR_UNI_ALBUM&nbsp;&nbsp;&nbsp;&quot;UNI_ALBUM&quot;          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Unicode Album metadata for NJB1 
<p>Referenced by <a class="el" href="songid_8c_source.html#l00233">songid_pack()</a>, and <a class="el" href="songid_8c_source.html#l00068">songid_unpack()</a>.</p>

</div>
</div><p>
<a class="anchor" name="2b7618b982e8bc6a07c8a94fd76b83fd"></a><!-- doxytag: member="songid.c::FR_UNI_ARTIST" ref="2b7618b982e8bc6a07c8a94fd76b83fd" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define FR_UNI_ARTIST&nbsp;&nbsp;&nbsp;&quot;UNI_ARTIST&quot;          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Unicode Artist metadata for NJB1 
<p>Referenced by <a class="el" href="songid_8c_source.html#l00233">songid_pack()</a>, and <a class="el" href="songid_8c_source.html#l00068">songid_unpack()</a>.</p>

</div>
</div><p>
<a class="anchor" name="e3eb27dfbd7ad393f3c379d01286c659"></a><!-- doxytag: member="songid.c::FR_UNI_FNAME" ref="e3eb27dfbd7ad393f3c379d01286c659" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define FR_UNI_FNAME&nbsp;&nbsp;&nbsp;&quot;UNI_FNAME&quot;          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Unicode Filename metadata for NJB1 (not used) 
<p>Referenced by <a class="el" href="songid_8c_source.html#l00068">songid_unpack()</a>.</p>

</div>
</div><p>
<a class="anchor" name="be77c2c86a1e4bc8af488aacad287939"></a><!-- doxytag: member="songid.c::FR_UNI_GENRE" ref="be77c2c86a1e4bc8af488aacad287939" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define FR_UNI_GENRE&nbsp;&nbsp;&nbsp;&quot;UNI_GENRE&quot;          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Unicode Genre metadata for NJB1 
<p>Referenced by <a class="el" href="songid_8c_source.html#l00233">songid_pack()</a>, and <a class="el" href="songid_8c_source.html#l00068">songid_unpack()</a>.</p>

</div>
</div><p>
<a class="anchor" name="ca3add068262c65430b3ded8522391f4"></a><!-- doxytag: member="songid.c::FR_UNI_TITLE" ref="ca3add068262c65430b3ded8522391f4" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define FR_UNI_TITLE&nbsp;&nbsp;&nbsp;&quot;UNI_TITLE&quot;          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Unicode Title metadata for NJB1 
<p>Referenced by <a class="el" href="songid_8c_source.html#l00233">songid_pack()</a>, and <a class="el" href="songid_8c_source.html#l00068">songid_unpack()</a>.</p>

</div>
</div><p>
<a class="anchor" name="45b5269914f6344786abba0c71be9f9c"></a><!-- doxytag: member="songid.c::UNICODE_ON_NJB1" ref="45b5269914f6344786abba0c71be9f9c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define UNICODE_ON_NJB1          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
We want to use Unicode also on NJB1 
</div>
</div><p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="1dcd88c13e7b209d9a5b6e31e71ff6e6"></a><!-- doxytag: member="songid.c::songid_pack" ref="1dcd88c13e7b209d9a5b6e31e71ff6e6" args="(njb_songid_t *song, u_int32_t *tagsize)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned char* songid_pack           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__songid__struct.html">njb_songid_t</a> *&nbsp;</td>
          <td class="paramname"> <em>song</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int32_t *&nbsp;</td>
          <td class="paramname"> <em>tagsize</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This packs (serialize, marshal) a libnjb song ID into the raw byte structure used by the NJB1.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>song</em>&nbsp;</td><td>the libnjb song ID to pack </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>tagsize</em>&nbsp;</td><td>a pointer to an integer that will hold the size of the resulting NJB1 songid structure </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>a newly allocated byte array holding the NJB1 representation of the song ID, the memory should be freed by the caller after use </dd></dl>

<p>References <a class="el" href="structnjb__songid__frame__struct.html#10a23445028d703238342f51067b2dbb">njb_songid_frame_struct::data</a>, <a class="el" href="libnjb_8h_source.html#l00116">FR_ALBUM</a>, <a class="el" href="libnjb_8h_source.html#l00118">FR_ARTIST</a>, <a class="el" href="libnjb_8h_source.html#l00117">FR_GENRE</a>, <a class="el" href="libnjb_8h_source.html#l00115">FR_TITLE</a>, <a class="el" href="songid_8c_source.html#l00027">FR_UNI_ALBUM</a>, <a class="el" href="songid_8c_source.html#l00029">FR_UNI_ARTIST</a>, <a class="el" href="songid_8c_source.html#l00028">FR_UNI_GENRE</a>, <a class="el" href="songid_8c_source.html#l00026">FR_UNI_TITLE</a>, <a class="el" href="byteorder_8c_source.html#l00183">from_16bit_to_njb1_bytes()</a>, <a class="el" href="byteorder_8c_source.html#l00112">from_32bit_to_njb1_bytes()</a>, <a class="el" href="libnjb_8h_source.html#l00203">njb_songid_frame_struct::label</a>, <a class="el" href="libnjb_8h_source.html#l00224">njb_songid_struct::nframes</a>, <a class="el" href="songid_8c_source.html#l00720">NJB_Songid_Getframe()</a>, <a class="el" href="songid_8c_source.html#l00707">NJB_Songid_Reset_Getframe()</a>, <a class="el" href="libnjb_8h_source.html#l00093">NJB_TYPE_STRING</a>, <a class="el" href="libnjb_8h_source.html#l00094">NJB_TYPE_UINT16</a>, <a class="el" href="libnjb_8h_source.html#l00095">NJB_TYPE_UINT32</a>, <a class="el" href="libnjb_8h_source.html#l00147">NJB_UC_UTF8</a>, <a class="el" href="unicode_8c_source.html#l00255">strtoucs2()</a>, <a class="el" href="libnjb_8h_source.html#l00209">njb_songid_frame_struct::strval</a>, <a class="el" href="libnjb_8h_source.html#l00204">njb_songid_frame_struct::type</a>, <a class="el" href="libnjb_8h_source.html#l00211">njb_songid_frame_struct::u_int16_val</a>, <a class="el" href="libnjb_8h_source.html#l00212">njb_songid_frame_struct::u_int32_val</a>, <a class="el" href="unicode_8c_source.html#l00050">ucs2strlen()</a>, and <a class="el" href="unicode_8c_source.html#l00147">utf8tostr()</a>.</p>

<p>Referenced by <a class="el" href="procedure_8c_source.html#l02895">NJB_Replace_Track_Tag()</a>, and <a class="el" href="procedure_8c_source.html#l01592">NJB_Send_Track()</a>.</p>

</div>
</div><p>
<a class="anchor" name="4a04f572c79d5f5c4b813ba8c1932f6b"></a><!-- doxytag: member="songid.c::songid_pack3" ref="4a04f572c79d5f5c4b813ba8c1932f6b" args="(njb_songid_t *song, u_int32_t *tagsize)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned char* songid_pack3           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__songid__struct.html">njb_songid_t</a> *&nbsp;</td>
          <td class="paramname"> <em>song</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int32_t *&nbsp;</td>
          <td class="paramname"> <em>tagsize</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This packs (serialize, marshal) a libnjb song ID into the raw byte structure used by the series 3 devices.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>song</em>&nbsp;</td><td>the libnjb song ID to pack </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>tagsize</em>&nbsp;</td><td>a pointer to an integer that will hold the size of the resulting series 3 songid structure </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>a newly allocated byte array holding the series 3 representation of the song ID, the memory should be freed by the caller after use </dd></dl>

<p>References <a class="el" href="structnjb__songid__frame__struct.html#10a23445028d703238342f51067b2dbb">njb_songid_frame_struct::data</a>, <a class="el" href="libnjb_8h_source.html#l00116">FR_ALBUM</a>, <a class="el" href="libnjb_8h_source.html#l00118">FR_ARTIST</a>, <a class="el" href="libnjb_8h_source.html#l00114">FR_CODEC</a>, <a class="el" href="libnjb_8h_source.html#l00120">FR_FNAME</a>, <a class="el" href="libnjb_8h_source.html#l00127">FR_FOLDER</a>, <a class="el" href="libnjb_8h_source.html#l00117">FR_GENRE</a>, <a class="el" href="libnjb_8h_source.html#l00113">FR_LENGTH</a>, <a class="el" href="libnjb_8h_source.html#l00122">FR_PROTECTED</a>, <a class="el" href="libnjb_8h_source.html#l00112">FR_SIZE</a>, <a class="el" href="libnjb_8h_source.html#l00115">FR_TITLE</a>, <a class="el" href="libnjb_8h_source.html#l00119">FR_TRACK</a>, <a class="el" href="libnjb_8h_source.html#l00121">FR_YEAR</a>, <a class="el" href="byteorder_8c_source.html#l00198">from_16bit_to_njb3_bytes()</a>, <a class="el" href="byteorder_8c_source.html#l00129">from_32bit_to_njb3_bytes()</a>, <a class="el" href="libnjb_8h_source.html#l00203">njb_songid_frame_struct::label</a>, <a class="el" href="libnjb_8h_source.html#l00224">njb_songid_struct::nframes</a>, <a class="el" href="libnjb_8h_source.html#l00105">NJB_CODEC_AA</a>, <a class="el" href="libnjb_8h_source.html#l00102">NJB_CODEC_MP3</a>, <a class="el" href="libnjb_8h_source.html#l00104">NJB_CODEC_WAV</a>, <a class="el" href="libnjb_8h_source.html#l00103">NJB_CODEC_WMA</a>, <a class="el" href="songid_8c_source.html#l00720">NJB_Songid_Getframe()</a>, <a class="el" href="songid_8c_source.html#l00707">NJB_Songid_Reset_Getframe()</a>, <a class="el" href="unicode_8c_source.html#l00255">strtoucs2()</a>, <a class="el" href="libnjb_8h_source.html#l00209">njb_songid_frame_struct::strval</a>, <a class="el" href="libnjb_8h_source.html#l00211">njb_songid_frame_struct::u_int16_val</a>, and <a class="el" href="unicode_8c_source.html#l00050">ucs2strlen()</a>.</p>

<p>Referenced by <a class="el" href="procedure_8c_source.html#l02895">NJB_Replace_Track_Tag()</a>, and <a class="el" href="procedure_8c_source.html#l01592">NJB_Send_Track()</a>.</p>

</div>
</div><p>
<a class="anchor" name="4c7679ba70de1bdabcfe90c2e6308008"></a><!-- doxytag: member="songid.c::songid_sanity_check" ref="4c7679ba70de1bdabcfe90c2e6308008" args="(njb_t *njb, njb_songid_t *songid)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int songid_sanity_check           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&nbsp;</td>
          <td class="paramname"> <em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structnjb__songid__struct.html">njb_songid_t</a> *&nbsp;</td>
          <td class="paramname"> <em>songid</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This function checks that a tag has all compulsory elements, i.e.: size, codec and track number<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>songid</em>&nbsp;</td><td>the song ID to be checked for sanity </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if the tag is sane, -1 if it is insane </dd></dl>

<p>References <a class="el" href="structnjb__songid__frame__struct.html#10a23445028d703238342f51067b2dbb">njb_songid_frame_struct::data</a>, <a class="el" href="libnjb_8h_source.html#l00114">FR_CODEC</a>, <a class="el" href="libnjb_8h_source.html#l00113">FR_LENGTH</a>, <a class="el" href="libnjb_8h_source.html#l00122">FR_PROTECTED</a>, <a class="el" href="libnjb_8h_source.html#l00112">FR_SIZE</a>, <a class="el" href="libnjb_8h_source.html#l00115">FR_TITLE</a>, <a class="el" href="libnjb_8h_source.html#l00119">FR_TRACK</a>, <a class="el" href="libnjb_8h_source.html#l00121">FR_YEAR</a>, <a class="el" href="libnjb_8h_source.html#l00203">njb_songid_frame_struct::label</a>, <a class="el" href="libnjb_8h_source.html#l00102">NJB_CODEC_MP3</a>, <a class="el" href="libnjb_8h_source.html#l00104">NJB_CODEC_WAV</a>, <a class="el" href="libnjb_8h_source.html#l00103">NJB_CODEC_WMA</a>, <a class="el" href="songid_8c_source.html#l00651">NJB_Songid_Addframe()</a>, <a class="el" href="songid_8c_source.html#l00720">NJB_Songid_Getframe()</a>, <a class="el" href="songid_8c_source.html#l00707">NJB_Songid_Reset_Getframe()</a>, <a class="el" href="libnjb_8h_source.html#l00093">NJB_TYPE_STRING</a>, <a class="el" href="libnjb_8h_source.html#l00094">NJB_TYPE_UINT16</a>, <a class="el" href="libnjb_8h_source.html#l00095">NJB_TYPE_UINT32</a>, <a class="el" href="libnjb_8h_source.html#l00209">njb_songid_frame_struct::strval</a>, <a class="el" href="libnjb_8h_source.html#l00204">njb_songid_frame_struct::type</a>, <a class="el" href="libnjb_8h_source.html#l00211">njb_songid_frame_struct::u_int16_val</a>, and <a class="el" href="libnjb_8h_source.html#l00212">njb_songid_frame_struct::u_int32_val</a>.</p>

<p>Referenced by <a class="el" href="procedure_8c_source.html#l02895">NJB_Replace_Track_Tag()</a>, and <a class="el" href="procedure_8c_source.html#l01592">NJB_Send_Track()</a>.</p>

</div>
</div><p>
<a class="anchor" name="b4fd686d31cb66af604ab8cd1b285046"></a><!-- doxytag: member="songid.c::songid_unpack" ref="b4fd686d31cb66af604ab8cd1b285046" args="(void *data, size_t nbytes)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structnjb__songid__struct.html">njb_songid_t</a>* songid_unpack           </td>
          <td>(</td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>nbytes</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This takes a raw chunk of memory representing a song ID as used by the NJB1 and convert it into a song ID structure as used by libnjb.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>the raw bytes from the NJB1 </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>nbytes</em>&nbsp;</td><td>the size of the NJB1 byte array </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>a newly allocated song ID that shall be freed by the caller after use </dd></dl>

<p>References <a class="el" href="libnjb_8h_source.html#l00116">FR_ALBUM</a>, <a class="el" href="libnjb_8h_source.html#l00118">FR_ARTIST</a>, <a class="el" href="libnjb_8h_source.html#l00120">FR_FNAME</a>, <a class="el" href="libnjb_8h_source.html#l00117">FR_GENRE</a>, <a class="el" href="libnjb_8h_source.html#l00113">FR_LENGTH</a>, <a class="el" href="libnjb_8h_source.html#l00115">FR_TITLE</a>, <a class="el" href="libnjb_8h_source.html#l00119">FR_TRACK</a>, <a class="el" href="songid_8c_source.html#l00027">FR_UNI_ALBUM</a>, <a class="el" href="songid_8c_source.html#l00029">FR_UNI_ARTIST</a>, <a class="el" href="songid_8c_source.html#l00031">FR_UNI_FNAME</a>, <a class="el" href="songid_8c_source.html#l00028">FR_UNI_GENRE</a>, <a class="el" href="songid_8c_source.html#l00026">FR_UNI_TITLE</a>, <a class="el" href="libnjb_8h_source.html#l00121">FR_YEAR</a>, <a class="el" href="byteorder_8c_source.html#l00146">njb1_bytes_to_16bit()</a>, <a class="el" href="byteorder_8c_source.html#l00072">njb1_bytes_to_32bit()</a>, <a class="el" href="songid_8c_source.html#l00651">NJB_Songid_Addframe()</a>, <a class="el" href="songid_8c_source.html#l00673">NJB_Songid_Destroy()</a>, <a class="el" href="songid_8c_source.html#l00840">NJB_Songid_Frame_New_String()</a>, <a class="el" href="songid_8c_source.html#l00912">NJB_Songid_Frame_New_Uint16()</a>, <a class="el" href="songid_8c_source.html#l00945">NJB_Songid_Frame_New_Uint32()</a>, <a class="el" href="songid_8c_source.html#l00042">NJB_Songid_New()</a>, <a class="el" href="libnjb_8h_source.html#l00147">NJB_UC_UTF8</a>, <a class="el" href="unicode_8c_source.html#l00117">strtoutf8()</a>, and <a class="el" href="unicode_8c_source.html#l00183">ucs2tostr()</a>.</p>

</div>
</div><p>
<hr><h2>Variable Documentation</h2>
<a class="anchor" name="60db410c9e82d9e61b1bf0be607922ed"></a><!-- doxytag: member="songid.c::__sub_depth" ref="60db410c9e82d9e61b1bf0be607922ed" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="usb__io_8c.html#60db410c9e82d9e61b1bf0be607922ed">__sub_depth</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
The current subroutine depth for all of libnjb (global) 
</div>
</div><p>
<a class="anchor" name="c04b373ed657c74d96015d8935eb57b0"></a><!-- doxytag: member="songid.c::njb_unicode_flag" ref="c04b373ed657c74d96015d8935eb57b0" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="unicode_8c.html#c04b373ed657c74d96015d8935eb57b0">njb_unicode_flag</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
A flag for if unicode is used or not (global) 
</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Jul 26 17:17:29 2009 for libnjb by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>