Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > 23fdeec2afeeb035357795bcffb419c6 > files > 48

libmtp-doc-1.0.2-1mdv2010.1.x86_64.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>libmtp: The audio/video playlist management 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.6.2 -->
<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><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="contents">
<h1>The audio/video playlist management API.</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structLIBMTP__playlist__struct.html">LIBMTP_playlist_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__playlists.html#ga2053102a0b5f3a8a56fc8aec4d76c064">LIBMTP_new_playlist_t</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__playlists.html#ga8d6ce37c43c3cbbac49de849d8aafe77">LIBMTP_destroy_playlist_t</a> (<a class="el" href="structLIBMTP__playlist__struct.html">LIBMTP_playlist_t</a> *)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structLIBMTP__playlist__struct.html">LIBMTP_playlist_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__playlists.html#ga0d4fc219b6680185584ec1a3e63c9e24">LIBMTP_Get_Playlist_List</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structLIBMTP__playlist__struct.html">LIBMTP_playlist_t</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__playlists.html#ga463909ddaa9e0e26055aa21f4d895598">LIBMTP_Get_Playlist</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *, uint32_t const)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__playlists.html#ga7f6918e38993f51b1e32b1d61fcf6dab">LIBMTP_Create_New_Playlist</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *, <a class="el" href="structLIBMTP__playlist__struct.html">LIBMTP_playlist_t</a> *const)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__playlists.html#ga03f4cc9c57a6d651add7528d5477a758">LIBMTP_Update_Playlist</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *, <a class="el" href="structLIBMTP__playlist__struct.html">LIBMTP_playlist_t</a> *const)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__playlists.html#ga312a94c994a3b7bcce08a239fbe09938">LIBMTP_Set_Playlist_Name</a> (<a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *, <a class="el" href="structLIBMTP__playlist__struct.html">LIBMTP_playlist_t</a> *, const char *)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga7f6918e38993f51b1e32b1d61fcf6dab"></a><!-- doxytag: member="libmtp.h::LIBMTP_Create_New_Playlist" ref="ga7f6918e38993f51b1e32b1d61fcf6dab" args="(LIBMTP_mtpdevice_t *, LIBMTP_playlist_t *const)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int LIBMTP_Create_New_Playlist </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structLIBMTP__playlist__struct.html">LIBMTP_playlist_t</a> *const &nbsp;</td>
          <td class="paramname"> <em>metadata</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 routine creates a new playlist based on the metadata supplied. If the <code>tracks</code> field of the metadata contains a track listing, these tracks will be added to the playlist. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device to create the new playlist on. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>metadata</em>&nbsp;</td><td>the metadata for the new playlist. If the function exits with success, the <code>playlist_id</code> field of this struct will contain the new playlist ID of the playlist. </p>
<ul>
<li>
<code>metadata-&gt;parent_id</code> should be set to the parent (e.g. folder) to store this track in. Since some devices are a bit picky about where files are placed, a default folder will be chosen if libmtp has detected one for the current filetype and this parameter is set to 0. If this is 0 and no default folder can be found, the file will be stored in the root folder. </li>
<li>
<code>metadata-&gt;storage_id</code> should be set to the desired storage (e.g. memory card or whatever your device presents) to store this track in. Setting this to 0 will store the track on the primary storage. </li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, any other value means failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__playlists.html#ga03f4cc9c57a6d651add7528d5477a758">LIBMTP_Update_Playlist()</a> </dd>
<dd>
<a class="el" href="group__objects.html#gac867594319fa48a0d6077d17aaf66222">LIBMTP_Delete_Object()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00601">LIBMTP_mtpdevice_struct::default_music_folder</a>, <a class="el" href="libmtp_8h_source.html#l00603">LIBMTP_mtpdevice_struct::default_playlist_folder</a>, <a class="el" href="libmtp_8h_source.html#l00673">LIBMTP_playlist_struct::name</a>, <a class="el" href="libmtp_8h_source.html#l00675">LIBMTP_playlist_struct::no_tracks</a>, <a class="el" href="libmtp_8h_source.html#l00671">LIBMTP_playlist_struct::parent_id</a>, <a class="el" href="libmtp_8h_source.html#l00670">LIBMTP_playlist_struct::playlist_id</a>, <a class="el" href="libmtp_8h_source.html#l00672">LIBMTP_playlist_struct::storage_id</a>, <a class="el" href="libmtp_8h_source.html#l00674">LIBMTP_playlist_struct::tracks</a>, and <a class="el" href="libmtp_8h_source.html#l00585">LIBMTP_mtpdevice_struct::usbinfo</a>.</p>

</div>
</div>
<a class="anchor" id="ga8d6ce37c43c3cbbac49de849d8aafe77"></a><!-- doxytag: member="libmtp.h::LIBMTP_destroy_playlist_t" ref="ga8d6ce37c43c3cbbac49de849d8aafe77" args="(LIBMTP_playlist_t *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void LIBMTP_destroy_playlist_t </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__playlist__struct.html">LIBMTP_playlist_t</a> *&nbsp;</td>
          <td class="paramname"> <em>playlist</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This destroys a playlist metadata structure and deallocates the memory used by it, including any strings. Never use a track metadata structure again after calling this function on it. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>playlist</em>&nbsp;</td><td>the playlist metadata to destroy. </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__playlists.html#ga2053102a0b5f3a8a56fc8aec4d76c064">LIBMTP_new_playlist_t()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00673">LIBMTP_playlist_struct::name</a>, and <a class="el" href="libmtp_8h_source.html#l00674">LIBMTP_playlist_struct::tracks</a>.</p>

</div>
</div>
<a class="anchor" id="ga463909ddaa9e0e26055aa21f4d895598"></a><!-- doxytag: member="libmtp.h::LIBMTP_Get_Playlist" ref="ga463909ddaa9e0e26055aa21f4d895598" args="(LIBMTP_mtpdevice_t *, uint32_t const)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structLIBMTP__playlist__struct.html">LIBMTP_playlist_t</a>* LIBMTP_Get_Playlist </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t const &nbsp;</td>
          <td class="paramname"> <em>plid</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 retrieves an individual playlist from the device. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device to get the playlist from. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>plid</em>&nbsp;</td><td>the unique ID of the playlist to retrieve. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a valid playlist metadata post or NULL on failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__playlists.html#ga0d4fc219b6680185584ec1a3e63c9e24">LIBMTP_Get_Playlist_List()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8c_source.html#l06757">LIBMTP_new_playlist_t()</a>, <a class="el" href="libmtp_8h_source.html#l00580">LIBMTP_mtpdevice_struct::params</a>, and <a class="el" href="libmtp_8h_source.html#l00585">LIBMTP_mtpdevice_struct::usbinfo</a>.</p>

</div>
</div>
<a class="anchor" id="ga0d4fc219b6680185584ec1a3e63c9e24"></a><!-- doxytag: member="libmtp.h::LIBMTP_Get_Playlist_List" ref="ga0d4fc219b6680185584ec1a3e63c9e24" args="(LIBMTP_mtpdevice_t *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structLIBMTP__playlist__struct.html">LIBMTP_playlist_t</a>* LIBMTP_Get_Playlist_List </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function returns a list of the playlists available on the device. Typical usage:</p>
<pre>
 </pre><dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device to get the playlist listing from. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a playlist list on success, else NULL. If there are no playlists on the device, NULL will be returned as well. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__playlists.html#ga463909ddaa9e0e26055aa21f4d895598">LIBMTP_Get_Playlist()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8c_source.html#l06757">LIBMTP_new_playlist_t()</a>, <a class="el" href="libmtp_8h_source.html#l00673">LIBMTP_playlist_struct::name</a>, <a class="el" href="libmtp_8h_source.html#l00676">LIBMTP_playlist_struct::next</a>, <a class="el" href="libmtp_8h_source.html#l00675">LIBMTP_playlist_struct::no_tracks</a>, <a class="el" href="libmtp_8h_source.html#l00580">LIBMTP_mtpdevice_struct::params</a>, <a class="el" href="libmtp_8h_source.html#l00671">LIBMTP_playlist_struct::parent_id</a>, <a class="el" href="libmtp_8h_source.html#l00670">LIBMTP_playlist_struct::playlist_id</a>, <a class="el" href="libmtp_8h_source.html#l00672">LIBMTP_playlist_struct::storage_id</a>, <a class="el" href="libmtp_8h_source.html#l00674">LIBMTP_playlist_struct::tracks</a>, and <a class="el" href="libmtp_8h_source.html#l00585">LIBMTP_mtpdevice_struct::usbinfo</a>.</p>

</div>
</div>
<a class="anchor" id="ga2053102a0b5f3a8a56fc8aec4d76c064"></a><!-- doxytag: member="libmtp.h::LIBMTP_new_playlist_t" ref="ga2053102a0b5f3a8a56fc8aec4d76c064" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structLIBMTP__playlist__struct.html">LIBMTP_playlist_t</a>* LIBMTP_new_playlist_t </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This creates a new playlist metadata structure and allocates memory for it. Notice that if you add strings to this structure they will be freed by the corresponding <code>LIBMTP_destroy_playlist_t</code> operation later, so be careful of using strdup() when assigning strings, e.g.:</p>
<pre>
 LIBMTP_playlist_t *pl = <a class="el" href="group__playlists.html#ga2053102a0b5f3a8a56fc8aec4d76c064">LIBMTP_new_playlist_t()</a>;
 pl-&gt;name = strdup(str);
 ....
 LIBMTP_destroy_playlist_t(pl);
 </pre><dl class="return"><dt><b>Returns:</b></dt><dd>a pointer to the newly allocated metadata structure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__playlists.html#ga8d6ce37c43c3cbbac49de849d8aafe77">LIBMTP_destroy_playlist_t()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00670">LIBMTP_playlist_struct::playlist_id</a>.</p>

<p>Referenced by <a class="el" href="libmtp_8c_source.html#l06883">LIBMTP_Get_Playlist()</a>, and <a class="el" href="libmtp_8c_source.html#l06805">LIBMTP_Get_Playlist_List()</a>.</p>

</div>
</div>
<a class="anchor" id="ga312a94c994a3b7bcce08a239fbe09938"></a><!-- doxytag: member="libmtp.h::LIBMTP_Set_Playlist_Name" ref="ga312a94c994a3b7bcce08a239fbe09938" args="(LIBMTP_mtpdevice_t *, LIBMTP_playlist_t *, const char *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int LIBMTP_Set_Playlist_Name </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structLIBMTP__playlist__struct.html">LIBMTP_playlist_t</a> *&nbsp;</td>
          <td class="paramname"> <em>playlist</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>newname</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 renames a single playlist object file holder. This simply means that the <code>PTP_OPC_ObjectFileName</code> property is updated, if this is supported by the device. The playlist filename should nominally end with an extension like ".pla".</p>
<p>NOTE: if you want to change the metadata the device display about a playlist you must <em>not</em> use this function, use <code><a class="el" href="group__playlists.html#ga03f4cc9c57a6d651add7528d5477a758">LIBMTP_Update_Playlist()</a></code> instead!</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device that contains the file. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>playlist</em>&nbsp;</td><td>the playlist metadata of the playlist to rename. On success, the name member is updated. Be aware, that this name can be different than newname depending of device restrictions. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>newname</em>&nbsp;</td><td>the new name for this object. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, any other value means failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__playlists.html#ga03f4cc9c57a6d651add7528d5477a758">LIBMTP_Update_Playlist()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00673">LIBMTP_playlist_struct::name</a>, and <a class="el" href="libmtp_8h_source.html#l00670">LIBMTP_playlist_struct::playlist_id</a>.</p>

</div>
</div>
<a class="anchor" id="ga03f4cc9c57a6d651add7528d5477a758"></a><!-- doxytag: member="libmtp.h::LIBMTP_Update_Playlist" ref="ga03f4cc9c57a6d651add7528d5477a758" args="(LIBMTP_mtpdevice_t *, LIBMTP_playlist_t *const)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int LIBMTP_Update_Playlist </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structLIBMTP__mtpdevice__struct.html">LIBMTP_mtpdevice_t</a> *&nbsp;</td>
          <td class="paramname"> <em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structLIBMTP__playlist__struct.html">LIBMTP_playlist_t</a> *const &nbsp;</td>
          <td class="paramname"> <em>metadata</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 routine updates a playlist based on the metadata supplied. If the <code>tracks</code> field of the metadata contains a track listing, these tracks will be added to the playlist in place of those already present, i.e. the previous track listing will be deleted. For Samsung devices the playlist id (metadata-&gt;playlist_id) is likely to change. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>a pointer to the device to create the new playlist on. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>metadata</em>&nbsp;</td><td>the metadata for the playlist to be updated. notice that the field <code>playlist_id</code> must contain the apropriate playlist ID. Playlist ID be modified to a new playlist ID by the time the function returns since edit-in-place is not always possible. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, any other value means failure. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__playlists.html#ga7f6918e38993f51b1e32b1d61fcf6dab">LIBMTP_Create_New_Playlist()</a> </dd>
<dd>
<a class="el" href="group__objects.html#gac867594319fa48a0d6077d17aaf66222">LIBMTP_Delete_Object()</a> </dd></dl>

<p>References <a class="el" href="libmtp_8h_source.html#l00673">LIBMTP_playlist_struct::name</a>, <a class="el" href="libmtp_8h_source.html#l00675">LIBMTP_playlist_struct::no_tracks</a>, <a class="el" href="libmtp_8h_source.html#l00670">LIBMTP_playlist_struct::playlist_id</a>, <a class="el" href="libmtp_8h_source.html#l00674">LIBMTP_playlist_struct::tracks</a>, and <a class="el" href="libmtp_8h_source.html#l00585">LIBMTP_mtpdevice_struct::usbinfo</a>.</p>

</div>
</div>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
</body>
</html>