<!-- ##### SECTION Title ##### -->
Photo database
<!-- ##### SECTION Short_Description ##### -->
Functions to create, read, write the photo database
<!-- ##### SECTION Long_Description ##### -->
<para>
These functions are for creating, reading, and writing the photo
database.
</para>
<para>
Overview of using the Photo database:
</para>
<para>
itdb_photodb_parse():
Read an existing PhotoDB.
</para>
<para>
itdb_photodb_create():
Create a new #Itdb_PhotoDB structure. The Photo Library Album is
(first album) is created automatically.
</para>
<para>
itdb_photodb_add_photo(), itdb_photodb_add_photo_from_data():
Add a photo to the PhotoDB (from file or from a chunk of
memory). It is automatically added to the Photo Library Album
(first album), which is created if it does not exist already.
</para>
<para>
itdb_photodb_photoalbum_create():
Create and add a new photoalbum.
</para>
<para>
itdb_photodb_photoalbum_add_photo():
Add a photo (#Itdb_Artwork) to an existing photoalbum.
</para>
<para>
itdb_photodb_photoalbum_remove():
Remove an existing photoalbum. Pictures can be kept in the
Photo Library or automatically removed as well.
</para>
<para>
itdb_photodb_remove_photo():
Remove a photo either from a photoalbum or completely from the database.
</para>
<para>
itdb_photodb_write():
Write out your PhotoDB.
</para>
<para>
itdb_photodb_free():
Free all memory taken by the PhotoDB.
</para>
<para>
itdb_photodb_photoalbum_by_name():
Find the first photoalbum with a given name or the Photo
Library Album if called with no name.
</para>
<para>
If you cannot add photos because your iPod is not recognized,
you may have to set the iPod model by calling
itdb_device_set_sysinfo(), e.g. for an 80 GB 6th generation
iPod Video, you would use:
</para>
<programlisting>
itdb_device_set_sysinfo (db->device, "ModelNumStr", "MA450");
</programlisting>
<para>
See <ulink type="http"
url="http://gtkpod.git.sourceforge.net/git/gitweb.cgi?p=gtkpod/libgpod;a=blob_plain;f=src/itdb_device.c;hb=HEAD">itdb_device.c</ulink>
for a list of supported models.
</para>
<para>
The model number will be saved on the iPod when the PhotoDB is
written (itdb_photodb_write() calls itdb_device_write_sysinfo()).
</para>
<para>
Have a look at the <ulink type="http"
url="http://gtkpod.git.sourceforge.net/git/gitweb.cgi?p=gtkpod/libgpod;a=blob_plain;f=tests/test-photos.c;hb=HEAD">test-photos</ulink>
test program in the <ulink type="http"
url="http://gtkpod.git.sourceforge.net/git/gitweb.cgi?p=gtkpod/libgpod;a=tree;f=tests;hb=HEAD">tests/</ulink>
directory of the libgpod source for an example of how to use the interface.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### SECTION Image ##### -->
<!-- ##### STRUCT Itdb_PhotoDB ##### -->
<para>
</para>
@photos:
@photoalbums:
@device:
@reserved_int1:
@reserved_int2:
@reserved1:
@reserved2:
@usertype:
@userdata:
@userdata_duplicate:
@userdata_destroy:
<!-- ##### FUNCTION itdb_photodb_create ##### -->
<para>
</para>
@mountpoint:
@Returns:
<!-- ##### FUNCTION itdb_photodb_free ##### -->
<para>
</para>
@photodb:
<!-- ##### FUNCTION itdb_photodb_parse ##### -->
<para>
</para>
@mp:
@error:
@Returns:
<!-- ##### FUNCTION itdb_photodb_write ##### -->
<para>
</para>
@photodb:
@error:
@Returns:
<!-- ##### FUNCTION itdb_photodb_add_photo ##### -->
<para>
</para>
@db:
@filename:
@position:
@rotation:
@error:
@Returns:
<!-- ##### FUNCTION itdb_photodb_add_photo_from_data ##### -->
<para>
</para>
@db:
@image_data:
@image_data_len:
@position:
@rotation:
@error:
@Returns:
<!-- ##### FUNCTION itdb_photodb_add_photo_from_pixbuf ##### -->
<para>
</para>
@db:
@pixbuf:
@position:
@rotation:
@error:
@Returns:
<!-- ##### FUNCTION itdb_photodb_remove_photo ##### -->
<para>
</para>
@db:
@album:
@photo:
<!-- ##### STRUCT Itdb_PhotoAlbum ##### -->
<para>
</para>
@photodb:
@name:
@members:
@album_type:
@playmusic:
@repeat:
@random:
@show_titles:
@transition_direction:
@slide_duration:
@transition_duration:
@song_id:
@unk024:
@unk028:
@unk044:
@unk048:
@album_id:
@prev_album_id:
@reserved_int1:
@reserved_int2:
@reserved1:
@reserved2:
@usertype:
@userdata:
@userdata_duplicate:
@userdata_destroy:
<!-- ##### FUNCTION itdb_photodb_photoalbum_free ##### -->
<para>
</para>
@album:
<!-- ##### FUNCTION itdb_photodb_photoalbum_new ##### -->
<para>
</para>
@albumname:
@Returns:
<!-- ##### FUNCTION itdb_photodb_photoalbum_add ##### -->
<para>
</para>
@db:
@album:
@pos:
<!-- ##### FUNCTION itdb_photodb_photoalbum_unlink ##### -->
<para>
</para>
@album:
<!-- ##### FUNCTION itdb_photodb_photoalbum_create ##### -->
<para>
</para>
@db:
@albumname:
@pos:
@Returns:
<!-- ##### FUNCTION itdb_photodb_photoalbum_add_photo ##### -->
<para>
</para>
@db:
@album:
@photo:
@position:
<!-- ##### FUNCTION itdb_photodb_photoalbum_by_name ##### -->
<para>
</para>
@db:
@albumname:
@Returns:
<!-- ##### FUNCTION itdb_photodb_photoalbum_remove ##### -->
<para>
</para>
@db:
@album:
@remove_pics: