diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/itdb.h | 6 | ||||
-rw-r--r-- | src/itdb_artwork.c | 24 | ||||
-rw-r--r-- | src/itdb_chapterdata.c | 2 | ||||
-rw-r--r-- | src/itdb_thumb.c | 41 | ||||
-rw-r--r-- | src/itdb_thumb.h | 5 | ||||
-rw-r--r-- | src/itdb_track.c | 8 | ||||
-rw-r--r-- | src/ithumb-writer.c | 2 |
7 files changed, 42 insertions, 46 deletions
@@ -1197,9 +1197,9 @@ gpointer itdb_artwork_get_pixbuf (Itdb_Device *device, Itdb_Artwork *artwork, /* itdb_thumb_... */ Itdb_Thumb *itdb_thumb_duplicate (Itdb_Thumb *thumb); -gpointer itdb_thumb_to_pixbuf_at_size (Itdb_Device *dev, Itdb_Thumb *thumb, - gint width, gint height); -GList *itdb_thumb_to_pixbufs (Itdb_Device *dev, Itdb_Thumb *thumb); +gpointer itdb_thumb_to_pixbuf_at_size (Itdb_Device *device, Itdb_Thumb *thumb, + gint width, gint height); +GList *itdb_thumb_to_pixbufs (Itdb_Device *device, Itdb_Thumb *thumb); void itdb_thumb_free (Itdb_Thumb *thumb); /* itdb_chapterdata_... */ diff --git a/src/itdb_artwork.c b/src/itdb_artwork.c index db895d7..00ed62d 100644 --- a/src/itdb_artwork.c +++ b/src/itdb_artwork.c @@ -117,8 +117,7 @@ itdb_artwork_remove_thumbnails (Itdb_Artwork *artwork) /** * itdb_artwork_set_thumbnail - * @artwork: an #Itdb_Thumbnail - * @type: thumbnail size + * @artwork: an #Itdb_Artwork * @filename: image file to use to create the thumbnail * @rotation: angle by which the image should be rotated * counterclockwise. Valid values are 0, 90, 180 and 270. @@ -176,16 +175,15 @@ itdb_artwork_set_thumbnail (Itdb_Artwork *artwork, /** * itdb_artwork_set_thumbnail_from_pixbuf - * @artwork: an #Itdb_Thumbnail + * @artwork: an #Itdb_Artwork * @pixbuf: #GdkPixbuf to use to create the thumbnail * @rotation: angle by which the image should be rotated * counterclockwise. Valid values are 0, 90, 180 and 270. * @error: return location for a #GError or NULL * - * Appends a thumbnail of type @type to existing thumbnails in @artwork. No - * data is generated from @pixbuf yet, it will be done when @artwork is saved - * to disk. @pixbuf is ref'ed by this function, but is not copied, so it should - * not be modified before the database is saved. + * Set a thumbnail in @artwork. No data is generated from @pixbuf yet, it will + * be done when @artwork is saved to disk. @pixbuf is ref'ed by this function, + * but is not copied, so it should not be modified before the database is saved. * * For the rotation angle you can also use the gdk constants * GDK_PIXBUF_ROTATE_NONE, ..._COUNTERCLOCKWISE, ..._UPSIDEDOWN AND @@ -235,7 +233,7 @@ itdb_artwork_set_thumbnail_from_pixbuf (Itdb_Artwork *artwork, /** * itdb_artwork_set_thumbnail_from_data - * @artwork: an #Itdb_Thumbnail + * @artwork: an #Itdb_Artwork * @image_data: data used to create the thumbnail (the raw contents of * an image file) * @image_data_len: length of above data block @@ -243,9 +241,8 @@ itdb_artwork_set_thumbnail_from_pixbuf (Itdb_Artwork *artwork, * counterclockwise. Valid values are 0, 90, 180 and 270. * @error: return location for a #GError or NULL * - * Appends a thumbnail of type @type to existing thumbnails in - * @artwork. No data is processed yet. This will be done when @artwork - * is saved to disk. + * Set a thumbnail in @artwork. No data is processed yet. This will be done when + * @artwork is saved to disk. * * For the rotation angle you can also use the gdk constants * GDK_PIXBUF_ROTATE_NONE, ..._COUNTERCLOCKWISE, ..._UPSIDEDOWN AND @@ -881,12 +878,11 @@ gpointer itdb_thumb_ipod_item_to_pixbuf (Itdb_Device *device, #endif /** - * itdb_artwork_get_thumbnail! + * itdb_artwork_get_pixbuf: * @artwork: an #Itdb_Artwork - * + * @device: an #Itdb_Device * @width: width of the pixbuf to retrieve, -1 for the biggest * possible size and 0 for the smallest possible size (with no scaling) - * * @height: height of the pixbuf to retrieve, -1 for the biggest possible size * and 0 for the smallest possible size (with no scaling) * diff --git a/src/itdb_chapterdata.c b/src/itdb_chapterdata.c index 131f66e..f49c419 100644 --- a/src/itdb_chapterdata.c +++ b/src/itdb_chapterdata.c @@ -116,7 +116,7 @@ Itdb_Chapterdata *itdb_chapterdata_duplicate (Itdb_Chapterdata *chapterdata) /** * itdb_chapterdata_remove_chapter: * @chapterdata: an #Itdb_Chapterdata - * @chapeer: an #Itdb_Chapter + * @chapter: an #Itdb_Chapter * * Removes @chapter from @chapterdata. The memory used by @chapter is freed. **/ diff --git a/src/itdb_thumb.c b/src/itdb_thumb.c index 201dfb1..3a5dba5 100644 --- a/src/itdb_thumb.c +++ b/src/itdb_thumb.c @@ -298,9 +298,9 @@ Itdb_Thumb_Ipod_Item *itdb_thumb_ipod_get_item_by_type (Itdb_Thumb *thumbs, } /** - * itdb_thumb_get_filename: + * itdb_thumb_ipod_get_filename: * @device: an #Itdb_Device - * @thumb: an #Itdb_Thumb + * @thumb: an #Itdb_Thumb_Ipod_Item * * Get filename of thumbnail. If it's a thumbnail on the iPod, return * the full path to the ithmb file. Otherwise return the full path to @@ -357,18 +357,16 @@ const GList *itdb_thumb_ipod_get_thumbs (Itdb_Thumb_Ipod *thumbs) * itdb_thumb_to_pixbuf_at_size: * @device: an #Itdb_Device * @thumb: an #Itdb_Thumb - * + * @width: width of the pixbuf to retrieve, -1 for the biggest + * possible size and 0 for the smallest possible size (with no scaling) + * @height: height of the pixbuf to retrieve, -1 for the biggest possible size + * and 0 for the smallest possible size (with no scaling) + * * Converts @thumb to a #GdkPixbuf. * Since we want to have gdk-pixbuf dependency optional, a generic * gpointer is returned which you have to cast to a #GdkPixbuf using * GDK_PIXBUF() yourself. * - * @width: width of the pixbuf to retrieve, -1 for the biggest - * possible size and 0 for the smallest possible size (with no scaling) - * - * @height: height of the pixbuf to retrieve, -1 for the biggest possible size - * and 0 for the smallest possible size (with no scaling) - * * Return value: a #GdkPixbuf that must be unreffed with gdk_pixbuf_unref() * after use, or NULL if the creation of the gdk-pixbuf failed or if * libgpod was compiled without gdk-pixbuf support. @@ -504,7 +502,8 @@ gpointer itdb_thumb_to_pixbuf_at_size (Itdb_Device *device, Itdb_Thumb *thumb, return pixbuf; } -static GList *itdb_thumb_ipod_to_pixbufs (Itdb_Device *dev, Itdb_Thumb_Ipod *thumb) +static GList *itdb_thumb_ipod_to_pixbufs (Itdb_Device *device, + Itdb_Thumb_Ipod *thumb) { const GList *items; GList *pixbufs = NULL; @@ -516,7 +515,7 @@ static GList *itdb_thumb_ipod_to_pixbufs (Itdb_Device *dev, Itdb_Thumb_Ipod *thu items != NULL; items = items->next) { GdkPixbuf *pixbuf; - pixbuf = itdb_thumb_ipod_item_to_pixbuf (dev, items->data); + pixbuf = itdb_thumb_ipod_item_to_pixbuf (device, items->data); if (pixbuf != NULL) { pixbufs = g_list_prepend (pixbufs, pixbuf); } @@ -529,11 +528,6 @@ static GList *itdb_thumb_ipod_to_pixbufs (Itdb_Device *dev, Itdb_Thumb_Ipod *thu * itdb_thumb_to_pixbufs: * @device: an #Itdb_Device * @thumb: an #Itdb_Thumb - * - * Return value: a #GList of #GdkPixbuf which are associated with @thumb, NULL - * if the pixbuf was invalid or if libgpod is compiled without gdk-pixbuf - * support. The #GdkPixbuf must be unreffed with gdk_pixbuf_unref() after use - * and the #GList must be freed with g_list_free(). * * Converts @thumb to a #GList of #GdkPixbuf. The returned #GList will * generally contain only 1 element, the full-size pixbuf associated with @@ -541,20 +535,25 @@ static GList *itdb_thumb_ipod_to_pixbufs (Itdb_Device *dev, Itdb_Thumb_Ipod *thu * modified from the library, then the returned #GList will contain several * #GdkPixbuf corresponding to the various thumbnail sizes that were * written to the iPod database. + * + * Return value: a #GList of #GdkPixbuf which are associated with @thumb, NULL + * if the pixbuf was invalid or if libgpod is compiled without gdk-pixbuf + * support. The #GdkPixbuf must be unreffed with gdk_pixbuf_unref() after use + * and the #GList must be freed with g_list_free(). **/ -GList *itdb_thumb_to_pixbufs (Itdb_Device *dev, Itdb_Thumb *thumb) +GList *itdb_thumb_to_pixbufs (Itdb_Device *device, Itdb_Thumb *thumb) { GList *pixbufs = NULL; GdkPixbuf *pixbuf; switch (thumb->data_type) { case ITDB_THUMB_TYPE_IPOD: - pixbufs = itdb_thumb_ipod_to_pixbufs (dev, (Itdb_Thumb_Ipod *)thumb); + pixbufs = itdb_thumb_ipod_to_pixbufs (device, (Itdb_Thumb_Ipod *)thumb); break; case ITDB_THUMB_TYPE_FILE: case ITDB_THUMB_TYPE_MEMORY: case ITDB_THUMB_TYPE_PIXBUF: - pixbuf = itdb_thumb_to_pixbuf_at_size (dev, thumb, -1, -1); + pixbuf = itdb_thumb_to_pixbuf_at_size (device, thumb, -1, -1); pixbufs = g_list_append (pixbufs, pixbuf); break; case ITDB_THUMB_TYPE_INVALID: @@ -564,14 +563,14 @@ GList *itdb_thumb_to_pixbufs (Itdb_Device *dev, Itdb_Thumb *thumb) return pixbufs; } #else -gpointer itdb_thumb_to_pixbuf_at_size (Itdb_Device *dev, Itdb_Thumb *thumb, +gpointer itdb_thumb_to_pixbuf_at_size (Itdb_Device *device, Itdb_Thumb *thumb, gint width, gint height) { return NULL; } -GList *itdb_thumb_to_pixbufs (Itdb_Device *dev, Itdb_Thumb *thumb) +GList *itdb_thumb_to_pixbufs (Itdb_Device *device, Itdb_Thumb *thumb) { return NULL; } diff --git a/src/itdb_thumb.h b/src/itdb_thumb.h index 7c2806c..09dd04e 100644 --- a/src/itdb_thumb.h +++ b/src/itdb_thumb.h @@ -27,14 +27,13 @@ #include "itdb_device.h" /* Types of thumbnails in Itdb_Image */ -enum _ItdbThumbDataType { +typedef enum { ITDB_THUMB_TYPE_INVALID, ITDB_THUMB_TYPE_FILE, ITDB_THUMB_TYPE_MEMORY, ITDB_THUMB_TYPE_PIXBUF, ITDB_THUMB_TYPE_IPOD -}; -typedef enum _ItdbThumbDataType ItdbThumbDataType; +} ItdbThumbDataType; /* The Itdb_Thumb structure can represent two slightly different thumbnails: diff --git a/src/itdb_track.c b/src/itdb_track.c index dbe427e..480c0bb 100644 --- a/src/itdb_track.c +++ b/src/itdb_track.c @@ -618,6 +618,8 @@ Itdb_Track *itdb_track_id_tree_by_id (GTree *idtree, guint32 id) * itdb_track_has_thumbnails: * @track: an #Itdb_Track * + * Determine if a @track has thumbnails + * * Return value: TRUE if @track has artwork available, FALSE otherwise **/ gboolean itdb_track_has_thumbnails (Itdb_Track *track) @@ -634,9 +636,9 @@ gboolean itdb_track_has_thumbnails (Itdb_Track *track) * @height: height of the pixbuf to retrieve, -1 for the biggest possible size * (with no scaling) * - * Returns a #GdkPixbuf representing the cover associated with the current - * track, scaling it if appropriate. If either height or width is -1, then the - * biggest unscaled thumbnail available will be returned + * Get a thumbnail representing the cover associated with the current track, + * scaling it if appropriate. If either height or width is -1, then the biggest + * unscaled thumbnail available will be returned. * * Return value: a #GdkPixbuf that must be unreffed when no longer used, NULL * if no artwork could be found or if libgpod is compiled without GdkPixbuf diff --git a/src/ithumb-writer.c b/src/ithumb-writer.c index f9c0ffb..f0621bf 100644 --- a/src/ithumb-writer.c +++ b/src/ithumb-writer.c @@ -1360,7 +1360,7 @@ static gboolean ithumb_rearrange_thumbnail_file (gpointer _key, If a thumbnail has been removed, a slot in the file is opened. This slot is filled by copying data from the end of the file and - adjusting the corresponding Itdb_Image offset pointer. When all + adjusting the corresponding Itdb_Thumb offset pointer. When all slots are filled, the file is truncated to the new length. */ static gboolean |