Sophie

Sophie

distrib > Mandriva > 2011.0 > i586 > by-pkgid > 110b7614098f68585a9812e7161c059a > files > 105

libmpdclient-devel-2.3-1mdv2011.0.i586.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>libmpdclient: mpd/song.h 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.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</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>File&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>mpd/song.h File Reference</h1>
<p>MPD client library.  
<a href="#_details">More...</a></p>

<p><a href="song_8h_source.html">Go to the source code of this file.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="song_8h.html#a14a3bec200073ba4d763ec90eb913931">mpd_song_free</a> (struct <a class="el" href="structmpd__song.html">mpd_song</a> *song)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">mpd_malloc struct <a class="el" href="structmpd__song.html">mpd_song</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="song_8h.html#a4096f8fdf341a6df69202ebd10f7d169">mpd_song_dup</a> (const struct <a class="el" href="structmpd__song.html">mpd_song</a> *song)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">mpd_pure const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="song_8h.html#a8bf8a5fe7792142bb4e8b9f8c8aa41c6">mpd_song_get_uri</a> (const struct <a class="el" href="structmpd__song.html">mpd_song</a> *song)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">mpd_pure const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="song_8h.html#a9f2d7a7e71327af8b76184abb2928577">mpd_song_get_tag</a> (const struct <a class="el" href="structmpd__song.html">mpd_song</a> *song, enum <a class="el" href="tag_8h.html#a3e0e0c332f17c6570ffdf788a685adbf">mpd_tag_type</a> type, unsigned idx)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">mpd_pure unsigned&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="song_8h.html#a2a46725e34dfae405b1a59debd563214">mpd_song_get_duration</a> (const struct <a class="el" href="structmpd__song.html">mpd_song</a> *song)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">mpd_pure unsigned&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="song_8h.html#a5eae60f73a62ce09b805b7e988594b4a">mpd_song_get_start</a> (const struct <a class="el" href="structmpd__song.html">mpd_song</a> *song)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">mpd_pure unsigned&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="song_8h.html#a869f1d1a2c40566633204baf3dcbae58">mpd_song_get_end</a> (const struct <a class="el" href="structmpd__song.html">mpd_song</a> *song)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">mpd_pure time_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="song_8h.html#a752b8198f3c20935238b1b21aa763c1d">mpd_song_get_last_modified</a> (const struct <a class="el" href="structmpd__song.html">mpd_song</a> *song)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="song_8h.html#a8ad72f894f03169bc26e6215b536afb4">mpd_song_set_pos</a> (struct <a class="el" href="structmpd__song.html">mpd_song</a> *song, unsigned pos)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">mpd_pure unsigned&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="song_8h.html#a6addc5557258d63638564460a898c824">mpd_song_get_pos</a> (const struct <a class="el" href="structmpd__song.html">mpd_song</a> *song)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">mpd_pure unsigned&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="song_8h.html#a3877fa874259c12f3d726408f2ca1db5">mpd_song_get_id</a> (const struct <a class="el" href="structmpd__song.html">mpd_song</a> *song)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">mpd_malloc struct <a class="el" href="structmpd__song.html">mpd_song</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="song_8h.html#abef63023b693bea68e720a360e289f11">mpd_song_begin</a> (const struct <a class="el" href="structmpd__pair.html">mpd_pair</a> *pair)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="song_8h.html#aab90518606bb92863d8b1c1209a6e69f">mpd_song_feed</a> (struct <a class="el" href="structmpd__song.html">mpd_song</a> *song, const struct <a class="el" href="structmpd__pair.html">mpd_pair</a> *pair)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">mpd_malloc struct <a class="el" href="structmpd__song.html">mpd_song</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="song_8h.html#a8120782e7134894cf60ddc59a0b48b9b">mpd_recv_song</a> (struct <a class="el" href="structmpd__connection.html">mpd_connection</a> *connection)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>MPD client library. </p>
<p>Do not include this header directly. Use <a class="el" href="client_8h.html" title="MPD client library.">mpd/client.h</a> instead. </p>

<p>Definition in file <a class="el" href="song_8h_source.html">song.h</a>.</p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a8120782e7134894cf60ddc59a0b48b9b"></a><!-- doxytag: member="song.h::mpd_recv_song" ref="a8120782e7134894cf60ddc59a0b48b9b" args="(struct mpd_connection *connection)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mpd_malloc struct <a class="el" href="structmpd__song.html">mpd_song</a>* mpd_recv_song </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structmpd__connection.html">mpd_connection</a> *&nbsp;</td>
          <td class="paramname"> <em>connection</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Receives the next song from the MPD server.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>a <a class="el" href="structmpd__song.html">mpd_song</a> object, or NULL on error or if the song list is finished </dd></dl>

</div>
</div>
<a class="anchor" id="abef63023b693bea68e720a360e289f11"></a><!-- doxytag: member="song.h::mpd_song_begin" ref="abef63023b693bea68e720a360e289f11" args="(const struct mpd_pair *pair)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mpd_malloc struct <a class="el" href="structmpd__song.html">mpd_song</a>* mpd_song_begin </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structmpd__pair.html">mpd_pair</a> *&nbsp;</td>
          <td class="paramname"> <em>pair</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Begins parsing a new song.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pair</em>&nbsp;</td><td>the first pair in this song (name must be "file") </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the new <a class="el" href="structmpd__entity.html">mpd_entity</a> object, or NULL on error (out of memory, or pair name is not "file") </dd></dl>

</div>
</div>
<a class="anchor" id="a4096f8fdf341a6df69202ebd10f7d169"></a><!-- doxytag: member="song.h::mpd_song_dup" ref="a4096f8fdf341a6df69202ebd10f7d169" args="(const struct mpd_song *song)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mpd_malloc struct <a class="el" href="structmpd__song.html">mpd_song</a>* mpd_song_dup </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structmpd__song.html">mpd_song</a> *&nbsp;</td>
          <td class="paramname"> <em>song</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Duplicates the specified <a class="el" href="structmpd__song.html">mpd_song</a> object.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the copy, or NULL if out of memory </dd></dl>

</div>
</div>
<a class="anchor" id="aab90518606bb92863d8b1c1209a6e69f"></a><!-- doxytag: member="song.h::mpd_song_feed" ref="aab90518606bb92863d8b1c1209a6e69f" args="(struct mpd_song *song, const struct mpd_pair *pair)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool mpd_song_feed </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structmpd__song.html">mpd_song</a> *&nbsp;</td>
          <td class="paramname"> <em>song</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct <a class="el" href="structmpd__pair.html">mpd_pair</a> *&nbsp;</td>
          <td class="paramname"> <em>pair</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Parses the pair, adding its information to the specified <a class="el" href="structmpd__song.html">mpd_song</a> object.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the pair was parsed and added to the song (or if the pair was not understood and ignored), false if this pair is the beginning of the next song </dd></dl>

</div>
</div>
<a class="anchor" id="a14a3bec200073ba4d763ec90eb913931"></a><!-- doxytag: member="song.h::mpd_song_free" ref="a14a3bec200073ba4d763ec90eb913931" args="(struct mpd_song *song)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mpd_song_free </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structmpd__song.html">mpd_song</a> *&nbsp;</td>
          <td class="paramname"> <em>song</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Free memory allocated by the <a class="el" href="structmpd__song.html">mpd_song</a> object. </p>

</div>
</div>
<a class="anchor" id="a2a46725e34dfae405b1a59debd563214"></a><!-- doxytag: member="song.h::mpd_song_get_duration" ref="a2a46725e34dfae405b1a59debd563214" args="(const struct mpd_song *song)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mpd_pure unsigned mpd_song_get_duration </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structmpd__song.html">mpd_song</a> *&nbsp;</td>
          <td class="paramname"> <em>song</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the duration of this song in seconds. 0 means the duration is unknown. </p>

</div>
</div>
<a class="anchor" id="a869f1d1a2c40566633204baf3dcbae58"></a><!-- doxytag: member="song.h::mpd_song_get_end" ref="a869f1d1a2c40566633204baf3dcbae58" args="(const struct mpd_song *song)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mpd_pure unsigned mpd_song_get_end </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structmpd__song.html">mpd_song</a> *&nbsp;</td>
          <td class="paramname"> <em>song</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the end of the virtual song within the physical file in seconds. Zero means that the physical song file is played to the end. </p>

</div>
</div>
<a class="anchor" id="a3877fa874259c12f3d726408f2ca1db5"></a><!-- doxytag: member="song.h::mpd_song_get_id" ref="a3877fa874259c12f3d726408f2ca1db5" args="(const struct mpd_song *song)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mpd_pure unsigned mpd_song_get_id </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structmpd__song.html">mpd_song</a> *&nbsp;</td>
          <td class="paramname"> <em>song</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the id of this song in the playlist. The value is undefined if you did not obtain this song from the queue. </p>

</div>
</div>
<a class="anchor" id="a752b8198f3c20935238b1b21aa763c1d"></a><!-- doxytag: member="song.h::mpd_song_get_last_modified" ref="a752b8198f3c20935238b1b21aa763c1d" args="(const struct mpd_song *song)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mpd_pure time_t mpd_song_get_last_modified </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structmpd__song.html">mpd_song</a> *&nbsp;</td>
          <td class="paramname"> <em>song</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd>the POSIX UTC time stamp of the last modification, or 0 if that is unknown </dd></dl>

</div>
</div>
<a class="anchor" id="a6addc5557258d63638564460a898c824"></a><!-- doxytag: member="song.h::mpd_song_get_pos" ref="a6addc5557258d63638564460a898c824" args="(const struct mpd_song *song)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mpd_pure unsigned mpd_song_get_pos </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structmpd__song.html">mpd_song</a> *&nbsp;</td>
          <td class="paramname"> <em>song</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the position of this song in the queue. The value is undefined if you did not obtain this song from the queue. </p>

</div>
</div>
<a class="anchor" id="a5eae60f73a62ce09b805b7e988594b4a"></a><!-- doxytag: member="song.h::mpd_song_get_start" ref="a5eae60f73a62ce09b805b7e988594b4a" args="(const struct mpd_song *song)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mpd_pure unsigned mpd_song_get_start </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structmpd__song.html">mpd_song</a> *&nbsp;</td>
          <td class="paramname"> <em>song</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the start of the virtual song within the physical file in seconds. </p>

</div>
</div>
<a class="anchor" id="a9f2d7a7e71327af8b76184abb2928577"></a><!-- doxytag: member="song.h::mpd_song_get_tag" ref="a9f2d7a7e71327af8b76184abb2928577" args="(const struct mpd_song *song, enum mpd_tag_type type, unsigned idx)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mpd_pure const char* mpd_song_get_tag </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structmpd__song.html">mpd_song</a> *&nbsp;</td>
          <td class="paramname"> <em>song</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum <a class="el" href="tag_8h.html#a3e0e0c332f17c6570ffdf788a685adbf">mpd_tag_type</a>&nbsp;</td>
          <td class="paramname"> <em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&nbsp;</td>
          <td class="paramname"> <em>idx</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Queries a tag value.</p>
<dl><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 song object </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>type</em>&nbsp;</td><td>the tag type </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>idx</em>&nbsp;</td><td>pass 0 to get the first value for this tag type. This argument may be used to iterate all values, until this function returns NULL </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the tag value, or NULL if this tag type (or this index) does not exist </dd></dl>

</div>
</div>
<a class="anchor" id="a8bf8a5fe7792142bb4e8b9f8c8aa41c6"></a><!-- doxytag: member="song.h::mpd_song_get_uri" ref="a8bf8a5fe7792142bb4e8b9f8c8aa41c6" args="(const struct mpd_song *song)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mpd_pure const char* mpd_song_get_uri </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structmpd__song.html">mpd_song</a> *&nbsp;</td>
          <td class="paramname"> <em>song</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the URI of the song. This is either a path relative to the MPD music directory (without leading slash), or an URL with a scheme, e.g. a HTTP URL for a radio stream. </p>

</div>
</div>
<a class="anchor" id="a8ad72f894f03169bc26e6215b536afb4"></a><!-- doxytag: member="song.h::mpd_song_set_pos" ref="a8ad72f894f03169bc26e6215b536afb4" args="(struct mpd_song *song, unsigned pos)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mpd_song_set_pos </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structmpd__song.html">mpd_song</a> *&nbsp;</td>
          <td class="paramname"> <em>song</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&nbsp;</td>
          <td class="paramname"> <em>pos</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets the position within the queue. This value is not used for songs which are not in the queue.</p>
<p>This function is useful when applying the values returned by <a class="el" href="queue_8h.html#a0e2b38071fbdd2cd7de83d308f8b6980">mpd_recv_queue_change_brief()</a>. </p>

</div>
</div>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Sun Aug 8 15:52:36 2010 for libmpdclient by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>