Revision: 1528
http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1528&view=rev
Author: phantom_sf
Date: 2007-06-05 14:32:13 -0700 (Tue, 05 Jun 2007)
Log Message:
-----------
2007-06-05 P.G. Richardson <phantom_sf at users.sourceforge.net>
* Initial and experimental referencing of photo database. Code
taken from test source files so successful initialization
simply prints out the reference id numbers of the photos.
Added Paths:
-----------
gtkpod/branches/photo_support_branch/src/display_photo.c
gtkpod/branches/photo_support_branch/src/display_photo.h
Added: gtkpod/branches/photo_support_branch/src/display_photo.c
===================================================================
--- gtkpod/branches/photo_support_branch/src/display_photo.c
(rev 0)
+++ gtkpod/branches/photo_support_branch/src/display_photo.c 2007-06-05
21:32:13 UTC (rev 1528)
@@ -0,0 +1,105 @@
+/*
+| 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/
+|
+| This program is free software; you can redistribute it and/or modify
+| it under the terms of the GNU General Public License as published by
+| the Free Software Foundation; either version 2 of the License, or
+| (at your option) any later version.
+|
+| This program is distributed in the hope that it will be useful,
+| but WITHOUT ANY WARRANTY; without even the implied warranty of
+| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+| GNU General Public License for more details.
+|
+| You should have received a copy of the GNU General Public License
+| along with this program; if not, write to the Free Software
+| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+|
+| iTunes and iPod are trademarks of Apple
+|
+| This product is not supported/written/published by Apple!
+|
+*/
+
+#include "display_photo.h"
+#include "display_private.h"
+
+static void debug_list_photos (iTunesDB *itdb)
+{
+ ExtraiTunesDBData *eitdb;
+ PhotoDB *db;
+ GList *gl_album;
+
+ eitdb = itdb->userdata;
+ db = eitdb->photodb;
+ if (db == NULL)
+ {
+ printf ("Reference to photo database is null\n");
+ return;
+ }
+
+ printf ("List of Photos stored on the ipod\n");
+ for (gl_album=db->photoalbums; gl_album; gl_album=gl_album->next)
+ {
+ GList *gl_photo;
+ PhotoAlbum *album = gl_album->data;
+ g_return_if_fail (album);
+
+ printf ("%s: ", album->name?album->name:_("<Unnamed>"));
+
+ for (gl_photo=album->members; gl_photo; gl_photo=gl_photo->next)
+ {
+ Artwork *photo = gl_photo->data;
+ g_return_if_fail (photo);
+
+ printf ("%d ", photo->id);
+ }
+ if (g_list_length (album->members) > 0)
+ {
+ printf ("\n");
+ }
+ else
+ {
+ printf (_("<No members>\n"));
+ }
+ }
+}
+
+void display_photo_load_photodb (iTunesDB *itdb)
+{
+ ExtraiTunesDBData *eitdb;
+ PhotoDB *db;
+ const gchar *mp;
+ GError *error = NULL;
+
+ eitdb = itdb->userdata;
+ mp = itdb_get_mountpoint (itdb);
+ db = itdb_photodb_parse (mp, &error);
+ if (db == NULL)
+ {
+ if (error)
+ {
+ gtkpod_warning (_("Error reading iPod photo database
(%s).\n"), error->message);
+ g_error_free (error);
+ error = NULL;
+ }
+ else
+ {
+ gtkpod_warning (_("Error reading iPod photo
database.\n"));
+ }
+ eitdb->photodb = NULL;
+ return;
+ }
+
+ /* Set the reference to the photo database */
+ eitdb->photodb = db;
+ printf ("Reference to photo db successfully set\n");
+ debug_list_photos (itdb);
+}
+
+
+
Added: gtkpod/branches/photo_support_branch/src/display_photo.h
===================================================================
--- gtkpod/branches/photo_support_branch/src/display_photo.h
(rev 0)
+++ gtkpod/branches/photo_support_branch/src/display_photo.h 2007-06-05
21:32:13 UTC (rev 1528)
@@ -0,0 +1,52 @@
+/*
+| 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/
+|
+| This program is free software; you can redistribute it and/or modify
+| it under the terms of the GNU General Public License as published by
+| the Free Software Foundation; either version 2 of the License, or
+| (at your option) any later version.
+|
+| This program is distributed in the hope that it will be useful,
+| but WITHOUT ANY WARRANTY; without even the implied warranty of
+| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+| GNU General Public License for more details.
+|
+| You should have received a copy of the GNU General Public License
+| along with this program; if not, write to the Free Software
+| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+|
+| iTunes and iPod are trademarks of Apple
+|
+| This product is not supported/written/published by Apple!
+|
+*/
+
+#ifndef DISPLAY_PHOTO_H_
+#define DISPLAY_PHOTO_H_
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+#include "display_itdb.h"
+
+void display_photo_load_photodb (iTunesDB *itdb);
+
+
+
+
+
+
+
+
+
+
+
+
+
+#endif /*DISPLAY_PHOTO_H_*/
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2