Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 191a8a9815631149211a94f0cdc8f64d > files > 84

libnjb-devel-2.2.7-1.fc14.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>libnjb: The track playback (listening) API</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.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">libnjb&#160;<span id="projectnumber">2.2.7</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><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>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">The track playback (listening) API</div>  </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__playapi.html#ga92cc70e7805c6fc0934017f81b72b80d">NJB_Play_Track</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, u_int32_t trackid)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__playapi.html#ga5c31fd1b835a7c2ea247de0d42767594">NJB_Queue_Track</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, u_int32_t trackid)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__playapi.html#ga749d9a967c9fb4688354c9021ed983bd">NJB_Stop_Play</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__playapi.html#gaf9fceab221dc8a288ec8a76740de3bef">NJB_Pause_Play</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__playapi.html#gad24506eacfc798236591ea15ef04f9eb">NJB_Resume_Play</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__playapi.html#gab7df05103977dbd080f989dc62d176bb">NJB_Seek_Track</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, u_int32_t position)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__playapi.html#ga6c29c35293a64aa06dbb6e726fbd5d42">NJB_Elapsed_Time</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, u_int16_t *elapsed, int *change)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga6c29c35293a64aa06dbb6e726fbd5d42"></a><!-- doxytag: member="libnjb.h::NJB_Elapsed_Time" ref="ga6c29c35293a64aa06dbb6e726fbd5d42" args="(njb_t *njb, u_int16_t *elapsed, int *change)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Elapsed_Time </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int16_t *&#160;</td>
          <td class="paramname"><em>elapsed</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>change</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function returns the elapsed time for the currently playing track on the device. Additionally, it signals if the track has changed, e.g. if the device has skipped to the next track in the queue.</p>
<p>Currently, it may only be determined if the currently playing track in the Nomad's play queue has changed (or ended) from a previous call to NJB_Elapsed_Time, because the indicator is that the elapsed time goes from a greater number to a lower number. Typically, when the first (zeroth) track in the play queue ends, the elapsed time is set to zero, and the change bit is set. However, if the zeroth track is the only track on the play queue, it must be more than 1 second long and NJB_Elapsed_Time must have been called at least once after 1 second actually has elapsed to register the change (song end) on a subsequent call to NJB_Elapsed_Time.</p>
<p>NOTE, the elapsed time will NOT always be zero when the change bit is set, as a call to NJB_Elapsed_Time may arrive late after a song has started.</p>
<p>NOTE, after NJB_Play_Track is called an immediate call NJB_Elapsed_Time will not indicate change, even if there was a track playing previously.</p>
<p>Obviously, this notification of change scheme is a flawed one, and some Nomad play queue management functions, such as finding out the actual trackid playing on the Nomad would be favored over this approach. One should not really rely too heavily on this approach.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the jukebox object that the track is playing on. </td></tr>
    <tr><td class="paramname">elapsed</td><td>a pointer to a variable that will hold the number of elapsed seconds after the call to this function. </td></tr>
    <tr><td class="paramname">change</td><td>a pointer to a variable that will hold 0 if the track has not changed, and something different from 0 if the track has changed. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cursesplay_8c-example.html#a12">cursesplay.c</a>, and <a class="el" href="play_8c-example.html#a9">play.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, and <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>.</p>

</div>
</div>
<a class="anchor" id="gaf9fceab221dc8a288ec8a76740de3bef"></a><!-- doxytag: member="libnjb.h::NJB_Pause_Play" ref="gaf9fceab221dc8a288ec8a76740de3bef" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Pause_Play </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This pauses the current playback of a track on the device.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the jukebox object to play the track on. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__playapi.html#gad24506eacfc798236591ea15ef04f9eb">NJB_Resume_Play()</a> </dd>
<dd>
<a class="el" href="group__playapi.html#ga749d9a967c9fb4688354c9021ed983bd">NJB_Stop_Play()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cursesplay_8c-example.html#a9">cursesplay.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga92cc70e7805c6fc0934017f81b72b80d"></a><!-- doxytag: member="libnjb.h::NJB_Play_Track" ref="ga92cc70e7805c6fc0934017f81b72b80d" args="(njb_t *njb, u_int32_t trackid)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Play_Track </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int32_t&#160;</td>
          <td class="paramname"><em>trackid</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This starts playing a certain track on the device. This command will implicitly clear any pending or playing playback queue. You may queue up other songs using <code><a class="el" href="group__playapi.html#ga5c31fd1b835a7c2ea247de0d42767594">NJB_Queue_Track()</a></code> while the first track is playing. The track on which you called <code><a class="el" href="group__playapi.html#ga92cc70e7805c6fc0934017f81b72b80d">NJB_Play_Track()</a></code> will implicitly be placed first in the queue.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the jukebox object to play the track on. </td></tr>
    <tr><td class="paramname">trackid</td><td>the track to play. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__playapi.html#ga5c31fd1b835a7c2ea247de0d42767594">NJB_Queue_Track()</a> </dd>
<dd>
<a class="el" href="group__playapi.html#ga749d9a967c9fb4688354c9021ed983bd">NJB_Stop_Play()</a> </dd>
<dd>
<a class="el" href="group__playapi.html#gaf9fceab221dc8a288ec8a76740de3bef">NJB_Pause_Play()</a> </dd>
<dd>
<a class="el" href="group__playapi.html#gab7df05103977dbd080f989dc62d176bb">NJB_Seek_Track()</a> </dd>
<dd>
<a class="el" href="group__playapi.html#ga6c29c35293a64aa06dbb6e726fbd5d42">NJB_Elapsed_Time()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cursesplay_8c-example.html#a7">cursesplay.c</a>, and <a class="el" href="play_8c-example.html#a7">play.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, and <a class="el" href="protocol_8c.html#ae5ea9fbb3859ec50540bcd9cf4a3f328">njb_verify_last_command()</a>.</p>

</div>
</div>
<a class="anchor" id="ga5c31fd1b835a7c2ea247de0d42767594"></a><!-- doxytag: member="libnjb.h::NJB_Queue_Track" ref="ga5c31fd1b835a7c2ea247de0d42767594" args="(njb_t *njb, u_int32_t trackid)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Queue_Track </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int32_t&#160;</td>
          <td class="paramname"><em>trackid</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This adds a track to the play queue of a device.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the jukebox object to play the track on. </td></tr>
    <tr><td class="paramname">trackid</td><td>the track to add to the queue. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cursesplay_8c-example.html#a8">cursesplay.c</a>, and <a class="el" href="play_8c-example.html#a8">play.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, and <a class="el" href="protocol_8c.html#ae5ea9fbb3859ec50540bcd9cf4a3f328">njb_verify_last_command()</a>.</p>

</div>
</div>
<a class="anchor" id="gad24506eacfc798236591ea15ef04f9eb"></a><!-- doxytag: member="libnjb.h::NJB_Resume_Play" ref="gad24506eacfc798236591ea15ef04f9eb" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Resume_Play </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This resumes play of a track on the device after pause.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the jukebox object to resume the track on. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__playapi.html#gaf9fceab221dc8a288ec8a76740de3bef">NJB_Pause_Play()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cursesplay_8c-example.html#a10">cursesplay.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="gab7df05103977dbd080f989dc62d176bb"></a><!-- doxytag: member="libnjb.h::NJB_Seek_Track" ref="gab7df05103977dbd080f989dc62d176bb" args="(njb_t *njb, u_int32_t position)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Seek_Track </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int32_t&#160;</td>
          <td class="paramname"><em>position</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This seeks into an offset of the currenly playing track on the device. You can skip to an offset forward/backward in the currently playing file, given as milliseconds.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the jukebox object to stop the current playing track on. </td></tr>
    <tr><td class="paramname">position</td><td>the position in the track file given as milliseconds. Offsets larger than the file length should not be used. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cursesplay_8c-example.html#a11">cursesplay.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga749d9a967c9fb4688354c9021ed983bd"></a><!-- doxytag: member="libnjb.h::NJB_Stop_Play" ref="ga749d9a967c9fb4688354c9021ed983bd" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Stop_Play </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This stops playback of a track on the device.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the jukebox object to stop the current playing track on. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__playapi.html#gaf9fceab221dc8a288ec8a76740de3bef">NJB_Pause_Play()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cursesplay_8c-example.html#a13">cursesplay.c</a>, and <a class="el" href="play_8c-example.html#a10">play.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, and <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>.</p>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Sat Jun 25 2011 for libnjb by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>