Sophie

Sophie

distrib > PLD > th > x86_64 > by-pkgid > 74a7034237d9706b06f885a02e3ee519 > files > 16

libgpod-apidocs-0.8.3-11.noarch.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>The Itdb_iTunesDB structure: libgpod Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="libgpod Reference Manual">
<link rel="up" href="itunesdb.html" title="Part I. iPod database">
<link rel="prev" href="itunesdb.html" title="Part I. iPod database">
<link rel="next" href="libgpod-File-handling-functions.html" title="File handling functions">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#libgpod-The-Itdb-iTunesDB-structure.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="itunesdb.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="itunesdb.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="libgpod-File-handling-functions.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libgpod-The-Itdb-iTunesDB-structure"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libgpod-The-Itdb-iTunesDB-structure.top_of_page"></a>The Itdb_iTunesDB structure</span></h2>
<p>The Itdb_iTunesDB structure</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libgpod-The-Itdb-iTunesDB-structure.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="returnvalue">Itdb_iTunesDB</span></a> *
</td>
<td class="function_name">
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-new" title="itdb_new ()">itdb_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-free" title="itdb_free ()">itdb_free</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="returnvalue">Itdb_iTunesDB</span></a> *
</td>
<td class="function_name">
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-parse" title="itdb_parse ()">itdb_parse</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-write" title="itdb_write ()">itdb_write</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-set-mountpoint" title="itdb_set_mountpoint ()">itdb_set_mountpoint</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-get-mountpoint" title="itdb_get_mountpoint ()">itdb_get_mountpoint</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-init-ipod" title="itdb_init_ipod ()">itdb_init_ipod</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">guint32</span>
</td>
<td class="function_name">
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-tracks-number" title="itdb_tracks_number ()">itdb_tracks_number</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">guint32</span>
</td>
<td class="function_name">
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-tracks-number-nontransferred" title="itdb_tracks_number_nontransferred ()">itdb_tracks_number_nontransferred</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">guint32</span>
</td>
<td class="function_name">
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-playlists-number" title="itdb_playlists_number ()">itdb_playlists_number</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDestroyFunc" title="ItdbUserDataDestroyFunc ()">*ItdbUserDataDestroyFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gpointer</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDuplicateFunc" title="ItdbUserDataDuplicateFunc ()">*ItdbUserDataDuplicateFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libgpod-The-Itdb-iTunesDB-structure.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB">Itdb_iTunesDB</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB-Private" title="Itdb_iTunesDB_Private">Itdb_iTunesDB_Private</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#ItdbFileError" title="enum ItdbFileError">ItdbFileError</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libgpod-The-Itdb-iTunesDB-structure.description"></a><h2>Description</h2>
</div>
<div class="refsect1">
<a name="libgpod-The-Itdb-iTunesDB-structure.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="itdb-new"></a><h3>itdb_new ()</h3>
<pre class="programlisting"><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="returnvalue">Itdb_iTunesDB</span></a> *
itdb_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Creates a new Itdb_iTunesDB with the unknowns filled in to reasonable
values.</p>
<div class="refsect3">
<a name="itdb-new.returns"></a><h4>Returns</h4>
<p> a newly created Itdb_iTunesDB to be freed with <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-free" title="itdb_free ()"><code class="function">itdb_free()</code></a>
when it's no longer needed</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="itdb-free"></a><h3>itdb_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
itdb_free (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>);</pre>
<p>Free the memory taken by <em class="parameter"><code>itdb</code></em>
.</p>
<div class="refsect3">
<a name="itdb-free.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>itdb</p></td>
<td class="parameter_description"><p>an <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="itdb-parse"></a><h3>itdb_parse ()</h3>
<pre class="programlisting"><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="returnvalue">Itdb_iTunesDB</span></a> *
itdb_parse (<em class="parameter"><code>const <span class="type">gchar</span> *mp</code></em>,
            <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Parse the Itdb_iTunesDB of the iPod located at <em class="parameter"><code>mp</code></em>
</p>
<div class="refsect3">
<a name="itdb-parse.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mp</p></td>
<td class="parameter_description"><p>mount point of the iPod (eg "/mnt/ipod") in local encoding</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>return location for a <span class="type">GError</span> or NULL</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="itdb-parse.returns"></a><h4>Returns</h4>
<p> a newly allocated <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> struct holding the tracks and
the playlists present on the iPod at <em class="parameter"><code>mp</code></em>
, NULL if <em class="parameter"><code>mp</code></em>
isn't an iPod mount
point. If non-NULL, the <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> is to be freed with <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-free" title="itdb_free ()"><code class="function">itdb_free()</code></a> when
it's no longer needed</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="itdb-write"></a><h3>itdb_write ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
itdb_write (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>,
            <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Write out an iTunesDB. It reassigns unique IDs to all tracks. 
An existing "Play Counts" file is renamed to "Play Counts.bak" if
the export was successful.
An existing "OTGPlaylistInfo" file is removed if the export was
successful.</p>
<div class="refsect3">
<a name="itdb-write.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>itdb</p></td>
<td class="parameter_description"><p>the <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> to write to disk</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>return location for a <span class="type">GError</span> or NULL</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="itdb-write.returns"></a><h4>Returns</h4>
<p> TRUE on success, FALSE on error, in which case <em class="parameter"><code>error</code></em>
is
set accordingly.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="itdb-set-mountpoint"></a><h3>itdb_set_mountpoint ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
itdb_set_mountpoint (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>,
                     <em class="parameter"><code>const <span class="type">gchar</span> *mp</code></em>);</pre>
<p>Sets the mountpoint of <em class="parameter"><code>itdb</code></em>
. Always use this function to set the
mountpoint of an <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> as it will reset the number of
available /iPod_Control/Music/F.. dirs. It doesn't attempt to parse
an iPod database that may be present on the iPod at <em class="parameter"><code>mp</code></em>
.</p>
<div class="note"><p>Calling this function removes the artwork in the
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> database using this <a class="link" href="libgpod-Device.html#Itdb-Device" title="Itdb_Device"><span class="type">Itdb_Device</span></a> which was read from the
iPod.</p></div>.
<div class="refsect3">
<a name="itdb-set-mountpoint.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>itdb</p></td>
<td class="parameter_description"><p>an <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mp</p></td>
<td class="parameter_description"><p>new mount point</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 0.1.3</p>
</div>
<hr>
<div class="refsect2">
<a name="itdb-get-mountpoint"></a><h3>itdb_get_mountpoint ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> *
itdb_get_mountpoint (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>);</pre>
<p>Retrieve a reference to the mountpoint of <em class="parameter"><code>itdb</code></em>
</p>
<div class="refsect3">
<a name="itdb-get-mountpoint.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>itdb</p></td>
<td class="parameter_description"><p>an <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="itdb-get-mountpoint.returns"></a><h4>Returns</h4>
<p> the <em class="parameter"><code>itdb</code></em>
mountpoint, this string shouldn't be freed
nor modified</p>
</div>
<p class="since">Since: 0.4.0</p>
</div>
<hr>
<div class="refsect2">
<a name="itdb-init-ipod"></a><h3>itdb_init_ipod ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
itdb_init_ipod (<em class="parameter"><code>const <span class="type">gchar</span> *mountpoint</code></em>,
                <em class="parameter"><code>const <span class="type">gchar</span> *model_number</code></em>,
                <em class="parameter"><code>const <span class="type">gchar</span> *ipod_name</code></em>,
                <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Initialise an iPod device from scratch. The function attempts to
create a blank database, complete with master playlist and device
information as well as the directory structure required for the
type of iPod.
<em class="parameter"><code>model_number</code></em>
 is used to tell libgpod about the exact iPod
model, which is needed for proper artwork writing. <em class="parameter"><code>model_number</code></em>
 can be
found from the table returned by itdb_device_get_ipod_info_table (for
example). On recent distros with iPods released
in the last few years (starting with the iPod Color), it should be fine
to pass in a NULL <em class="parameter"><code>model_number</code></em>
 while still getting artwork writing.</p>
<div class="refsect3">
<a name="itdb-init-ipod.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mountpoint</p></td>
<td class="parameter_description"><p>the iPod mountpoint</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>model_number</p></td>
<td class="parameter_description"><p>the iPod model number, can be NULL</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>ipod_name</p></td>
<td class="parameter_description"><p>the name to give to the iPod. Will be displayed in
gtkpod or itunes</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>return location for a <span class="type">GError</span> or NULL</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="itdb-init-ipod.returns"></a><h4>Returns</h4>
<p> TRUE when successful, FALSE if a failure has occurred.</p>
</div>
<p class="since">Since: 0.4.0</p>
</div>
<hr>
<div class="refsect2">
<a name="itdb-tracks-number"></a><h3>itdb_tracks_number ()</h3>
<pre class="programlisting"><span class="returnvalue">guint32</span>
itdb_tracks_number (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>);</pre>
<p>Counts the number of tracks stored in <em class="parameter"><code>itdb</code></em>
</p>
<div class="refsect3">
<a name="itdb-tracks-number.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>itdb</p></td>
<td class="parameter_description"><p>an <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="itdb-tracks-number.returns"></a><h4>Returns</h4>
<p> the number of tracks in <em class="parameter"><code>itdb</code></em>
</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="itdb-tracks-number-nontransferred"></a><h3>itdb_tracks_number_nontransferred ()</h3>
<pre class="programlisting"><span class="returnvalue">guint32</span>
itdb_tracks_number_nontransferred (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>);</pre>
<p>Counts the number of non-transferred tracks in <em class="parameter"><code>itdb</code></em>
</p>
<div class="refsect3">
<a name="itdb-tracks-number-nontransferred.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>itdb</p></td>
<td class="parameter_description"><p>an <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="itdb-tracks-number-nontransferred.returns"></a><h4>Returns</h4>
<p> the number of tracks in <em class="parameter"><code>itdb</code></em>
that haven't been transferred
to the iPod yet (ie the number of <a class="link" href="libgpod-Tracks.html#Itdb-Track" title="struct Itdb_Track"><span class="type">Itdb_Track</span></a> in which the transferred field
is false)</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="itdb-playlists-number"></a><h3>itdb_playlists_number ()</h3>
<pre class="programlisting"><span class="returnvalue">guint32</span>
itdb_playlists_number (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>);</pre>
<p>Counts the number of playlists stored in <em class="parameter"><code>itdb</code></em>
</p>
<div class="refsect3">
<a name="itdb-playlists-number.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>itdb</p></td>
<td class="parameter_description"><p>an <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="itdb-playlists-number.returns"></a><h4>Returns</h4>
<p> the number of playlists in <em class="parameter"><code>itdb</code></em>
(including the master
playlist)</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="ItdbUserDataDestroyFunc"></a><h3>ItdbUserDataDestroyFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*ItdbUserDataDestroyFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><span class="type">gpointer</span> userdata</code></em>);</pre>
<p>Function called to free userdata</p>
<div class="refsect3">
<a name="ItdbUserDataDestroyFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>userdata</p></td>
<td class="parameter_description"><p>A <span class="type">gpointer</span> to user data</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="ItdbUserDataDuplicateFunc"></a><h3>ItdbUserDataDuplicateFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">gpointer</span>
<span class="c_punctuation">(</span>*ItdbUserDataDuplicateFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><span class="type">gpointer</span> userdata</code></em>);</pre>
<p>Function called to duplicate userdata</p>
<div class="refsect3">
<a name="ItdbUserDataDuplicateFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>userdata</p></td>
<td class="parameter_description"><p>A <span class="type">gpointer</span> to user data</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="ItdbUserDataDuplicateFunc.returns"></a><h4>Returns</h4>
<p> A <span class="type">gpointer</span></p>
</div>
</div>
</div>
<div class="refsect1">
<a name="libgpod-The-Itdb-iTunesDB-structure.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="Itdb-iTunesDB"></a><h3>struct Itdb_iTunesDB</h3>
<pre class="programlisting">struct Itdb_iTunesDB {
    GList *tracks;
    GList *playlists;
    gchar *filename;
    Itdb_Device *device;
    guint32 version;
    guint64 id;
    gint32 tzoffset;
    /* reserved for future use */
    gint32 reserved_int2;
    Itdb_iTunesDB_Private *priv;
    gpointer reserved2;
    /* below is for use by application */
    guint64 usertype;
    gpointer userdata;
    /* functions called to duplicate/free userdata */
    ItdbUserDataDuplicateFunc userdata_duplicate;
    ItdbUserDataDestroyFunc userdata_destroy;
};
</pre>
<p>Structure representing an iTunes database</p>
<div class="refsect3">
<a name="Itdb-iTunesDB.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><span class="type">GList</span> *<em class="structfield"><code><a name="Itdb-iTunesDB.tracks"></a>tracks</code></em>;</p></td>
<td class="struct_member_description"><p>A list of tracks in the database (<a class="link" href="libgpod-Tracks.html#Itdb-Track" title="struct Itdb_Track"><span class="type">Itdb_Track</span></a>)</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">GList</span> *<em class="structfield"><code><a name="Itdb-iTunesDB.playlists"></a>playlists</code></em>;</p></td>
<td class="struct_member_description"><p>A list of playlists in the database (<a class="link" href="libgpod-Playlists.html#Itdb-Playlist" title="struct Itdb_Playlist"><span class="type">Itdb_Playlist</span></a>)</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">gchar</span> *<em class="structfield"><code><a name="Itdb-iTunesDB.filename"></a>filename</code></em>;</p></td>
<td class="struct_member_description"><p>The filename of the iTunesDB</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="libgpod-Device.html#Itdb-Device" title="Itdb_Device"><span class="type">Itdb_Device</span></a> *<em class="structfield"><code><a name="Itdb-iTunesDB.device"></a>device</code></em>;</p></td>
<td class="struct_member_description"><p>iPod device info (<a class="link" href="libgpod-Device.html#Itdb-Device" title="Itdb_Device"><span class="type">Itdb_Device</span></a>)</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">guint32</span> <em class="structfield"><code><a name="Itdb-iTunesDB.version"></a>version</code></em>;</p></td>
<td class="struct_member_description"><p>The version number of the iTunesDB</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">guint64</span> <em class="structfield"><code><a name="Itdb-iTunesDB.id"></a>id</code></em>;</p></td>
<td class="struct_member_description"><p>A 64 bit id value for the iTunesDB</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">gint32</span> <em class="structfield"><code><a name="Itdb-iTunesDB.tzoffset"></a>tzoffset</code></em>;</p></td>
<td class="struct_member_description"><p>offset in seconds from UTC</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">gint32</span> <em class="structfield"><code><a name="Itdb-iTunesDB.reserved-int2"></a>reserved_int2</code></em>;</p></td>
<td class="struct_member_description"><p>Reserved for future use</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB-Private" title="Itdb_iTunesDB_Private"><span class="type">Itdb_iTunesDB_Private</span></a> *<em class="structfield"><code><a name="Itdb-iTunesDB.priv"></a>priv</code></em>;</p></td>
<td class="struct_member_description"><p>Private data</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">gpointer</span> <em class="structfield"><code><a name="Itdb-iTunesDB.reserved2"></a>reserved2</code></em>;</p></td>
<td class="struct_member_description"><p>Reserved for future use</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">guint64</span> <em class="structfield"><code><a name="Itdb-iTunesDB.usertype"></a>usertype</code></em>;</p></td>
<td class="struct_member_description"><p>For use by application</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">gpointer</span> <em class="structfield"><code><a name="Itdb-iTunesDB.userdata"></a>userdata</code></em>;</p></td>
<td class="struct_member_description"><p>For use by application</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDuplicateFunc" title="ItdbUserDataDuplicateFunc ()"><span class="type">ItdbUserDataDuplicateFunc</span></a> <em class="structfield"><code><a name="Itdb-iTunesDB.userdata-duplicate"></a>userdata_duplicate</code></em>;</p></td>
<td class="struct_member_description"><p>A function to duplicate <span class="type">userdata</span></p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDestroyFunc" title="ItdbUserDataDestroyFunc ()"><span class="type">ItdbUserDataDestroyFunc</span></a> <em class="structfield"><code><a name="Itdb-iTunesDB.userdata-destroy"></a>userdata_destroy</code></em>;</p></td>
<td class="struct_member_description"><p>A function to free <span class="type">userdata</span></p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="Itdb-iTunesDB-Private"></a><h3>Itdb_iTunesDB_Private</h3>
<pre class="programlisting">typedef struct {
    GList *mhsd5_playlists;
    guint16 platform;
    guint16 unk_0x22;
    guint64 id_0x24;
    guint16 lang;
    guint64 pid;
    gint32 unk_0x50;
    gint32 unk_0x54;
    gint16 audio_language;
    gint16 subtitle_language;
    gint16 unk_0xa4;
    gint16 unk_0xa6;
    gint16 unk_0xa8;
    gchar *genius_cuid;
} Itdb_iTunesDB_Private;
</pre>
</div>
<hr>
<div class="refsect2">
<a name="ItdbFileError"></a><h3>enum ItdbFileError</h3>
<p>Error codes for iTunesDB file</p>
<div class="refsect3">
<a name="ItdbFileError.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="ITDB-FILE-ERROR-SEEK:CAPS"></a>ITDB_FILE_ERROR_SEEK</p></td>
<td class="enum_member_description">
<p>file corrupt: illegal seek occured</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="ITDB-FILE-ERROR-CORRUPT:CAPS"></a>ITDB_FILE_ERROR_CORRUPT</p></td>
<td class="enum_member_description">
<p>file corrupt</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="ITDB-FILE-ERROR-NOTFOUND:CAPS"></a>ITDB_FILE_ERROR_NOTFOUND</p></td>
<td class="enum_member_description">
<p>file not found</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="ITDB-FILE-ERROR-RENAME:CAPS"></a>ITDB_FILE_ERROR_RENAME</p></td>
<td class="enum_member_description">
<p>file could not be renamed</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="ITDB-FILE-ERROR-ITDB-CORRUPT:CAPS"></a>ITDB_FILE_ERROR_ITDB_CORRUPT</p></td>
<td class="enum_member_description">
<p>iTunesDB in memory corrupt</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>