? =
? attachment.cgi?id=63452
? attachment.cgi?id=63552
? b
? bt.log
? bug-23368-integrated-ripping.diff
? bug325034.diff
? bug338561.diff
? bug338562.diff
? burner.Diff
? burner.diff
? burner.diuff
? conf11657.file
? detect.diff
? eject-rename.diff
? final.diff
? hashtable.dif
? interdiff.diff
? ipod-plugins.diff
? ipod-todo.txt
? ipod-write.diff
? malloc-overflows.diff
? move-to-trash.didd
? move-to-trash.diff
? patch.diff
? playbin.diff
? playlist.diff
? plugin-orig.diff
? plugin.diff
? plugin2.diff
? queue-set.diff
? rb-recorder-gst.diff
? rhythmbox-audioscrobbler-libsoup-new-files.tar.bz2
? rhythmbox-gpod.diff
? show_bug.cgi?id=338443
? treeview.diff
? plugins/ipod
? remote/dbus/rb-remote-dbus.loT
? sources/rb-audioscrobbler.c
? sources/rb-library-source.diff
Index: configure.ac
===================================================================
RCS file: /cvs/gnome/rhythmbox/configure.ac,v
retrieving revision 1.231
diff -u -r1.231 configure.ac
--- configure.ac	16 Apr 2006 12:09:18 -0000	1.231
+++ configure.ac	16 Apr 2006 17:48:37 -0000
@@ -912,6 +912,7 @@
 plugins/Makefile
 plugins/sample/Makefile
 plugins/audioscrobbler/Makefile
+plugins/ipod/Makefile
 plugins/lirc/Makefile
 plugins/sample-python/Makefile
 plugins/pythonconsole/Makefile
Index: lib/rb-marshal.list
===================================================================
RCS file: /cvs/gnome/rhythmbox/lib/rb-marshal.list,v
retrieving revision 1.15
diff -u -r1.15 rb-marshal.list
--- lib/rb-marshal.list	9 Apr 2006 11:02:15 -0000	1.15
+++ lib/rb-marshal.list	16 Apr 2006 17:48:37 -0000
@@ -1,6 +1,7 @@
 BOOLEAN:BOOLEAN,BOOLEAN,BOOLEAN
 BOOLEAN:POINTER
 INT:VOID
+OBJECT:OBJECT
 STRING:STRING
 VOID:BOOLEAN,BOOLEAN
 VOID:DOUBLE,LONG
Index: lib/rb-util.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/lib/rb-util.c,v
retrieving revision 1.22
diff -u -r1.22 rb-util.c
--- lib/rb-util.c	16 Apr 2006 10:24:04 -0000	1.22
+++ lib/rb-util.c	16 Apr 2006 17:48:37 -0000
@@ -18,13 +18,15 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
  */
+#include "config.h"
 
-#include "rb-util.h"
 #include <gtk/gtk.h>
 #include <string.h>
 #include <libgnome/gnome-i18n.h>
 #include <libgnomevfs/gnome-vfs.h>
 #include <libgnomevfs/gnome-vfs-mime-handlers.h>
+
+#include "rb-util.h"
 #include "rb-debug.h"
 
 static GPrivate * private_is_primary_thread;
@@ -733,3 +735,20 @@
 	return name;
 }
 
+gboolean
+rb_signal_accumulator_object_handled (GSignalInvocationHint *hint,
+				      GValue *return_accu,
+				      const GValue *handler_return,
+				      gpointer dummy)
+{
+	if (handler_return == NULL ||
+	    !G_VALUE_HOLDS_OBJECT (handler_return) ||
+	    g_value_get_object (handler_return) == NULL)
+		return TRUE;
+
+	g_value_unset (return_accu);
+	g_value_init (return_accu, G_VALUE_TYPE (handler_return));
+	g_value_copy (handler_return, return_accu);
+	
+	return FALSE;
+}
Index: lib/rb-util.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/lib/rb-util.h,v
retrieving revision 1.17
diff -u -r1.17 rb-util.h
--- lib/rb-util.h	2 Apr 2006 01:05:22 -0000	1.17
+++ lib/rb-util.h	16 Apr 2006 17:48:37 -0000
@@ -62,6 +62,10 @@
 GList* rb_uri_list_parse (const char *uri_list);
 const gchar* rb_mime_get_friendly_name (const gchar *mime_type);
 
+gboolean rb_signal_accumulator_object_handled (GSignalInvocationHint *hint,
+					       GValue *return_accu,
+					       const GValue *handler_return,
+					       gpointer dummy);
 
 G_END_DECLS
 
Index: plugins/Makefile.am
===================================================================
RCS file: /cvs/gnome/rhythmbox/plugins/Makefile.am,v
retrieving revision 1.3
diff -u -r1.3 Makefile.am
--- plugins/Makefile.am	2 Apr 2006 05:22:19 -0000	1.3
+++ plugins/Makefile.am	16 Apr 2006 17:48:37 -0000
@@ -14,6 +14,10 @@
 SUBDIRS += pythonconsole sample-python
 endif
 
+if USE_IPOD
+SUBDIRS += ipod
+endif
+
 noinst_LTLIBRARIES = librbplugins.la
 
 librbplugins_la_SOURCES =				\
Index: plugins/rb-plugin.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/plugins/rb-plugin.h,v
retrieving revision 1.1
diff -u -r1.1 rb-plugin.h
--- plugins/rb-plugin.h	11 Mar 2006 05:24:55 -0000	1.1
+++ plugins/rb-plugin.h	16 Apr 2006 17:48:37 -0000
@@ -93,6 +93,7 @@
 #define RB_PLUGIN_REGISTER(PluginName, plugin_name)				\
 										\
 static GType plugin_name##_type = 0;						\
+static GTypeModule *plugin_module_type = 0;		                \
 										\
 GType										\
 plugin_name##_get_type (void)							\
@@ -131,12 +132,67 @@
 	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);			\
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");			\
 										\
+	plugin_module_type = module;						\
 	plugin_name##_type = g_type_module_register_type (module,		\
 					    RB_TYPE_PLUGIN,			\
 					    #PluginName,			\
 					    &our_info,				\
 					    0);					\
 	return plugin_name##_type;						\
+}
+
+
+#define RB_PLUGIN_REGISTER_TYPE(type_name)                                      \
+        type_name##_register_type (plugin_module_type)
+
+#define RB_PLUGIN_DEFINE_TYPE(TypeName, type_name, TYPE_PARENT)			\
+static void type_name##_init (TypeName *self); 				\
+static void type_name##_class_init (TypeName##Class *klass); 			\
+static gpointer type_name##_parent_class = ((void *)0); 			\
+static GType type_name##_type_id = 0;						\
+										\
+static void 									\
+type_name##_class_intern_init (gpointer klass) 					\
+{ 										\
+	type_name##_parent_class = g_type_class_peek_parent (klass);		\
+	type_name##_class_init ((TypeName##Class*) klass); 			\
+}										\
+										\
+										\
+GType 										\
+type_name##_get_type (void)							\
+{										\
+	g_assert (type_name##_type_id != 0);					\
+										\
+	return type_name##_type_id;						\
+}										\
+										\
+GType 										\
+type_name##_register_type (GTypeModule *module) 				\
+{ 										\
+										\
+	if ((type_name##_type_id == 0)) { 					\
+		static const GTypeInfo g_define_type_info = { 			\
+			sizeof (TypeName##Class), 				\
+			(GBaseInitFunc) ((void *)0), 				\
+			(GBaseFinalizeFunc) ((void *)0), 			\
+			(GClassInitFunc) type_name##_class_intern_init, 	\
+			(GClassFinalizeFunc) ((void *)0), 			\
+			((void *)0), 						\
+			sizeof (TypeName), 					\
+			0, 							\
+			(GInstanceInitFunc) type_name##_init,			\
+			((void *)0) 						\
+		}; 								\
+		type_name##_type_id = 						\
+			g_type_module_register_type (module, 			\
+						     TYPE_PARENT, 		\
+						     g_intern_static_string (#TypeName), \
+						     &g_define_type_info, 	\
+						     (GTypeFlags) 0); 		\
+	} 									\
+										\
+	return type_name##_type_id;						\
 }
 
 
Index: shell/Makefile.am
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/Makefile.am,v
retrieving revision 1.78
diff -u -r1.78 Makefile.am
--- shell/Makefile.am	11 Apr 2006 09:39:06 -0000	1.78
+++ shell/Makefile.am	16 Apr 2006 17:48:37 -0000
@@ -114,10 +114,6 @@
 INCLUDES += -I$(top_srcdir)/remote/bonobo
 endif
 
-if USE_IPOD
-rhythmbox_LDADD += $(IPOD_LIBS)
-endif
-
 if USE_DAAP
 INCLUDES += -I$(top_srcdir)/daapsharing
 
Index: shell/rb-removable-media-manager.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-removable-media-manager.c,v
retrieving revision 1.21
diff -u -r1.21 rb-removable-media-manager.c
--- shell/rb-removable-media-manager.c	10 Apr 2006 13:18:05 -0000	1.21
+++ shell/rb-removable-media-manager.c	16 Apr 2006 17:48:38 -0000
@@ -37,9 +37,6 @@
 #ifdef HAVE_HAL
 #include "rb-nokia770-source.h"
 #endif
-#ifdef WITH_IPOD_SUPPORT
-#include "rb-ipod-source.h"
-#endif
 
 #include "rb-shell.h"
 #include "rb-shell-player.h"
@@ -147,6 +144,7 @@
 {
 	MEDIUM_ADDED,
 	TRANSFER_PROGRESS,
+	CREATE_SOURCE,
 	LAST_SIGNAL
 };
 
@@ -219,7 +217,16 @@
 			      rb_marshal_VOID__INT_INT_DOUBLE,
 			      G_TYPE_NONE,
 			      3, G_TYPE_INT, G_TYPE_INT, G_TYPE_DOUBLE);
-
+	
+	rb_removable_media_manager_signals[CREATE_SOURCE] =
+		g_signal_new ("create-source",
+			      RB_TYPE_REMOVABLE_MEDIA_MANAGER,
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (RBRemovableMediaManagerClass, create_source),
+			      rb_signal_accumulator_object_handled, NULL,
+			      rb_marshal_OBJECT__OBJECT,
+			      RB_TYPE_SOURCE,
+			      1, GNOME_VFS_TYPE_VOLUME);
 
 	g_type_class_add_private (klass, sizeof (RBRemovableMediaManagerPrivate));
 }
@@ -584,7 +591,6 @@
 {
 	RBRemovableMediaManagerPrivate *priv = REMOVABLE_MEDIA_MANAGER_GET_PRIVATE (mgr);
 	RBRemovableMediaSource *source = NULL;
-	RBShell *shell;
 	char *fs_type, *device_path, *display_name, *hal_udi, *icon_name;
 	GnomeVFSDeviceType device_type;
 
@@ -604,8 +610,6 @@
 	    device_type == GNOME_VFS_DEVICE_TYPE_NETWORK)
 		return;
 
-	g_object_get (G_OBJECT (mgr), "shell", &shell, NULL);
-
 	fs_type = gnome_vfs_volume_get_filesystem_type (volume);
 	device_path = gnome_vfs_volume_get_device_path (volume);
 	display_name = gnome_vfs_volume_get_display_name (volume);
@@ -625,33 +629,33 @@
 	 * When volume is of the appropriate type, it creates a new source
 	 * to handle this volume
 	 */
+
+	g_signal_emit (G_OBJECT (mgr), rb_removable_media_manager_signals[CREATE_SOURCE], 0,
+		       volume, &source);
+
 	if (source == NULL && rb_audiocd_is_volume_audiocd (volume))
-		source = rb_audiocd_source_new (shell, volume);
-#ifdef WITH_IPOD_SUPPORT
-	if (source == NULL && rb_ipod_is_volume_ipod (volume))
-		source = rb_ipod_source_new (shell, volume);
-#endif
+		source = rb_audiocd_source_new (priv->shell, volume);
 	if (source == NULL && rb_psp_is_volume_player (volume))
-		source = rb_psp_source_new (shell, volume);
+		source = rb_psp_source_new (priv->shell, volume);
 #ifdef HAVE_HAL
 	if (source == NULL && rb_nokia770_is_volume_player (volume))
-		source = rb_nokia770_source_new (shell, volume);
+		source = rb_nokia770_source_new (priv->shell, volume);
 #endif
 	if (source == NULL && rb_generic_player_is_volume_player (volume))
-		source = rb_generic_player_source_new (shell, volume);
+		source = rb_generic_player_source_new (priv->shell, volume);
 
 	if (source) {
 		g_hash_table_insert (priv->volume_mapping, volume, source);
 		rb_removable_media_manager_append_media_source (mgr, source);
-	} else
+	} else {
 		rb_debug ("Unhandled media");
+	}
 
 	g_free (fs_type);
 	g_free (device_path);
 	g_free (display_name);
 	g_free (hal_udi);
 	g_free (icon_name);
-	g_object_unref (G_OBJECT (shell));
 }
 
 static void
Index: shell/rb-removable-media-manager.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-removable-media-manager.h,v
retrieving revision 1.3
diff -u -r1.3 rb-removable-media-manager.h
--- shell/rb-removable-media-manager.h	10 Apr 2006 13:18:05 -0000	1.3
+++ shell/rb-removable-media-manager.h	16 Apr 2006 17:48:38 -0000
@@ -22,6 +22,8 @@
 #ifndef __RB_REMOVABLE_MEDIA_MANAGER_H
 #define __RB_REMOVABLE_MEDIA_MANAGER_H
 
+#include <libgnomevfs/gnome-vfs.h>
+
 #include "rb-source.h"
 #include "rhythmdb.h"
 #include "rb-shell.h"
@@ -58,6 +60,8 @@
 					 gint done,
 					 gint total,
 					 double fraction);
+	RBSource * (*create_source)	(RBRemovableMediaManager *mgr,
+					 GnomeVFSVolume *volume);
 } RBRemovableMediaManagerClass;
 
 
Index: sources/Makefile.am
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/Makefile.am,v
retrieving revision 1.38
diff -u -r1.38 Makefile.am
--- sources/Makefile.am	10 Apr 2006 13:18:06 -0000	1.38
+++ sources/Makefile.am	16 Apr 2006 17:48:38 -0000
@@ -70,14 +70,6 @@
 libsources_la_LDFLAGS = -export-dynamic
 libsourcesimpl_la_LDFLAGS = -export-dynamic
 
-ipod_files =				\
-	rb-ipod-source.c		\
-	rb-ipod-source.h
-if USE_IPOD
-libsourcesimpl_la_SOURCES += $(ipod_files)
-INCLUDES += -I$(top_srcdir)/sources/ipod $(IPOD_CFLAGS)
-endif
-
 hal_files =				\
 	rb-nokia770-source.c		\
 	rb-nokia770-source.h
@@ -101,4 +93,4 @@
 INCLUDES +=$(GNOME_MEDIA_PROFILES_CFLAGS)
 endif
 
-EXTRA_DIST = $(ipod_files) $(hal_files) $(daap_files)
+EXTRA_DIST = $(hal_files) $(daap_files)
Index: sources/rb-ipod-source.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-ipod-source.c,v
retrieving revision 1.41
diff -u -r1.41 rb-ipod-source.c
--- sources/rb-ipod-source.c	16 Apr 2006 10:53:27 -0000	1.41
+++ sources/rb-ipod-source.c	16 Apr 2006 17:48:38 -0000
@@ -38,6 +38,7 @@
 #include "rb-ipod-source.h"
 #include "rb-debug.h"
 #include "rb-file-helpers.h"
+#include "rb-plugin.h"
 #include "rb-removable-media-manager.h"
 #include "rb-static-playlist-source.h"
 #include "rb-util.h"
@@ -68,7 +69,6 @@
 {
 	Itdb_iTunesDB *ipod_db;
 	gchar *ipod_mount_path;
-	GtkActionGroup *action_group;	
 } RBiPodSourcePrivate;
 
 
@@ -79,8 +79,10 @@
 	  G_CALLBACK (rb_ipod_source_cmd_rename) }
 };
 
+RB_PLUGIN_DEFINE_TYPE(RBiPodSource, 
+		      rb_ipod_source, 
+		      RB_TYPE_REMOVABLE_MEDIA_SOURCE)
 
-G_DEFINE_TYPE (RBiPodSource, rb_ipod_source, RB_TYPE_REMOVABLE_MEDIA_SOURCE)
 #define IPOD_SOURCE_GET_PRIVATE(o)   (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_IPOD_SOURCE, RBiPodSourcePrivate))
 
 
@@ -111,6 +113,10 @@
 
 	mpl = itdb_playlist_mpl (priv->ipod_db);
 	rb_debug ("Renaming iPod from %s to %s", mpl->name, name);
+	if (strcmp (mpl->name, name) == 0) {
+		rb_debug ("iPod is already named %s", name);
+		return;
+	}
 	g_free (mpl->name);
 	mpl->name = g_strdup (name);
 	itdb_write (priv->ipod_db, NULL);
@@ -134,35 +140,50 @@
 			  (GCallback)rb_ipod_source_name_changed_cb, NULL);
 }
 
+static void
+rb_ipod_source_register_actions (RBiPodSource *source)
+{
+	GtkUIManager *uimanager;
+	RBShell *shell;
+
+  	g_object_get (G_OBJECT (source), 
+		      "shell", &shell, 
+		      NULL);
+	g_object_get (G_OBJECT (shell), 
+		      "ui-manager", &uimanager, 
+		      NULL);
+
+	_rb_source_register_action_group (RB_SOURCE (source),
+					  "iPodActions",
+					  rb_ipod_source_actions,
+					  G_N_ELEMENTS (rb_ipod_source_actions),
+					  source);
+
+	gtk_ui_manager_add_ui_from_file (uimanager,
+					 rb_file ("ipod-ui.xml"),
+					 NULL);
+	g_object_unref (uimanager);
+	g_object_unref (shell);
+}
+
 static GObject *
 rb_ipod_source_constructor (GType type, guint n_construct_properties,
-			       GObjectConstructParam *construct_properties)
+			    GObjectConstructParam *construct_properties)
 {
 	RBiPodSource *source;
 	RBEntryView *songs;
 	RBiPodSourcePrivate *priv;
-	GtkUIManager *uimanager;
 
 	source = RB_IPOD_SOURCE (G_OBJECT_CLASS (rb_ipod_source_parent_class)->
 			constructor (type, n_construct_properties, construct_properties));
 	priv = IPOD_SOURCE_GET_PRIVATE (source);
+
+
+	rb_ipod_source_register_actions (source);
+
 	songs = rb_source_get_entry_view (RB_SOURCE (source));
 	rb_entry_view_append_column (songs, RB_ENTRY_VIEW_COL_RATING, FALSE);
 	rb_entry_view_append_column (songs, RB_ENTRY_VIEW_COL_LAST_PLAYED, FALSE);
-
-	priv->action_group = _rb_source_register_action_group (RB_SOURCE (source),
-							       "iPodActions",
-							       rb_ipod_source_actions,
-							       G_N_ELEMENTS (rb_ipod_source_actions),
-							       source);
-
-	/* FIXME: shouldn't it be done only once for the class instead of 
-	 * being done for every RBiPodSource object created?
-	 */
-	g_object_get (G_OBJECT (source), "ui-manager", &uimanager, NULL);
-	gtk_ui_manager_add_ui_from_file (uimanager,
-					 rb_file ("ipod-ui.xml"), NULL);
-	g_object_unref (G_OBJECT (uimanager));
 
 	rb_ipod_load_songs (source);
 
Index: sources/rb-ipod-source.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-ipod-source.h,v
retrieving revision 1.4
diff -u -r1.4 rb-ipod-source.h
--- sources/rb-ipod-source.h	11 Sep 2005 03:05:11 -0000	1.4
+++ sources/rb-ipod-source.h	16 Apr 2006 17:48:38 -0000
@@ -47,6 +47,7 @@
 
 RBRemovableMediaSource *	rb_ipod_source_new		(RBShell *shell, GnomeVFSVolume *volume);
 GType			rb_ipod_source_get_type		(void);
+GType                   rb_ipod_source_register_type    (GTypeModule *module);
 
 gboolean		rb_ipod_is_volume_ipod		(GnomeVFSVolume *volume);
 
--- /dev/null	2006-04-03 19:40:38.000000000 +0200
+++ plugins/ipod/ipod.rb-plugin.desktop.in	2006-04-16 13:03:38.992443161 +0200
@@ -0,0 +1,8 @@
+[RB Plugin]
+Module=ipod
+IAge=1
+_Name=iPod support
+_Description=Adds iPod support to Rhythmbox so that it can show an iPod content, and play from there
+Authors=James Livingston, Christophe Fergeau
+Copyright=(C) 2006 James Livingston
+Website=http://www.rhythmbox.org
--- /dev/null	2006-04-03 19:40:38.000000000 +0200
+++ plugins/ipod/rb-ipod-plugin.c	2006-04-16 19:31:03.052469608 +0200
@@ -0,0 +1,142 @@
+/*
+ * rb-ipod-plugin.c
+ * 
+ * Copyright (C) 2006 James Livingston <jrl@ids.org.au>
+ *
+ * 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, 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <glib/gi18n-lib.h>
+#include <gmodule.h>
+#include <gtk/gtk.h>
+#include <glib.h>
+#include <glib-object.h>
+#include <libgnomevfs/gnome-vfs.h>
+
+#include "rb-removable-media-manager.h"
+#include "rb-source.h"
+#include "rb-ipod-source.h"
+#include "rb-plugin.h"
+#include "rb-debug.h"
+#include "rb-util.h"
+#include "rb-shell.h"
+
+
+#define RB_TYPE_IPOD_PLUGIN		(rb_ipod_plugin_get_type ())
+#define RB_IPOD_PLUGIN(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_IPOD_PLUGIN, RBIpodPlugin))
+#define RB_IPOD_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_CAST((k), RB_TYPE_IPOD_PLUGIN, RBIpodPluginClass))
+#define RB_IS_IPOD_PLUGIN(o)		(G_TYPE_CHECK_INSTANCE_TYPE ((o), RB_TYPE_IPOD_PLUGIN))
+#define RB_IS_IPOD_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), RB_TYPE_IPOD_PLUGIN))
+#define RB_IPOD_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_IPOD_PLUGIN, RBIpodPluginClass))
+
+typedef struct
+{
+	RBPlugin parent;
+
+	RBShell *shell;
+} RBIpodPlugin;
+
+typedef struct
+{
+	RBPluginClass parent_class;
+} RBIpodPluginClass;
+
+
+G_MODULE_EXPORT GType register_rb_plugin (GTypeModule *module);
+GType	rb_ipod_plugin_get_type		(void) G_GNUC_CONST;
+
+static void rb_ipod_plugin_init (RBIpodPlugin *plugin);
+static void rb_ipod_plugin_finalize (GObject *object);
+static void impl_activate (RBPlugin *plugin, RBShell *shell);
+static void impl_deactivate (RBPlugin *plugin, RBShell *shell);
+static RBSource * create_source_cb (RBRemovableMediaManager *rmm,
+				    GnomeVFSVolume *volume,
+				    RBIpodPlugin *plugin);
+
+RB_PLUGIN_REGISTER(RBIpodPlugin, rb_ipod_plugin)
+
+static void
+rb_ipod_plugin_class_init (RBIpodPluginClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+	RBPluginClass *plugin_class = RB_PLUGIN_CLASS (klass);
+
+	object_class->finalize = rb_ipod_plugin_finalize;
+	
+	plugin_class->activate = impl_activate;
+	plugin_class->deactivate = impl_deactivate;
+
+	RB_PLUGIN_REGISTER_TYPE(rb_ipod_source);
+}
+
+static void
+rb_ipod_plugin_init (RBIpodPlugin *plugin)
+{
+	rb_debug ("RBIpodPlugin initialising");
+}
+
+static void
+rb_ipod_plugin_finalize (GObject *object)
+{
+	/*RBIpodPlugin *plugin = RB_IPOD_PLUGIN (object);*/
+
+	rb_debug ("RBIpodPlugin finalising");
+
+	G_OBJECT_CLASS (rb_ipod_plugin_parent_class)->finalize (object);
+}
+
+static void
+impl_activate (RBPlugin *bplugin,
+	       RBShell *shell)
+{
+	RBIpodPlugin *plugin = RB_IPOD_PLUGIN (bplugin);
+	RBRemovableMediaManager *rmm = NULL;
+
+	plugin->shell = shell;
+
+	g_object_get (G_OBJECT (shell), "removable-media-manager", &rmm, NULL);
+	g_signal_connect (G_OBJECT (rmm),
+			  "create-source", G_CALLBACK (create_source_cb),
+			  plugin);
+}
+
+static void
+impl_deactivate	(RBPlugin *bplugin,
+		 RBShell *shell)
+{
+	RBIpodPlugin *plugin = RB_IPOD_PLUGIN (bplugin);
+	RBRemovableMediaManager *rmm = NULL;
+
+	g_object_get (G_OBJECT (shell), "removable-media-manager", &rmm, NULL);
+	g_signal_handlers_disconnect_by_func (G_OBJECT (rmm), create_source_cb, plugin);
+}
+
+static RBSource *
+create_source_cb (RBRemovableMediaManager *rmm, GnomeVFSVolume *volume, RBIpodPlugin *plugin)
+{
+	if (rb_ipod_is_volume_ipod (volume)) {
+		RBSource *src;
+		src = RB_SOURCE (rb_ipod_source_new (plugin->shell, volume));
+		g_print ("iPod source: %p\n", src);
+		return src;
+	}
+
+	return NULL;
+}
+
--- /dev/null	2006-04-03 19:40:38.000000000 +0200
+++ plugins/ipod/Makefile.am	2006-04-16 12:59:43.931139319 +0200
@@ -0,0 +1,47 @@
+plugindir = $(PLUGINDIR)
+plugin_LTLIBRARIES = libipod.la
+
+libipod_la_SOURCES = \
+	rb-ipod-plugin.c			\
+	$(top_srcdir)/sources/rb-ipod-source.c	\
+	$(top_srcdir)/sources/rb-ipod-source.h
+	
+libipod_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
+libipod_la_LIBADD = 					\
+	$(top_builddir)/lib/librb.la			\
+	$(HAL_LIBS)					\
+	$(IPOD_LIBS)
+
+INCLUDES = 						\
+        -DGNOMELOCALEDIR=\""$(datadir)/locale"\"        \
+	-DG_LOG_DOMAIN=\"Rhythmbox\"		 	\
+	-I$(top_srcdir) 				\
+	-I$(top_srcdir)/lib                        	\
+	-I$(top_srcdir)/metadata                       	\
+	-I$(top_srcdir)/player                       	\
+	-I$(top_srcdir)/rhythmdb                       	\
+	-I$(top_srcdir)/widgets                    	\
+	-I$(top_srcdir)/sources                    	\
+	-I$(top_srcdir)/iradio                    	\
+	-I$(top_srcdir)/podcast                    	\
+	-I$(top_srcdir)/remote				\
+	-I$(top_builddir)/remote			\
+	-I$(top_srcdir)/plugins				\
+	-I$(top_srcdir)/shell				\
+	-DPIXMAP_DIR=\""$(datadir)/pixmaps"\"		\
+	-DSHARE_DIR=\"$(pkgdatadir)\"                   \
+	-DDATADIR=\""$(datadir)"\"			\
+	$(RHYTHMBOX_CFLAGS)				\
+	$(WARN_CFLAGS)					\
+	$(HAL_CFLAGS)					\
+	$(IPOD_CFLAGS)					\
+	-D_XOPEN_SOURCE -D_BSD_SOURCE
+
+plugin_in_files = ipod.rb-plugin.desktop.in
+
+%.rb-plugin: %.rb-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
+
+plugin_DATA = $(plugin_in_files:.rb-plugin.desktop.in=.rb-plugin)
+
+CLEANFILES = $(plugin_DATA)
+DISTCLEANFILES = $(plugin_DATA)
