diff options
author | Todd Zullinger <tmz@pobox.com> | 2008-12-08 01:16:31 +0000 |
---|---|---|
committer | Todd Zullinger <tmz@pobox.com> | 2008-12-08 01:16:31 +0000 |
commit | cbae285207ff226bdbe1a3c249a5ffa33a457bc3 (patch) | |
tree | 2e470a65e1e3d95ec95dfbc53ad15f794d5579a3 | |
parent | d96089c62f807989453b2fb87558e0b5fe5b2ea0 (diff) | |
download | libgpod-cbae285207ff226bdbe1a3c249a5ffa33a457bc3.tar.gz libgpod-cbae285207ff226bdbe1a3c249a5ffa33a457bc3.tar.xz libgpod-cbae285207ff226bdbe1a3c249a5ffa33a457bc3.zip |
Whitespace cleanup
This just cleans up some minor whitespace issues to make diffing and
merging slightly nicer.
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@2158 f01d2545-417e-4e96-918e-98f8d0dbbcb6
-rw-r--r-- | docs/reference/libgpod-sections.txt | 3 | ||||
-rw-r--r-- | src/itdb.h | 2 | ||||
-rw-r--r-- | src/itdb_artwork.c | 51 | ||||
-rw-r--r-- | src/itdb_chapterdata.c | 23 | ||||
-rw-r--r-- | src/itdb_device.c | 3 | ||||
-rw-r--r-- | src/itdb_device.h | 8 | ||||
-rw-r--r-- | src/itdb_itunesdb.c | 79 | ||||
-rw-r--r-- | src/itdb_photoalbum.c | 21 | ||||
-rw-r--r-- | src/itdb_playlist.c | 78 | ||||
-rw-r--r-- | src/itdb_plist.c | 34 | ||||
-rw-r--r-- | src/itdb_sysinfo_extended_parser.c | 38 | ||||
-rw-r--r-- | src/itdb_thumb.c | 54 | ||||
-rw-r--r-- | src/itdb_thumb.h | 8 | ||||
-rw-r--r-- | src/itdb_track.c | 47 |
14 files changed, 181 insertions, 268 deletions
diff --git a/docs/reference/libgpod-sections.txt b/docs/reference/libgpod-sections.txt index e415a94..7b7e217 100644 --- a/docs/reference/libgpod-sections.txt +++ b/docs/reference/libgpod-sections.txt @@ -207,9 +207,6 @@ itdb_photodb_remove_photo itdb_photodb_write </SECTION> - - - <SECTION> <FILE>Internal</FILE> <SUBSECTION Private> @@ -1192,7 +1192,7 @@ gboolean itdb_artwork_set_thumbnail_from_pixbuf (Itdb_Artwork *artwork, void itdb_artwork_remove_thumbnails (Itdb_Artwork *artwork); /* the following function returns a pointer to a GdkPixbuf if gdk-pixbuf is installed -- a NULL pointer otherwise. */ -gpointer itdb_artwork_get_pixbuf (Itdb_Device *device, Itdb_Artwork *artwork, +gpointer itdb_artwork_get_pixbuf (Itdb_Device *device, Itdb_Artwork *artwork, gint width, gint height); /* itdb_thumb_... */ diff --git a/src/itdb_artwork.c b/src/itdb_artwork.c index 27299df..db895d7 100644 --- a/src/itdb_artwork.c +++ b/src/itdb_artwork.c @@ -1,7 +1,7 @@ /* | Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net> | Part of the gtkpod project. -| +| | URL: http://www.gtkpod.org/ | URL: http://gtkpod.sourceforge.net/ | @@ -45,8 +45,8 @@ /** * itdb_artwork_new: - * - * Creates a new #Itdb_Artwork + * + * Creates a new #Itdb_Artwork * * Return value: a new #Itdb_Artwork to be freed with itdb_artwork_free() when * no longer needed @@ -100,7 +100,7 @@ Itdb_Artwork *itdb_artwork_duplicate (Itdb_Artwork *artwork) * itdb_artwork_remove_thumbnails: * @artwork: an #Itdb_Artwork * - * Removes all thumbnails from @artwork + * Removes all thumbnails from @artwork **/ void itdb_artwork_remove_thumbnails (Itdb_Artwork *artwork) @@ -115,9 +115,6 @@ itdb_artwork_remove_thumbnails (Itdb_Artwork *artwork) artwork->id = 0; } - - - /** * itdb_artwork_set_thumbnail * @artwork: an #Itdb_Thumbnail @@ -127,7 +124,7 @@ itdb_artwork_remove_thumbnails (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 + * Appends a thumbnail of type @type to existing thumbnails in @artwork. No * data is read from @filename yet, the file will be when @artwork is saved to * disk. @filename must still exist when that happens. * @@ -311,7 +308,7 @@ unpack_RGB_565 (guint16 *pixels, guint bytes_len, guint byte_order) result[3*i] = (cur_pixel & RED_MASK_565) >> RED_SHIFT_565; result[3*i+1] = (cur_pixel & GREEN_MASK_565) >> GREEN_SHIFT_565; result[3*i+2] = (cur_pixel & BLUE_MASK_565) >> BLUE_SHIFT_565; - + /* Normalize color values so that they use a [0..255] range */ result[3*i] <<= (8 - RED_BITS_565); result[3*i+1] <<= (8 - GREEN_BITS_565); @@ -339,7 +336,7 @@ unpack_RGB_555 (guint16 *pixels, guint bytes_len, guint byte_order) result[3*i] = (cur_pixel & RED_MASK_555) >> RED_SHIFT_555; result[3*i+1] = (cur_pixel & GREEN_MASK_555) >> GREEN_SHIFT_555; result[3*i+2] = (cur_pixel & BLUE_MASK_555) >> BLUE_SHIFT_555; - + /* Normalize color values so that they use a [0..255] range */ result[3*i] <<= (8 - RED_BITS_555); result[3*i+1] <<= (8 - GREEN_BITS_555); @@ -368,7 +365,7 @@ unpack_RGB_888 (guint16 *pixels, guint bytes_len, guint byte_order) result[3*i] = (cur_pixel & RED_MASK_888) >> RED_SHIFT_888; result[3*i+1] = (cur_pixel & GREEN_MASK_888) >> GREEN_SHIFT_888; result[3*i+2] = (cur_pixel & BLUE_MASK_888) >> BLUE_SHIFT_888; - + /* Normalize color values so that they use a [0..255] range */ /* (not necessary for 888 encoding) */ /* result[3*i] <<= (8 - RED_BITS_888); */ @@ -413,7 +410,7 @@ static guint16 *rearrange_pixels (guint16 *pixels_s, guint16 *pixels_d, width/2, height/2, row_stride); } - + return pixels_d; } @@ -462,7 +459,7 @@ unpack_rec_RGB_555 (guint16 *pixels, guint bytes_len, guint byte_order, result[3*i] = (cur_pixel & RED_MASK_555) >> RED_SHIFT_555; result[3*i+1] = (cur_pixel & GREEN_MASK_555) >> GREEN_SHIFT_555; result[3*i+2] = (cur_pixel & BLUE_MASK_555) >> BLUE_SHIFT_555; - + /* Normalize color values so that they use a [0..255] range */ result[3*i] <<= (8 - RED_BITS_555); result[3*i+1] <<= (8 - GREEN_BITS_555); @@ -503,7 +500,7 @@ printf ("%8x\n", cur_pixel); result[3*i] = (cur_pixel & RED_MASK_888) >> RED_SHIFT_888; result[3*i+1] = (cur_pixel & GREEN_MASK_888) >> GREEN_SHIFT_888; result[3*i+2] = (cur_pixel & BLUE_MASK_888) >> BLUE_SHIFT_888; - + /* Normalize color values so that they use a [0..255] range */ /* (not really necessary for 888 encoding) */ /* result[3*i] <<= (8 - RED_BITS_888); */ @@ -561,9 +558,9 @@ unpack_I420 (guchar *yuvdata, gint bytes_len, guint byte_order, u = yuvdata[ustart + (row/2)*(width/2) + col/2]; v = yuvdata[vstart + (row/2)*(width/2) + col/2]; - rgbdata[z] = limit8bit((y-16)*1.164 + (v-128)*1.596); - rgbdata[z+1] = limit8bit((y-16)*1.164 - (v-128)*0.813 - (u-128)*0.391); - rgbdata[z+2] = limit8bit((y-16)*1.164 + (u-128)*2.018); + rgbdata[z] = limit8bit((y-16)*1.164 + (v-128)*1.596); + rgbdata[z+1] = limit8bit((y-16)*1.164 - (v-128)*0.813 - (u-128)*0.391); + rgbdata[z+2] = limit8bit((y-16)*1.164 + (u-128)*2.018); z+=3; h++; @@ -664,7 +661,7 @@ get_pixel_data (Itdb_Device *device, Itdb_Thumb_Ipod_Item *thumb) f = fopen (filename, "r"); if (f == NULL) { - g_print ("Failed to open %s: %s\n", + g_print ("Failed to open %s: %s\n", filename, strerror (errno)); goto error; } @@ -678,7 +675,7 @@ get_pixel_data (Itdb_Device *device, Itdb_Thumb_Ipod_Item *thumb) res = fread (result, thumb->size, 1, f); if (res != 1) { - g_print ("Failed to read %u bytes from %s: %s\n", + g_print ("Failed to read %u bytes from %s: %s\n", thumb->size, thumb->filename, strerror (errno)); goto error; } @@ -709,11 +706,11 @@ itdb_thumb_get_rgb_data (Itdb_Device *device, Itdb_Thumb_Ipod_Item *item) #endif void *pixels_raw; guchar *pixels=NULL; - + g_return_val_if_fail (device, NULL); g_return_val_if_fail (item, NULL); g_return_val_if_fail (item->size != 0, NULL); - + if (item->format == NULL) { return NULL; } @@ -800,8 +797,8 @@ itdb_thumb_get_rgb_data (Itdb_Device *device, Itdb_Thumb_Ipod_Item *item) } -gpointer itdb_thumb_ipod_item_to_pixbuf (Itdb_Device *device, - Itdb_Thumb_Ipod_Item *item) +gpointer itdb_thumb_ipod_item_to_pixbuf (Itdb_Device *device, + Itdb_Thumb_Ipod_Item *item) { /* pixbuf is already on the iPod -> read from there */ GdkPixbuf *pixbuf_full; @@ -876,7 +873,7 @@ gpointer itdb_thumb_ipod_item_to_pixbuf (Itdb_Device *device, return pixbuf; } #else -gpointer itdb_thumb_ipod_item_to_pixbuf (Itdb_Device *device, +gpointer itdb_thumb_ipod_item_to_pixbuf (Itdb_Device *device, Itdb_Thumb_Ipod_Item *item) { return NULL; @@ -894,20 +891,20 @@ gpointer itdb_thumb_ipod_item_to_pixbuf (Itdb_Device *device, * and 0 for the smallest possible size (with no scaling) * * Returns a #GdkPixbuf representing the thumbnail stored in @artwork - * scaling it if appropriate. If either height or width is -1, then the + * 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 * support **/ -gpointer itdb_artwork_get_pixbuf (Itdb_Device *device, Itdb_Artwork *artwork, +gpointer itdb_artwork_get_pixbuf (Itdb_Device *device, Itdb_Artwork *artwork, gint width, gint height) { g_return_val_if_fail (artwork != NULL, NULL); if (artwork->thumbnail == NULL) { return NULL; } - return itdb_thumb_to_pixbuf_at_size (device, artwork->thumbnail, + return itdb_thumb_to_pixbuf_at_size (device, artwork->thumbnail, width, height); } diff --git a/src/itdb_chapterdata.c b/src/itdb_chapterdata.c index 784f0d7..131f66e 100644 --- a/src/itdb_chapterdata.c +++ b/src/itdb_chapterdata.c @@ -2,7 +2,7 @@ | | Copyright (C) 2002-2007 Jorg Schuler <jcsjcs at users sourceforge net> | Part of the gtkpod project. -| +| | URL: http://www.gtkpod.org/ | URL: http://gtkpod.sourceforge.net/ | @@ -36,11 +36,10 @@ #include <string.h> #include <glib/gi18n-lib.h> - /** * itdb_chapterdata_new: - * - * Creates a new #Itdb_Chapterdata + * + * Creates a new #Itdb_Chapterdata * * Return value: a new #Itdb_Chapterdata to be freed with itdb_chapterdata_free() when * no longer needed @@ -68,7 +67,7 @@ static GList *dup_chapters (GList *chapters) { GList *it; GList *result; - + g_return_val_if_fail (chapters, NULL); result = NULL; for (it = chapters; it != NULL; it = it->next) @@ -80,7 +79,7 @@ static GList *dup_chapters (GList *chapters) g_return_val_if_fail (chapter, NULL); new_chapter = itdb_chapter_duplicate (chapter); - + result = g_list_prepend (result, new_chapter); } @@ -135,7 +134,7 @@ itdb_chapterdata_remove_chapter (Itdb_Chapterdata *chapterdata, Itdb_Chapter *ch * itdb_chapterdata_remove_chapters: * @chapterdata: an #Itdb_Chapterdata * - * Removes all chapters from @chapterdata + * Removes all chapters from @chapterdata **/ void itdb_chapterdata_remove_chapters (Itdb_Chapterdata *chapterdata) @@ -152,7 +151,7 @@ itdb_chapterdata_remove_chapters (Itdb_Chapterdata *chapterdata) /** * itdb_chapter_new: - * + * * Creates a new #Itdb_Chapter * * Return Value: newly allocated #Itdb_Chapter to be freed with itdb_chapter_free() @@ -164,7 +163,7 @@ Itdb_Chapter *itdb_chapter_new (void) return chapter; } -/** +/** * itdb_chapter_free: * @chapter: an #Itdb_Chapter * @@ -178,13 +177,13 @@ void itdb_chapter_free (Itdb_Chapter *chapter) g_free (chapter); } -/** +/** * itdb_chapter_duplicate: * @chapter: an #Itdb_Chapter * * Duplicates the data contained in @chapter * - * Return value: a newly allocated copy of @chapter to be freed with + * Return value: a newly allocated copy of @chapter to be freed with * itdb_chapter_free() after use **/ Itdb_Chapter *itdb_chapter_duplicate (Itdb_Chapter *chapter) @@ -196,7 +195,7 @@ Itdb_Chapter *itdb_chapter_duplicate (Itdb_Chapter *chapter) new_chapter = itdb_chapter_new (); memcpy (new_chapter, chapter, sizeof (Itdb_Chapter)); new_chapter->chaptertitle = g_strdup (chapter->chaptertitle); - + return new_chapter; } diff --git a/src/itdb_device.c b/src/itdb_device.c index 42999df..6261711 100644 --- a/src/itdb_device.c +++ b/src/itdb_device.c @@ -1204,7 +1204,6 @@ static guint endianess_check_path (const gchar *path, const gchar *hdr) * It will overwrite the previous setting. * */ - G_GNUC_INTERNAL void itdb_device_autodetect_endianess (Itdb_Device *device) { @@ -1362,7 +1361,6 @@ gboolean itdb_device_supports_artwork (const Itdb_Device *device) * * Return value: true if @device can play videos. */ - gboolean itdb_device_supports_video (const Itdb_Device *device) { const Itdb_IpodInfo *info; @@ -1409,7 +1407,6 @@ gboolean itdb_device_supports_video (const Itdb_Device *device) * * Return value: true if @device can display photos. */ - gboolean itdb_device_supports_photo (const Itdb_Device *device) { GList *formats; diff --git a/src/itdb_device.h b/src/itdb_device.h index d461994..1888a27 100644 --- a/src/itdb_device.h +++ b/src/itdb_device.h @@ -1,7 +1,7 @@ /* | Copyright (C) 2002-2007 Jorg Schuler <jcsjcs at users sourceforge net> | Part of the gtkpod project. -| +| | URL: http://www.gtkpod.org/ | URL: http://gtkpod.sourceforge.net/ | @@ -99,12 +99,12 @@ struct _Itdb_ArtworkFormat { gint width; gint height; ItdbThumbFormat format; - gint32 padding; /* not found in SysInfoExtended, added - * for compatibility with hardcoded artwork formats */ + gint32 padding; /* not found in SysInfoExtended, added + * for compatibility with hardcoded artwork formats */ gboolean crop; gint rotation; guchar back_color[4]; - + gint display_width; gboolean interlaced; gboolean align_row_bytes; diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c index 78cb943..8cdffc6 100644 --- a/src/itdb_itunesdb.c +++ b/src/itdb_itunesdb.c @@ -1198,7 +1198,6 @@ guint32 itdb_playlists_number (Itdb_iTunesDB *itdb) return g_list_length (itdb->playlists); } - /** * itdb_tracks_number: * @itdb: an #Itdb_iTunesDB @@ -1239,8 +1238,6 @@ guint32 itdb_tracks_number_nontransferred (Itdb_iTunesDB *itdb) return n; } - - /** * itdb_new: * @@ -3044,7 +3041,6 @@ Itdb_iTunesDB *itdb_parse (const gchar *mp, GError **error) return itdb; } - /** * itdb_parse_file: * @filename: path to a file in iTunesDB format @@ -5378,7 +5374,6 @@ All integers in the iTunesSD file are in BIG endian form... */ - /** * itdb_shuffle_write: * @itdb: the #Itdb_iTunesDB to write to disk @@ -5405,7 +5400,7 @@ gboolean itdb_shuffle_write (Itdb_iTunesDB *itdb, GError **error) g_return_val_if_fail (itdb_get_mountpoint (itdb), FALSE); itunes_path = itdb_get_itunes_dir (itdb_get_mountpoint (itdb)); - + if(!itunes_path) { gchar *str = g_build_filename (itdb_get_mountpoint (itdb), @@ -5447,13 +5442,14 @@ static gboolean haystack (gchar *filetype, gchar **desclist) } return FALSE; } + /** * itdb_shuffle_write_file: * @itdb: the #Itdb_iTunesDB to write to disk * @filename: file to write to, cannot be NULL * @error: return location for a #GError or NULL * - * Do the actual writing to the iTunesSD + * Do the actual writing to the iTunesSD * * Return value: TRUE on success, FALSE on error, in which case @error is * set accordingly. @@ -5564,23 +5560,12 @@ gboolean itdb_shuffle_write_file (Itdb_iTunesDB *itdb, return result; } - - - - - - - - - - /*------------------------------------------------------------------*\ * * * Other file/filename stuff * * * \*------------------------------------------------------------------*/ - /** * itdb_rename_files: * @mp: mount point of the iPod @@ -5589,7 +5574,7 @@ gboolean itdb_shuffle_write_file (Itdb_iTunesDB *itdb, * Renames/removes some files on the iPod (Playcounts, OTG * semaphore). May have to be called if you write the iTunesDB not * directly to the iPod but to some other location and then manually - * copy the file from there to the iPod. + * copy the file from there to the iPod. * * Return value: FALSE on error and sets @error accordingly **/ @@ -5616,7 +5601,7 @@ gboolean itdb_rename_files (const gchar *mp, GError **error) } plcname_o = itdb_resolve_path (itunesdir, db_plc_o); - plcname_n = g_build_filename (itunesdir, + plcname_n = g_build_filename (itunesdir, "Play Counts.bak", NULL); otgname = itdb_resolve_path (itunesdir, db_otg); shuname = itdb_resolve_path (itunesdir, db_shu); @@ -5706,8 +5691,6 @@ void itdb_filename_ipod2fs (gchar *ipod_file) g_strdelimit (ipod_file, ":", G_DIR_SEPARATOR); } - - /** * itdb_set_mountpoint: * @itdb: an #Itdb_iTunesDB @@ -5869,7 +5852,7 @@ gchar *itdb_cp_get_dest_filename (Itdb_Track *track, g_snprintf (dir_num_str, 6, "F%02d", dir_num); dest_components[0] = dir_num_str; - + parent_dir_filename = itdb_resolve_path (music_dir, (const gchar **)dest_components); if(parent_dir_filename == NULL) @@ -5927,7 +5910,6 @@ gchar *itdb_cp_get_dest_filename (Itdb_Track *track, return ipod_fullfile; } - /** * itdb_cp_finalize: * @track: track to update or NULL @@ -6053,7 +6035,6 @@ Itdb_Track *itdb_cp_finalize (Itdb_Track *track, return use_track; } - /** * itdb_cp_track_to_ipod: * @track: the #Itdb_Track to copy (containing @filename metadata) @@ -6115,8 +6096,6 @@ gboolean itdb_cp_track_to_ipod (Itdb_Track *track, return result; } - - /** * itdb_filename_on_ipod: * @track: an #Itdb_Track @@ -6168,7 +6147,6 @@ gchar *itdb_filename_on_ipod (Itdb_Track *track) return result; } - /* Use open instead of fopen. fwrite is really slow on the Mac. */ /** * itdb_cp: @@ -6333,7 +6311,6 @@ itdb_file_set_contents (const char *filename, return TRUE; } - /** * itdb_get_control_dir: * @mountpoint: the iPod mountpoint @@ -6542,7 +6519,7 @@ gchar *itdb_get_itunessd_path (const gchar *mountpoint) * * Retrieve a path to the ArtworkDB * - * Return value: path to the ArtworkDB or NULL if non-existent. Must g_free() + * Return value: path to the ArtworkDB or NULL if non-existent. Must g_free() * after use. **/ gchar *itdb_get_artworkdb_path (const gchar *mountpoint) @@ -6574,10 +6551,10 @@ gchar *itdb_get_artworkdb_path (const gchar *mountpoint) * * Gets the current time in a format appropriate for storing in the libgpod * data structures - * + * * Return value: current time * - * Deprecated: kept for compatibility with older code, directly use + * Deprecated: kept for compatibility with older code, directly use * g_get_current_time() or time(NULL) instead **/ time_t itdb_time_get_mac_time (void) @@ -6589,7 +6566,6 @@ time_t itdb_time_get_mac_time (void) return time.tv_sec; } - /** * itdb_time_mac_to_host: * @time: time expressed in libgpod format @@ -6648,29 +6624,29 @@ gboolean itdb_init_ipod (const gchar *mountpoint, Itdb_Playlist *mpl = NULL; Itdb_IpodInfo const *info = NULL; gchar *path; - + g_return_val_if_fail (mountpoint, FALSE); - + /* Create new blank itdb database for writing to iPod */ itdb = itdb_new(); - + /* Assign iPod device reference to new database */ itdb_set_mountpoint(itdb, mountpoint); - + /* Insert model_number into sysinfo file if present * The model number can be extracted in a couple of ways: * - use the read_sysinfo_file function - * - use libipoddevice and hal to get the model - * (as far as I know, libipoddevice will also - * read the sysinfo file, complemented by some - * guessing). + * - use libipoddevice and hal to get the model + * (as far as I know, libipoddevice will also + * read the sysinfo file, complemented by some + * guessing). */ if (model_number) { itdb_device_set_sysinfo (itdb->device, "ModelNumStr", model_number); } - + /* Create the remaining directories resident on blank ipod */ writeok = itdb_create_directories(itdb->device, error); if(! writeok) @@ -6707,7 +6683,7 @@ gboolean itdb_init_ipod (const gchar *mountpoint, /* Retrieve the model from the device information */ info = itdb_device_get_ipod_info(itdb->device); - + /* If model is a shuffle or the model is undetermined, * ie. @model_number is NULL, then create the itunesSD database */ @@ -6716,12 +6692,12 @@ gboolean itdb_init_ipod (const gchar *mountpoint, path = itdb_get_itunessd_path (mountpoint); if (!path) { - writeok = itdb_shuffle_write(itdb, error); - if(! writeok) - { - itdb_free (itdb); + writeok = itdb_shuffle_write(itdb, error); + if(! writeok) + { + itdb_free (itdb); return FALSE; - } + } } g_free (path); } @@ -6905,7 +6881,6 @@ static gboolean itdb_create_directories (Itdb_Device *device, GError **error) } g_free (pbuf); } - /* Build the directories that hold the music files */ dirnum = info->musicdirs; @@ -6983,11 +6958,11 @@ static gboolean itdb_create_directories (Itdb_Device *device, GError **error) { goto error_dir; } - } + } g_free (pbuf); model_number = itdb_device_get_sysinfo (device, "ModelNumStr"); - /* Construct a SysInfo file */ + /* Construct a SysInfo file */ if (model_number && (strlen (model_number) != 0)) { pbuf = NULL; @@ -7005,7 +6980,7 @@ static gboolean itdb_create_directories (Itdb_Device *device, GError **error) if (pbuf) { g_set_error (error, 0, -1, - _("Problem creating iPod directory or file: '%s'."), + _("Problem creating iPod directory or file: '%s'."), pbuf); result = FALSE; } else diff --git a/src/itdb_photoalbum.c b/src/itdb_photoalbum.c index a5e9d76..2e6168b 100644 --- a/src/itdb_photoalbum.c +++ b/src/itdb_photoalbum.c @@ -2,7 +2,7 @@ | | Copyright (C) 2002-2006 Jorg Schuler <jcsjcs at users sourceforge net> | Part of the gtkpod project. -| +| | URL: http://www.gtkpod.org/ | URL: http://gtkpod.sourceforge.net/ | @@ -86,7 +86,7 @@ For example, "MA450" would stand for an 80 GB 6th generation iPod Video. See itdb_device.c for a list of supported models. - + This information will be written to the iPod when the PhotoDB is saved (itdb_device_write_sysinfo() is called). */ @@ -114,7 +114,6 @@ static void error_no_photos_dir (const gchar *mp, GError **error) } } - /** * itdb_get_photos_dir: * @mountpoint: mountpoint of iPod @@ -200,7 +199,6 @@ gchar *itdb_get_photos_thumb_dir (const gchar *mountpoint) return result; } - /** * itdb_photodb_parse: * @mp: mountpoint of the iPod @@ -239,7 +237,6 @@ Itdb_PhotoDB *itdb_photodb_parse (const gchar *mp, GError **error) return photodb; } - /** * itdb_photodb_create: * @mountpoint: mountpoint or NULL. @@ -268,7 +265,6 @@ Itdb_PhotoDB *itdb_photodb_create (const gchar *mountpoint) } - static Itdb_PhotoDB *itdb_photodb_new (void) { Itdb_PhotoDB *photodb; @@ -279,13 +275,11 @@ static Itdb_PhotoDB *itdb_photodb_new (void) return photodb; } - - -/** +/** * itdb_photodb_free: * @photodb: an #Itdb_PhotoDB * - * Free the memory taken by @photodb. + * Free the memory taken by @photodb. **/ void itdb_photodb_free (Itdb_PhotoDB *photodb) { @@ -309,7 +303,7 @@ void itdb_photodb_free (Itdb_PhotoDB *photodb) -G_GNUC_INTERNAL gint itdb_get_max_photo_id ( Itdb_PhotoDB *db ) +G_GNUC_INTERNAL gint itdb_get_max_photo_id ( Itdb_PhotoDB *db ) { gint max_seen_id = 0; GList *it; @@ -464,8 +458,6 @@ static Itdb_Artwork *itdb_photodb_add_photo_internal (Itdb_PhotoDB *db, #endif } - - /** * itdb_photodb_add_photo: * @db: the #Itdb_PhotoDB to add the photo to. @@ -499,7 +491,6 @@ Itdb_Artwork *itdb_photodb_add_photo (Itdb_PhotoDB *db, position, rotation, error); } - /** * itdb_photodb_add_photo_from_data: * @db: the #Itdb_PhotoDB to add the photo to. @@ -570,7 +561,6 @@ Itdb_Artwork *itdb_photodb_add_photo_from_pixbuf (Itdb_PhotoDB *db, position, rotation, error); } - /** * itdb_photodb_remove_photo: * @db: the #Itdb_PhotoDB to remove the photo from @@ -713,7 +703,6 @@ void itdb_photodb_photoalbum_add_photo (Itdb_PhotoDB *db, album->members = g_list_insert (album->members, photo, position); } - /** * itdb_photodb_photoalbum_create: * @db: The database to create a new album in diff --git a/src/itdb_playlist.c b/src/itdb_playlist.c index 2fbc691..9acd695 100644 --- a/src/itdb_playlist.c +++ b/src/itdb_playlist.c @@ -1,7 +1,7 @@ /* | Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net> | Part of the gtkpod project. -| +| | URL: http://www.gtkpod.org/ | URL: http://gtkpod.sourceforge.net/ | @@ -135,14 +135,13 @@ ItdbSPLFieldType itdb_splr_get_field_type (const Itdb_SPLRule *splr) return(ITDB_SPLFT_UNKNOWN); } - /** * itdb_splr_get_action_type: * @splr: an #Itdb_SPLRule - * + * * Gets the type of the action associated with @splr. * - * Return value: type (range, date, string...) of the action field + * Return value: type (range, date, string...) of the action field **/ ItdbSPLActionType itdb_splr_get_action_type (const Itdb_SPLRule *splr) { @@ -319,7 +318,6 @@ ItdbSPLActionType itdb_splr_get_action_type (const Itdb_SPLRule *splr) * */ - /** * itdb_splr_eval: * @splr: an #Itdb_SPLRule @@ -678,7 +676,6 @@ static GList *randomize_glist (GList *list) return list; } - /** * itdb_playlist_randomize: * @pl: an #Itdb_Playlist to randomize @@ -692,7 +689,6 @@ void itdb_playlist_randomize (Itdb_Playlist *pl) pl->members = randomize_glist (pl->members); } - /** * itdb_spl_update: * @spl: an #Itdb_Playlist @@ -908,7 +904,6 @@ void itdb_spl_update (Itdb_Playlist *spl) } } - /** * itdb_spl_update_all: * @itdb: an #Itdb_iTunesDB @@ -930,8 +925,7 @@ static void spl_update2 (Itdb_Playlist *playlist, gpointer data) itdb_spl_update (playlist); } - -/** +/** * itdb_spl_update_live: * @itdb: an #Itdb_iTunesDB * @@ -949,7 +943,6 @@ void itdb_spl_update_live (Itdb_iTunesDB *itdb) /* end of code based on Samuel Wood's work */ /* ------------------------------------------------------------------- */ - /** * itdb_splr_validate: * @splr: an #Itdb_SPLRule @@ -1007,12 +1000,11 @@ void itdb_splr_validate (Itdb_SPLRule *splr) } - /** * itdb_splr_free: * @splr: an #Itdb_SPLRule * - * Frees the memory used by @splr + * Frees the memory used by @splr **/ void itdb_splr_free (Itdb_SPLRule *splr) { @@ -1059,13 +1051,12 @@ void itdb_splr_add (Itdb_Playlist *pl, Itdb_SPLRule *splr, gint pos) splr, pos); } - /** * itdb_splr_new: - * - * Creates a new default smart rule * - * Return value: a new #Itdb_SPLRule that must be freed with itdb_splr_free() when + * Creates a new default smart rule + * + * Return value: a new #Itdb_SPLRule that must be freed with itdb_splr_free() when * no longer needed **/ Itdb_SPLRule *itdb_splr_new (void) @@ -1084,7 +1075,6 @@ Itdb_SPLRule *itdb_splr_new (void) return splr; } - /** * itdb_splr_add_new: * @pl: an #Itdb_Playlist @@ -1122,7 +1112,6 @@ static Itdb_SPLRule *splr_duplicate (Itdb_SPLRule *splr) return dup; } - /** * itdb_playlist_duplicate: * @pl: an #Itdb_Playlist @@ -1175,7 +1164,6 @@ Itdb_Playlist *itdb_playlist_duplicate (Itdb_Playlist *pl) return pl_dup; } - /** * itdb_spl_copy_rules: * @dest: destination #Itdb_Playlist @@ -1212,8 +1200,6 @@ void itdb_spl_copy_rules (Itdb_Playlist *dest, Itdb_Playlist *src) } } - - /** * itdb_playlist_new: * @title: playlist title @@ -1253,12 +1239,11 @@ Itdb_Playlist *itdb_playlist_new (const gchar *title, gboolean spl) return pl; } - /** * itdb_playlist_free: * @pl: an #Itdb_Playlist * - * Frees the memory used by playlist @pl. + * Frees the memory used by playlist @pl. **/ void itdb_playlist_free (Itdb_Playlist *pl) { @@ -1273,8 +1258,6 @@ void itdb_playlist_free (Itdb_Playlist *pl) g_free (pl); } - - /** * itdb_playlist_add: * @itdb: an #Itdb_iTunesDB @@ -1322,14 +1305,12 @@ void itdb_playlist_add (Itdb_iTunesDB *itdb, Itdb_Playlist *pl, gint32 pos) itdb->playlists = g_list_insert (itdb->playlists, pl, pos); } - - /** * itdb_playlist_move: * @pl: an #Itdb_Playlist * @pos: new position * - * Moves playlist @pl to position @pos + * Moves playlist @pl to position @pos **/ void itdb_playlist_move (Itdb_Playlist *pl, guint32 pos) { @@ -1343,13 +1324,12 @@ void itdb_playlist_move (Itdb_Playlist *pl, guint32 pos) itdb->playlists = g_list_insert (itdb->playlists, pl, pos); } - /** * itdb_playlist_remove: * @pl: an #Itdb_Playlist - * - * Removes @pl from the #Itdb_iTunesDB it's associated with - * and frees memory + * + * Removes @pl from the #Itdb_iTunesDB it's associated with + * and frees memory **/ void itdb_playlist_remove (Itdb_Playlist *pl) { @@ -1363,7 +1343,6 @@ void itdb_playlist_remove (Itdb_Playlist *pl) itdb_playlist_free (pl); } - /** * itdb_playlist_unlink: * @pl: an #Itdb_Playlist @@ -1383,7 +1362,6 @@ void itdb_playlist_unlink (Itdb_Playlist *pl) pl->itdb = NULL; } - /** * itdb_playlist_exists: * @itdb: an #Itdb_iTunesDB @@ -1402,7 +1380,6 @@ gboolean itdb_playlist_exists (Itdb_iTunesDB *itdb, Itdb_Playlist *pl) else return FALSE; } - /** * itdb_playlist_add_track: * @pl: an #Itdb_Playlist @@ -1424,8 +1401,6 @@ void itdb_playlist_add_track (Itdb_Playlist *pl, pl->members = g_list_insert (pl->members, track, pos); } - - /** * itdb_playlist_remove_track: * @pl: an #Itdb_Playlist @@ -1448,13 +1423,12 @@ void itdb_playlist_remove_track (Itdb_Playlist *pl, Itdb_Track *track) pl->members = g_list_remove (pl->members, track); } - /** * itdb_playlist_by_id: * @itdb: an #Itdb_iTunesDB * @id: ID of the playlist to look for * - * Looks up a playlist whose ID is @id + * Looks up a playlist whose ID is @id * * Return value: the #Itdb_Playlist with ID @id or NULL if there is no such * playlist. @@ -1473,7 +1447,6 @@ Itdb_Playlist *itdb_playlist_by_id (Itdb_iTunesDB *itdb, guint64 id) return NULL; } - /** * itdb_playlist_by_nr: * @itdb: an #Itdb_iTunesDB @@ -1492,7 +1465,6 @@ Itdb_Playlist *itdb_playlist_by_nr (Itdb_iTunesDB *itdb, guint32 num) return pl; } - /** * itdb_playlist_by_name: * @itdb: an #Itdb_iTunesDB @@ -1519,14 +1491,13 @@ Itdb_Playlist *itdb_playlist_by_name (Itdb_iTunesDB *itdb, gchar *name) return NULL; } - /** * itdb_playlist_is_mpl: * @pl: an #Itdb_Playlist * - * Checks if @pl is the master playlist + * Checks if @pl is the master playlist * - * Return value: TRUE if @pl is the master playlist, FALSE otherwise + * Return value: TRUE if @pl is the master playlist, FALSE otherwise **/ gboolean itdb_playlist_is_mpl (Itdb_Playlist *pl) { @@ -1535,14 +1506,13 @@ gboolean itdb_playlist_is_mpl (Itdb_Playlist *pl) return ((pl->type & 0xff) == ITDB_PL_TYPE_MPL); } - /** * itdb_playlist_is_podcasts: * @pl: an #Itdb_Playlist * * Checks if @pl is the podcasts playlist * - * Return value: TRUE if @pl is the podcasts playlist, FALSE otherwise + * Return value: TRUE if @pl is the podcasts playlist, FALSE otherwise **/ gboolean itdb_playlist_is_podcasts (Itdb_Playlist *pl) { @@ -1551,7 +1521,6 @@ gboolean itdb_playlist_is_podcasts (Itdb_Playlist *pl) return (pl->podcastflag == ITDB_PL_FLAG_PODCASTS); } - /** * itdb_playlist_set_mpl: * @pl: an #Itdb_Playlist @@ -1565,12 +1534,11 @@ void itdb_playlist_set_mpl (Itdb_Playlist *pl) pl->type = ITDB_PL_TYPE_MPL; } - /** * itdb_playlist_set_podcasts: * @pl: an #Itdb_Playlist * - * Set @pl to be a podcasts playlist + * Set @pl to be a podcasts playlist **/ void itdb_playlist_set_podcasts (Itdb_Playlist *pl) { @@ -1579,14 +1547,13 @@ void itdb_playlist_set_podcasts (Itdb_Playlist *pl) pl->podcastflag = ITDB_PL_FLAG_PODCASTS; } - /** * itdb_playlist_mpl: * @itdb: an #Itdb_iTunesDB - * + * * Gets the master playlist of @itdb * - * Return value: the master playlist of @itdb + * Return value: the master playlist of @itdb **/ Itdb_Playlist *itdb_playlist_mpl (Itdb_iTunesDB *itdb) { @@ -1629,8 +1596,6 @@ Itdb_Playlist *itdb_playlist_podcasts (Itdb_iTunesDB *itdb) return NULL; } - - /** * itdb_playlist_contains_track: * @pl: an #Itdb_Playlist @@ -1653,7 +1618,6 @@ gboolean itdb_playlist_contains_track (Itdb_Playlist *pl, Itdb_Track *tr) else return FALSE; } - /** * itdb_playlist_contain_track_number: * @tr: an #Itdb_Track @@ -1684,8 +1648,6 @@ guint32 itdb_playlist_contain_track_number (Itdb_Track *tr) return num; } - - /** * itdb_playlist_tracks_number: * @pl: an #Itdb_Playlist diff --git a/src/itdb_plist.c b/src/itdb_plist.c index 00e2b4b..2bd1dca 100644 --- a/src/itdb_plist.c +++ b/src/itdb_plist.c @@ -1,7 +1,7 @@ /* | Copyright (C) 2008 Christophe Fergeau <teuf@gnome.org> | Part of the gtkpod project. -| +| | URL: http://www.gtkpod.org/ | URL: http://gtkpod.sourceforge.net/ | @@ -29,11 +29,11 @@ /* This file implements a generic plist parser. A plist file is an * Apple-specific XML format which is used to serialize (simple) data * structures to disk, see http://en.wikipedia.org/wiki/Property_list - * + * * This parser should handle most plist files, with those limitations : * - no support for <date> tags * - * The plist file is parsed using libxml, and the parsed result is stored + * The plist file is parsed using libxml, and the parsed result is stored * in GValue. The types are mapped in the following way: * - <string> => G_TYPE_STRING (char*) * - <real> => G_TYPE_DOUBLE (double) @@ -70,14 +70,14 @@ extern GQuark itdb_device_error_quark (void); static GValue *parse_node (xmlNode *a_node, GError **error); -static void +static void value_free (GValue *val) { g_value_unset (val); g_free (val); } -static GValue * +static GValue * parse_integer(xmlNode *a_node, GError **error) { char *str_val; @@ -102,7 +102,7 @@ parse_integer(xmlNode *a_node, GError **error) return value; } -static GValue * +static GValue * parse_string(xmlNode *a_node, G_GNUC_UNUSED GError **error) { char *str_val; @@ -232,14 +232,14 @@ parse_one_dict_entry (xmlNode *a_node, GHashTable *dict, GError **error) return cur_node->next; } -static GValue * +static GValue * parse_dict (xmlNode *a_node, GError **error) { xmlNode *cur_node = a_node->children; GValue *value; GHashTable *dict; - dict = g_hash_table_new_full (g_str_hash, g_str_equal, + dict = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)value_free); while (cur_node != NULL) { @@ -263,7 +263,7 @@ parse_dict (xmlNode *a_node, GError **error) typedef GValue *(*ParseCallback) (xmlNode *, GError **); static ParseCallback get_parser_for_type (const xmlChar *type); -static GValue * +static GValue * parse_array (xmlNode *a_node, GError **error) { xmlNode *cur_node = a_node->children; @@ -282,9 +282,9 @@ parse_array (xmlNode *a_node, GError **error) g_free (cur_value); } } - /* When an array contains an element enclosed in "unknown" tags (ie + /* When an array contains an element enclosed in "unknown" tags (ie * non-type ones), we silently skip them since early - * SysInfoExtended files used to have <key> values enclosed within + * SysInfoExtended files used to have <key> values enclosed within * <array> tags. */ cur_node = cur_node->next; @@ -312,7 +312,7 @@ static const struct Parser parsers[] = { {"integer", parse_integer}, {"true", parse_boolean}, {"false", parse_boolean}, {"data", parse_data}, - {"dict", parse_dict}, + {"dict", parse_dict}, {"array", parse_array}, {NULL, NULL} }; @@ -320,7 +320,7 @@ static ParseCallback get_parser_for_type (const xmlChar *type) { guint i = 0; - while (parsers[i].type_name != NULL) { + while (parsers[i].type_name != NULL) { if (xmlStrcmp (type, (xmlChar *)parsers[i].type_name) == 0) { if (parsers[i].parser != NULL) { return parsers[i].parser; @@ -376,7 +376,7 @@ itdb_plist_parse (xmlNode * a_node, GError **error) * @filename: name of the XML plist file to parse * @error: return location for a #GError * - * Returns: NULL on error (@error will be set), a newly allocated GValue + * Returns: NULL on error (@error will be set), a newly allocated GValue * containing a GHashTable otherwise. * * Parses the XML plist file stored in @filename. If an error occurs during @@ -413,7 +413,7 @@ itdb_plist_parse_from_file (const char *filename, GError **error) * @len: length in bytes of the string to parse * @error: return location for a #GError * - * Returns: NULL on error (@error will be set), a newly allocated GValue + * Returns: NULL on error (@error will be set), a newly allocated GValue * containing a GHashTable otherwise. * * Parses the XML plist file stored in @data which length is @len bytes. If @@ -444,7 +444,7 @@ itdb_plist_parse_from_memory (const char *data, gsize len, GError **error) return parsed_doc; } -#else +#else #include <glib-object.h> #include "itdb_plist.h" @@ -454,7 +454,7 @@ GValue *itdb_plist_parse_from_file (G_GNUC_UNUSED const char *filename, return NULL; } -GValue *itdb_plist_parse_from_memory (G_GNUC_UNUSED const char *data, +GValue *itdb_plist_parse_from_memory (G_GNUC_UNUSED const char *data, G_GNUC_UNUSED gsize len, G_GNUC_UNUSED GError **error) { diff --git a/src/itdb_sysinfo_extended_parser.c b/src/itdb_sysinfo_extended_parser.c index c00a868..5408c91 100644 --- a/src/itdb_sysinfo_extended_parser.c +++ b/src/itdb_sysinfo_extended_parser.c @@ -1,7 +1,7 @@ /* | Copyright (C) 2008 Christophe Fergeau <teuf@gnome.org> | Part of the gtkpod project. -| +| | URL: http://www.gtkpod.org/ | URL: http://gtkpod.sourceforge.net/ | @@ -46,7 +46,7 @@ * If DEBUG_PARSING is defined when building that file, the fields that * were found in the SysInfoExtended file but which were not used to build * the data structures defined in that file will be dumped to stdout. It's - * normal to get a few unhandled fields, I left out on purpose a few <dict> + * normal to get a few unhandled fields, I left out on purpose a few <dict> * because I was too lazy to parse them ;) */ #ifdef HAVE_CONFIG_H @@ -247,8 +247,8 @@ static void dump_key_name (gpointer key, gpointer val, gpointer data) } #endif -static void dict_to_struct (GHashTable *dict, - const DictFieldMapping *mapping, +static void dict_to_struct (GHashTable *dict, + const DictFieldMapping *mapping, void *struct_ptr) { const DictFieldMapping *it = mapping; @@ -261,7 +261,7 @@ static void dict_to_struct (GHashTable *dict, *field = get_int (dict, it->name); break; } - + case G_TYPE_BOOLEAN: { gboolean *field; field = G_STRUCT_MEMBER_P (struct_ptr, it->offset); @@ -295,7 +295,7 @@ static void dict_to_struct (GHashTable *dict, #endif } -static void free_struct (const DictFieldMapping *mapping, +static void free_struct (const DictFieldMapping *mapping, void *struct_ptr) { const DictFieldMapping *it = mapping; @@ -326,7 +326,7 @@ void itdb_sysinfo_properties_free (SysInfoIpodProperties *props) free_struct (sysinfo_ipod_properties_fields_mapping, props); } -static void dump_struct (const DictFieldMapping *mapping, +static void dump_struct (const DictFieldMapping *mapping, void *struct_ptr) { const DictFieldMapping *it = mapping; @@ -339,7 +339,7 @@ static void dump_struct (const DictFieldMapping *mapping, g_print ("%s: %d\n", it->name, *field); break; } - + case G_TYPE_BOOLEAN: { gboolean *field; field = G_STRUCT_MEMBER_P (struct_ptr, it->offset); @@ -378,7 +378,7 @@ void itdb_sysinfo_properties_dump (SysInfoIpodProperties *props) g_list_foreach (props->chapter_image_formats, (GFunc)dump_image_format, NULL); } -static gboolean +static gboolean set_pixel_format (Itdb_ArtworkFormat *img_spec, GHashTable *dict) { char *pixel_format; @@ -433,16 +433,16 @@ static Itdb_ArtworkFormat *g_value_to_image_format (GValue *value) g_return_val_if_fail (G_VALUE_HOLDS (value, G_TYPE_HASH_TABLE), NULL); dict = g_value_get_boxed (value); g_return_val_if_fail (dict != NULL, NULL); - + img_spec = g_new0 (Itdb_ArtworkFormat, 1); if (img_spec == NULL) { - return NULL; + return NULL; } - + if (!set_pixel_format (img_spec, dict)) { g_free (img_spec); return NULL; - } + } set_back_color (img_spec, dict); dict_to_struct (dict, sysinfo_image_format_fields_mapping, img_spec); @@ -484,16 +484,16 @@ static SysInfoIpodProperties *g_value_to_ipod_properties (GValue *value) g_return_val_if_fail (G_VALUE_HOLDS (value, G_TYPE_HASH_TABLE), NULL); sysinfo_dict = g_value_get_boxed (value); - + props = g_new0 (SysInfoIpodProperties, 1); - props->artwork_formats = parse_one_formats_list (sysinfo_dict, + props->artwork_formats = parse_one_formats_list (sysinfo_dict, "AlbumArt"); - props->photo_formats = parse_one_formats_list (sysinfo_dict, + props->photo_formats = parse_one_formats_list (sysinfo_dict, "ImageSpecifications"); - props->chapter_image_formats = parse_one_formats_list (sysinfo_dict, + props->chapter_image_formats = parse_one_formats_list (sysinfo_dict, "ChapterImageSpecs"); - dict_to_struct (sysinfo_dict, - sysinfo_ipod_properties_fields_mapping, + dict_to_struct (sysinfo_dict, + sysinfo_ipod_properties_fields_mapping, props); return props; diff --git a/src/itdb_thumb.c b/src/itdb_thumb.c index 7e8716b..201dfb1 100644 --- a/src/itdb_thumb.c +++ b/src/itdb_thumb.c @@ -1,7 +1,7 @@ /* | Copyright (C) 2007 Christophe Fergeau <teuf at gnome org> | Part of the gtkpod project. -| +| | URL: http://www.gtkpod.org/ | URL: http://gtkpod.sourceforge.net/ | @@ -39,7 +39,7 @@ Itdb_Thumb *itdb_thumb_new_from_file (const gchar *filename) { Itdb_Thumb_File *thumb_file; Itdb_Thumb *thumb; - + thumb_file = g_new0 (Itdb_Thumb_File, 1); thumb = (Itdb_Thumb *)thumb_file; thumb->data_type = ITDB_THUMB_TYPE_FILE; @@ -53,7 +53,7 @@ Itdb_Thumb *itdb_thumb_new_from_data (const guchar *data, gsize len) { Itdb_Thumb_Memory *thumb_memory; Itdb_Thumb *thumb; - + thumb_memory = g_new0 (Itdb_Thumb_Memory, 1); thumb = (Itdb_Thumb *)thumb_memory; thumb->data_type = ITDB_THUMB_TYPE_MEMORY; @@ -69,13 +69,13 @@ Itdb_Thumb *itdb_thumb_new_from_pixbuf (gpointer pixbuf) { Itdb_Thumb_Pixbuf *thumb_pixbuf; Itdb_Thumb *thumb; - + thumb_pixbuf = g_new0 (Itdb_Thumb_Pixbuf, 1); thumb = (Itdb_Thumb *)thumb_pixbuf; thumb->data_type = ITDB_THUMB_TYPE_PIXBUF; thumb_pixbuf->pixbuf = g_object_ref (G_OBJECT (pixbuf)); - - return thumb; + + return thumb; } #else Itdb_Thumb *itdb_thumb_new_from_pixbuf (gpointer pixbuf) @@ -87,7 +87,7 @@ Itdb_Thumb *itdb_thumb_new_from_pixbuf (gpointer pixbuf) Itdb_Thumb_Ipod_Item *itdb_thumb_new_item_from_ipod (const Itdb_ArtworkFormat *format) { Itdb_Thumb_Ipod_Item *thumb_ipod; - + thumb_ipod = g_new0 (Itdb_Thumb_Ipod_Item, 1); thumb_ipod->format = format; @@ -97,11 +97,11 @@ Itdb_Thumb_Ipod_Item *itdb_thumb_new_item_from_ipod (const Itdb_ArtworkFormat *f G_GNUC_INTERNAL Itdb_Thumb *itdb_thumb_ipod_new (void) { Itdb_Thumb *thumb; - + thumb = (Itdb_Thumb *)g_new0 (Itdb_Thumb_Ipod, 1); thumb->data_type = ITDB_THUMB_TYPE_IPOD; - - return thumb; + + return thumb; } static void itdb_thumb_ipod_item_free (Itdb_Thumb_Ipod_Item *item) @@ -110,7 +110,7 @@ static void itdb_thumb_ipod_item_free (Itdb_Thumb_Ipod_Item *item) g_free (item); } -/** +/** * itdb_thumb_free: * @thumb: an #Itdb_Thumb * @@ -145,7 +145,7 @@ void itdb_thumb_free (Itdb_Thumb *thumb) case ITDB_THUMB_TYPE_IPOD: { Itdb_Thumb_Ipod *thumb_ipod = (Itdb_Thumb_Ipod *)thumb; g_list_foreach (thumb_ipod->thumbs, - (GFunc)itdb_thumb_ipod_item_free, + (GFunc)itdb_thumb_ipod_item_free, NULL); g_list_free (thumb_ipod->thumbs); break; @@ -161,7 +161,7 @@ static Itdb_Thumb_Ipod_Item * itdb_thumb_ipod_item_duplicate (Itdb_Thumb_Ipod_Item *item) { Itdb_Thumb_Ipod_Item *new_item; - + g_return_val_if_fail (item != NULL, NULL); new_item = itdb_thumb_new_item_from_ipod (item->format); @@ -177,13 +177,13 @@ itdb_thumb_ipod_item_duplicate (Itdb_Thumb_Ipod_Item *item) return new_item; } -/** +/** * itdb_thumb_duplicate: * @thumb: an #Itdb_Thumb * * Duplicates the data contained in @thumb * - * Return value: a newly allocated copy of @thumb to be freed with + * Return value: a newly allocated copy of @thumb to be freed with * itdb_thumb_free() after use **/ Itdb_Thumb *itdb_thumb_duplicate (Itdb_Thumb *thumb) @@ -195,7 +195,7 @@ Itdb_Thumb *itdb_thumb_duplicate (Itdb_Thumb *thumb) } case ITDB_THUMB_TYPE_MEMORY: { Itdb_Thumb_Memory *thumb_memory = (Itdb_Thumb_Memory *)thumb; - return itdb_thumb_new_from_data (thumb_memory->image_data, + return itdb_thumb_new_from_data (thumb_memory->image_data, thumb_memory->image_data_len); } #ifdef HAVE_GDKPIXBUF @@ -273,7 +273,7 @@ void itdb_thumb_set_rotation (Itdb_Thumb *thumb, guint rotation) thumb->rotation = rotation; } -G_GNUC_INTERNAL void itdb_thumb_ipod_add (Itdb_Thumb_Ipod *thumbs, +G_GNUC_INTERNAL void itdb_thumb_ipod_add (Itdb_Thumb_Ipod *thumbs, Itdb_Thumb_Ipod_Item *thumb) { thumbs->thumbs = g_list_prepend (thumbs->thumbs, thumb); @@ -306,8 +306,8 @@ Itdb_Thumb_Ipod_Item *itdb_thumb_ipod_get_item_by_type (Itdb_Thumb *thumbs, * the full path to the ithmb file. Otherwise return the full path to * the original file. * - * Return value: newly allocated string containing the absolute path to the - * thumbnail file. + * Return value: newly allocated string containing the absolute path to the + * thumbnail file. **/ gchar *itdb_thumb_ipod_get_filename (Itdb_Device *device, Itdb_Thumb_Ipod_Item *item) { @@ -360,8 +360,8 @@ const GList *itdb_thumb_ipod_get_thumbs (Itdb_Thumb_Ipod *thumbs) * * 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. + * 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) @@ -370,10 +370,10 @@ const GList *itdb_thumb_ipod_get_thumbs (Itdb_Thumb_Ipod *thumbs) * 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 + * after use, or NULL if the creation of the gdk-pixbuf failed or if * libgpod was compiled without gdk-pixbuf support. **/ -gpointer itdb_thumb_to_pixbuf_at_size (Itdb_Device *device, Itdb_Thumb *thumb, +gpointer itdb_thumb_to_pixbuf_at_size (Itdb_Device *device, Itdb_Thumb *thumb, gint width, gint height) { GdkPixbuf *pixbuf=NULL; @@ -385,7 +385,7 @@ gpointer itdb_thumb_to_pixbuf_at_size (Itdb_Device *device, Itdb_Thumb *thumb, Itdb_Thumb_File *thumb_file = (Itdb_Thumb_File *)thumb; if ((width != -1) && (height !=-1) && (width != 0) && (height != 0)) { /* scale */ - pixbuf = gdk_pixbuf_new_from_file_at_size (thumb_file->filename, + pixbuf = gdk_pixbuf_new_from_file_at_size (thumb_file->filename, width, height, NULL); } @@ -396,7 +396,7 @@ gpointer itdb_thumb_to_pixbuf_at_size (Itdb_Device *device, Itdb_Thumb *thumb, break; } case ITDB_THUMB_TYPE_MEMORY: - { + { Itdb_Thumb_Memory *thumb_mem = (Itdb_Thumb_Memory *)thumb; GdkPixbufLoader *loader = gdk_pixbuf_loader_new (); g_return_val_if_fail (loader, FALSE); @@ -512,8 +512,8 @@ static GList *itdb_thumb_ipod_to_pixbufs (Itdb_Device *dev, Itdb_Thumb_Ipod *thu g_return_val_if_fail (thumb != NULL, NULL); g_return_val_if_fail (thumb->parent.data_type == ITDB_THUMB_TYPE_IPOD, NULL); - for (items = itdb_thumb_ipod_get_thumbs (thumb); - items != NULL; + for (items = itdb_thumb_ipod_get_thumbs (thumb); + items != NULL; items = items->next) { GdkPixbuf *pixbuf; pixbuf = itdb_thumb_ipod_item_to_pixbuf (dev, items->data); diff --git a/src/itdb_thumb.h b/src/itdb_thumb.h index 55672ff..7c2806c 100644 --- a/src/itdb_thumb.h +++ b/src/itdb_thumb.h @@ -106,16 +106,16 @@ G_GNUC_INTERNAL Itdb_Thumb *itdb_thumb_new_from_data (const guchar *data, G_GNUC_INTERNAL Itdb_Thumb *itdb_thumb_new_from_pixbuf (gpointer pixbuf); G_GNUC_INTERNAL Itdb_Thumb_Ipod_Item *itdb_thumb_new_item_from_ipod (const Itdb_ArtworkFormat *format); G_GNUC_INTERNAL Itdb_Thumb *itdb_thumb_ipod_new (void); -G_GNUC_INTERNAL void itdb_thumb_set_rotation (Itdb_Thumb *thumb, +G_GNUC_INTERNAL void itdb_thumb_set_rotation (Itdb_Thumb *thumb, guint rotation); G_GNUC_INTERNAL guint itdb_thumb_get_rotation (Itdb_Thumb *thumb); -G_GNUC_INTERNAL void itdb_thumb_ipod_add (Itdb_Thumb_Ipod *thumbs, +G_GNUC_INTERNAL void itdb_thumb_ipod_add (Itdb_Thumb_Ipod *thumbs, Itdb_Thumb_Ipod_Item *thumb); G_GNUC_INTERNAL const GList *itdb_thumb_ipod_get_thumbs (Itdb_Thumb_Ipod *thumbs); G_GNUC_INTERNAL char *itdb_thumb_ipod_get_filename (Itdb_Device *device, Itdb_Thumb_Ipod_Item *thumb); G_GNUC_INTERNAL Itdb_Thumb_Ipod_Item *itdb_thumb_ipod_get_item_by_type (Itdb_Thumb *thumbs, const Itdb_ArtworkFormat *format); G_GNUC_INTERNAL gpointer -itdb_thumb_ipod_item_to_pixbuf (Itdb_Device *device, - Itdb_Thumb_Ipod_Item *item); +itdb_thumb_ipod_item_to_pixbuf (Itdb_Device *device, + Itdb_Thumb_Ipod_Item *item); #endif diff --git a/src/itdb_track.c b/src/itdb_track.c index 0d9f185..dbe427e 100644 --- a/src/itdb_track.c +++ b/src/itdb_track.c @@ -1,7 +1,7 @@ /* | Copyright (C) 2002-2007 Jorg Schuler <jcsjcs at users sourceforge net> | Part of the gtkpod project. -| +| | URL: http://www.gtkpod.org/ | URL: http://gtkpod.sourceforge.net/ | @@ -35,8 +35,8 @@ /** * itdb_track_new: - * - * Creates an empty #Itdb_Track + * + * Creates an empty #Itdb_Track * * Return Value: the new #Itdb_Track, free it with itdb_track_free() when no * longer needed @@ -192,18 +192,16 @@ static void itdb_track_set_defaults (Itdb_Track *tr) } if (tr->dbid2 == 0) tr->dbid2 = tr->dbid; } - - /** * itdb_track_add: * @itdb: an #Itdb_iTunesDB * @track: an #Itdb_Track * @pos: position of the track to add - * + * * Adds @track to @itdb->tracks at position @pos (or at the end if pos * is -1). The application is responsible to also add it to the master - * playlist. The @itdb gets ownership of the @track and will take care of + * playlist. The @itdb gets ownership of the @track and will take care of * freeing the memory it uses when it's no longer necessary. **/ void itdb_track_add (Itdb_iTunesDB *itdb, Itdb_Track *track, gint32 pos) @@ -223,7 +221,7 @@ void itdb_track_add (Itdb_iTunesDB *itdb, Itdb_Track *track, gint32 pos) * itdb_track_free: * @track: an #Itdb_Track * - * Frees the memory used by @track + * Frees the memory used by @track **/ void itdb_track_free (Itdb_Track *track) { @@ -288,9 +286,9 @@ void itdb_track_remove (Itdb_Track *track) /** * itdb_track_unlink: * @track: an #Itdb_Track - * + * * Removes @track from the #Itdb_iTunesDB it's associated with, but do not free - * memory. It doesn't remove the track from the playlists it may have been + * memory. It doesn't remove the track from the playlists it may have been * added to, in particular it won't be removed from the master playlist. * track->itdb is set to NULL. **/ @@ -312,7 +310,7 @@ void itdb_track_unlink (Itdb_Track *track) * * Duplicates an existing track * - * Return value: a newly allocated #Itdb_Track + * Return value: a newly allocated #Itdb_Track **/ Itdb_Track *itdb_track_duplicate (Itdb_Track *tr) { @@ -379,7 +377,7 @@ static gboolean itdb_track_set_thumbnails_internal (Itdb_Track *track, gpointer *pixbuf, gint rotation, GError **error) -{ +{ gboolean result = FALSE; g_return_val_if_fail (track, FALSE); @@ -438,7 +436,7 @@ static gboolean itdb_track_set_thumbnails_internal (Itdb_Track *track, * * Uses the image contained in @filename to generate iPod thumbnails. The image * can be in any format supported by gdk-pixbuf. To save memory, the thumbnails - * will only be generated when necessary, ie when itdb_save() or a similar + * will only be generated when necessary, ie when itdb_save() or a similar * function is called. * * Return value: TRUE if the thumbnail could be added, FALSE otherwise. @@ -500,11 +498,10 @@ gboolean itdb_track_set_thumbnails_from_pixbuf (Itdb_Track *track, pixbuf, 0, NULL); } - /** * itdb_track_remove_thumbnails: * @track: an #Itdb_Track - * + * * Removes the thumbnails associated with @track **/ void itdb_track_remove_thumbnails (Itdb_Track *track) @@ -523,17 +520,17 @@ void itdb_track_remove_thumbnails (Itdb_Track *track) * @itdb: an #Itdb_iTunesDB * @id: ID of the track to look for * - * Looks up a track using its ID in @itdb. + * Looks up a track using its ID in @itdb. * Looking up tracks by ID is not really a good idea because the IDs * are created by itdb just before export. The functions are here * because they are needed during import of the iTunesDB which is * referencing tracks by IDs. - * This function is very slow (linear in the number of tracks contained in the - * database). If you need to lookup many IDs use itdb_track_id_tree_create(), + * This function is very slow (linear in the number of tracks contained in the + * database). If you need to lookup many IDs use itdb_track_id_tree_create(), * itdb_track_id_tree_destroy(), and itdb_track_id_tree_by_id(). * * Return value: #Itdb_Track with the ID @id or NULL if the ID cannot be - * found. + * found. **/ Itdb_Track *itdb_track_by_id (Itdb_iTunesDB *itdb, guint32 id) { @@ -563,9 +560,9 @@ static gint track_id_compare (gconstpointer a, gconstpointer b) * @itdb: an #Itdb_iTunesDB * * Creates a balanced-binary tree for quick ID lookup that is used in - * itdb_track_by_id_tree() function below + * itdb_track_by_id_tree() function below * - * Return value: a #GTree indexed by track IDs to be freed with + * Return value: a #GTree indexed by track IDs to be freed with * itdb_track_id_tree_destroy() when no longer used **/ GTree *itdb_track_id_tree_create (Itdb_iTunesDB *itdb) @@ -590,7 +587,7 @@ GTree *itdb_track_id_tree_create (Itdb_iTunesDB *itdb) * itdb_track_id_tree_destroy: * @idtree: a #GTree * - * Frees the memory used by @idtree + * Frees the memory used by @idtree **/ void itdb_track_id_tree_destroy (GTree *idtree) { @@ -607,7 +604,7 @@ void itdb_track_id_tree_destroy (GTree *idtree) * Lookup an #Itdb_Track by @id using @idtree for faster lookup (compared to * itdb_track_by_id) * - * Return value: the #Itdb_Track whose ID is @id, or NULL if such a track + * Return value: the #Itdb_Track whose ID is @id, or NULL if such a track * couldn't be found **/ Itdb_Track *itdb_track_id_tree_by_id (GTree *idtree, guint32 id) @@ -623,7 +620,7 @@ Itdb_Track *itdb_track_id_tree_by_id (GTree *idtree, guint32 id) * * Return value: TRUE if @track has artwork available, FALSE otherwise **/ -gboolean itdb_track_has_thumbnails (Itdb_Track *track) +gboolean itdb_track_has_thumbnails (Itdb_Track *track) { g_return_val_if_fail (track != NULL, FALSE); return ((track->artwork) && (track->artwork->thumbnail)); @@ -632,7 +629,7 @@ gboolean itdb_track_has_thumbnails (Itdb_Track *track) /** * itdb_track_get_thumbnail: * @track: an #Itdb_Track - * @width: width of the pixbuf to retrieve, -1 for the biggest possible size + * @width: width of the pixbuf to retrieve, -1 for the biggest possible size * (with no scaling) * @height: height of the pixbuf to retrieve, -1 for the biggest possible size * (with no scaling) |