Index: configure.ac
===================================================================
RCS file: /cvs/gnome/rhythmbox/configure.ac,v
retrieving revision 1.201
diff -u -u -r1.201 configure.ac
--- configure.ac	10 Jan 2006 06:24:46 -0000	1.201
+++ configure.ac	15 Jan 2006 06:09:11 -0000
@@ -59,6 +59,32 @@
    AC_MSG_ERROR([totem playlist parsing library not found or too old])
 fi   
 
+AC_ARG_WITH(hal,
+	      AC_HELP_STRING([--without-hal],
+			     [Disable HAL support]))
+if test "x$with_hal" != "xno"; then
+  PKG_CHECK_MODULES(HAL, hal >= 0.5 hal < 0.6, enable_hal05=yes, enable_hal05=no)
+  if test x$enable_hal05 != xyes; then
+     PKG_CHECK_MODULES(HAL, hal >= 0.2.92 hal < 0.5, enable_hal02=yes, enable_hal02=no)
+  fi
+  if test x$enable_hal05 == xyes || test x$enable_hal02 == xyes; then
+      enable_hal=yes
+      if test x$enable_hal05 == xyes; then
+         AC_DEFINE(HAVE_HAL_0_5, 1, [Define if you have HAL 0.5 or later])
+      else
+         AC_DEFINE(HAVE_HAL_0_2, 1, [Define if you have HAL 0.2 or later])
+      fi
+  	  AC_SUBST(HAL_CFLAGS)
+  	  AC_SUBST(HAL_LIBS)
+  else
+    if test "x$with_hal" = "xyes"; then
+	  AC_MSG_ERROR([HAL support explicitly requested but HAL couldn't be found])
+    fi
+  fi
+fi
+
+
+
 dnl iPod support
 
 AC_ARG_WITH(ipod,
@@ -72,29 +98,13 @@
 	  AC_MSG_ERROR([iPod explicitly requested but libgpod couldn't be found])
 	fi
 	if test "x$have_libgpod" = "xyes"; then
-	  PKG_CHECK_MODULES(HAL, hal >= 0.5 hal < 0.6, enable_hal05=yes, enable_hal05=no)
-	  if test x$enable_hal05 != xyes; then
-	     PKG_CHECK_MODULES(HAL, hal >= 0.2.92 hal < 0.5, enable_hal02=yes, enable_hal02=no)
-	  fi
-	  if test x$enable_hal05 == xyes || test x$enable_hal02 == xyes; then
-  	    enable_hal=yes
-	  else
-	    enable_hal=no
-	  fi
           if test "x$with_hal" = xyes && test "x$enable_hal" = xno; then
 	     AC_MSG_ERROR([iPod explicitly requested but HAL not found or too old])	   
 	  fi
           if test "x$enable_hal" = xyes; then
 	     AC_DEFINE(WITH_IPOD_SUPPORT, 1, [Define if iPod support is enabled])
 	     use_ipod=yes
-	     if test x$enable_hal05 == xyes; then
-	        AC_DEFINE(HAVE_HAL_0_5, 1, [Define if you have HAL 0.5 or later])
-	     else
-	        AC_DEFINE(HAVE_HAL_0_2, 1, [Define if you have HAL 0.2 or later])
-	     fi
 	  fi
-	  AC_SUBST(HAL_CFLAGS)
-	  AC_SUBST(HAL_LIBS)
 	  AC_SUBST(IPOD_CFLAGS)
 	  AC_SUBST(IPOD_LIBS)
 	fi
@@ -737,6 +747,11 @@
 	AC_MSG_NOTICE([** Bonobo control/activation enabled])
 else
 	AC_MSG_NOTICE([   Bonobo control/activation disabled])
+fi
+if test x"$enable_hal" = xyes; then
+	AC_MSG_NOTICE([** HAL support enabled])
+else
+	AC_MSG_NOTICE([   HAL support disabled])
 fi
 if test x"$enable_dbus" = xyes; then
 	AC_MSG_NOTICE([** D-BUS control/activation enabled])
Index: lib/rb-file-helpers.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/lib/rb-file-helpers.c,v
retrieving revision 1.39
diff -u -u -r1.39 rb-file-helpers.c
--- lib/rb-file-helpers.c	11 Oct 2005 09:24:37 -0000	1.39
+++ lib/rb-file-helpers.c	15 Jan 2006 06:09:13 -0000
@@ -604,6 +604,22 @@
 	return ret;
 }
 
+gboolean
+rb_uri_is_local (const char *text_uri)
+{
+	gboolean ret = FALSE;
+	GnomeVFSURI *uri;
+
+	uri = gnome_vfs_uri_new (text_uri);
+	if (uri == NULL)
+		return FALSE;
+
+	ret = gnome_vfs_uri_is_local (uri);
+	gnome_vfs_uri_unref (uri);
+
+	return ret;
+}
+
 void
 rb_uri_handle_recursively (const char *text_uri,
 		           GFunc func,
Index: lib/rb-file-helpers.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/lib/rb-file-helpers.h,v
retrieving revision 1.19
diff -u -u -r1.19 rb-file-helpers.h
--- lib/rb-file-helpers.h	11 Oct 2005 09:24:37 -0000	1.19
+++ lib/rb-file-helpers.h	15 Jan 2006 06:09:13 -0000
@@ -41,6 +41,7 @@
 char *		rb_uri_resolve_relative	(const char *uri);
 gboolean	rb_uri_is_readable	(const char *uri);
 gboolean	rb_uri_is_writable	(const char *uri);
+gboolean	rb_uri_is_local		(const char *uri);
 
 void		rb_uri_handle_recursively(const char *uri,
 					  GFunc func,
Index: rhythmdb/rhythmdb.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/rhythmdb/rhythmdb.c,v
retrieving revision 1.156
diff -u -u -r1.156 rhythmdb.c
--- rhythmdb/rhythmdb.c	13 Jan 2006 12:20:00 -0000	1.156
+++ rhythmdb/rhythmdb.c	15 Jan 2006 06:09:15 -0000
@@ -133,6 +133,7 @@
 {
 	RhythmDB *db;
 	char *uri;
+	RhythmDBEntryType type;
 } RhythmDBAddThreadData;
 
 typedef struct
@@ -143,6 +144,7 @@
 		RHYTHMDB_ACTION_SYNC
 	} type;
 	char *uri;
+ 	RhythmDBEntryType entry_type;
 } RhythmDBAction;
 
 typedef struct
@@ -160,6 +162,7 @@
 	} type;
 	char *uri;
 	char *real_uri; /* Target of a symlink, if any */
+	RhythmDBEntryType entry_type;
 
 	GError *error;
 	RhythmDB *db;
@@ -196,7 +199,7 @@
 static gpointer add_thread_main (RhythmDBAddThreadData *data);
 static gpointer action_thread_main (RhythmDB *db);
 static gpointer query_thread_main (RhythmDBQueryThreadData *data);
-static void queue_stat_uri (const char *uri, RhythmDB *db);
+static void queue_stat_uri (const char *uri, RhythmDB *db, RhythmDBEntryType type);
 static void rhythmdb_entry_set_internal (RhythmDB *db, RhythmDBEntry *entry, gboolean notify_if_inserted, guint propid, const GValue *value);
 static void rhythmdb_entry_set_mount_point (RhythmDB *db, 
  					    RhythmDBEntry *entry, 
@@ -839,7 +842,7 @@
 			const gchar *uri;
 			uri = rhythmdb_entry_get_string (entry, 
 							 RHYTHMDB_PROP_LOCATION);
-			queue_stat_uri (uri, db);
+			queue_stat_uri (uri, db, -1);
 		}
 		g_assert (entry->inserted == FALSE);
 		entry->inserted = TRUE;
@@ -1389,6 +1392,10 @@
 	entry = rhythmdb_entry_lookup_by_location (db, event->real_uri);
 	if (entry) {
 		time_t mtime = (time_t) entry->mtime;
+
+		if ((event->entry_type != -1) && (entry->type != event->entry_type))
+			g_warning ("attempt to use same location in multiple entry types");
+
 		if (event->error) {
 			if (!is_ghost_entry (entry)) {
 				rhythmdb_entry_set_visibility (db, entry, FALSE);
@@ -1455,6 +1462,7 @@
 		action = g_new0 (RhythmDBAction, 1);
 		action->type = RHYTHMDB_ACTION_LOAD;
 		action->uri = g_strdup (event->real_uri);
+		action->entry_type = event->entry_type;
 		rb_debug ("queuing a RHYTHMDB_ACTION_LOAD: %s", action->uri);
 		g_async_queue_push (db->priv->action_queue, action);
 	}
@@ -1519,8 +1527,9 @@
 
 	entry = rhythmdb_entry_lookup_by_location (db, event->real_uri);
 	if (!entry) {
-
-		entry = rhythmdb_entry_new (db, RHYTHMDB_ENTRY_TYPE_SONG, event->real_uri);
+		if (event->entry_type == -1)
+			event->entry_type = RHYTHMDB_ENTRY_TYPE_SONG;
+		entry = rhythmdb_entry_new (db, event->entry_type, event->real_uri);
 		if (entry == NULL) {
 			rb_debug ("entry already exists");
 			return TRUE;
@@ -1546,6 +1555,9 @@
 		g_value_unset (&value);
 	}
 
+	if ((event->entry_type != -1) && (entry->type != event->entry_type))
+		g_warning ("attempt to use same location in multiple entry types");
+
 	set_props_from_metadata (db, entry, event->vfsinfo, event->metadata);
 
 	/* we've seen this entry */
@@ -1594,6 +1606,7 @@
 	action = g_new0 (RhythmDBAction, 1);
 	action->type = RHYTHMDB_ACTION_LOAD;
 	action->uri = g_strdup (event->uri);
+	action->entry_type = -1;
 	g_async_queue_push (db->priv->action_queue, action);
 }
 
@@ -1750,7 +1763,7 @@
 }
 
 static void
-queue_stat_uri (const char *uri, RhythmDB *db)
+queue_stat_uri (const char *uri, RhythmDB *db, RhythmDBEntryType type)
 {
 	RhythmDBAction *action;
 
@@ -1760,16 +1773,24 @@
 	action = g_new0 (RhythmDBAction, 1);
 	action->type = RHYTHMDB_ACTION_STAT;
 	action->uri = g_strdup (uri);
+	action->entry_type = type;
 	g_async_queue_push (db->priv->action_queue, action);
 }
 
+static void
+queue_stat_uri_tad (const char *uri, RhythmDBAddThreadData *data)
+{
+	queue_stat_uri (uri, data->db, data->type);
+}
+
+
 static gpointer
 add_thread_main (RhythmDBAddThreadData *data)
 {
 	RhythmDBEvent *result;
 
-	rb_uri_handle_recursively (data->uri, (GFunc) queue_stat_uri,
-				   &data->db->priv->exiting, data->db);
+	rb_uri_handle_recursively (data->uri, (GFunc) queue_stat_uri_tad,
+				   &data->db->priv->exiting, data);
 
 	rb_debug ("exiting");
 	result = g_new0 (RhythmDBEvent, 1);
@@ -1959,6 +1980,7 @@
 			result = g_new0 (RhythmDBEvent, 1);
 			result->db = db;
 			result->type = RHYTHMDB_EVENT_STAT;
+			result->entry_type = action->entry_type;
 
 			rb_debug ("executing RHYTHMDB_ACTION_STAT for \"%s\"", action->uri);
 
@@ -1970,6 +1992,7 @@
 			result = g_new0 (RhythmDBEvent, 1);
 			result->db = db;
 			result->type = RHYTHMDB_EVENT_METADATA_LOAD;
+			result->entry_type = action->entry_type;
 
 			rb_debug ("executing RHYTHMDB_ACTION_LOAD for \"%s\"", action->uri);
 
@@ -2051,16 +2074,23 @@
 void
 rhythmdb_add_uri (RhythmDB *db, const char *uri)
 {
+	rhythmdb_add_uri_with_type (db, uri, RHYTHMDB_ENTRY_TYPE_SONG);
+}
+
+void
+rhythmdb_add_uri_with_type (RhythmDB *db, const char *uri, RhythmDBEntryType type)
+{
 	char  *realuri = rb_uri_resolve_symlink (uri);
 
 	if (rb_uri_is_directory (realuri)) {
 		RhythmDBAddThreadData *data = g_new0 (RhythmDBAddThreadData, 1);
 		data->db = db;
 		data->uri = realuri;
+		data->type = type;
 
 		rhythmdb_thread_create (db, (GThreadFunc) add_thread_main, data);
 	} else {
-		queue_stat_uri (realuri, db);
+		queue_stat_uri (realuri, db, type);
 		g_free (realuri);
 	}
 }
Index: rhythmdb/rhythmdb.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/rhythmdb/rhythmdb.h,v
retrieving revision 1.64
diff -u -u -r1.64 rhythmdb.h
--- rhythmdb/rhythmdb.h	6 Jan 2006 05:55:09 -0000	1.64
+++ rhythmdb/rhythmdb.h	15 Jan 2006 06:09:15 -0000
@@ -479,6 +479,7 @@
 RhythmDBEntry *	rhythmdb_entry_new	(RhythmDB *db, RhythmDBEntryType type, const char *uri);
 
 void		rhythmdb_add_uri	(RhythmDB *db, const char *uri);
+void		rhythmdb_add_uri_with_type	(RhythmDB *db, const char *uri, RhythmDBEntryType type);
 
 void		rhythmdb_entry_set	(RhythmDB *db, RhythmDBEntry *entry,
 					 guint propid, const GValue *value);
Index: shell/rb-removable-media-manager.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-removable-media-manager.c,v
retrieving revision 1.11
diff -u -u -r1.11 rb-removable-media-manager.c
--- shell/rb-removable-media-manager.c	15 Jan 2006 01:25:08 -0000	1.11
+++ shell/rb-removable-media-manager.c	15 Jan 2006 06:09:16 -0000
@@ -30,6 +30,7 @@
 #include "rb-removable-media-manager.h"
 #include "rb-sourcelist.h"
 #include "rb-removable-media-source.h"
+#include "rb-generic-player-source.h"
 #include "rb-audiocd-source.h"
 #ifdef WITH_IPOD_SUPPORT
 #include "rb-ipod-source.h"
@@ -433,6 +434,9 @@
 	if (g_hash_table_lookup (priv->volume_mapping, volume) != NULL)
 		return;
 
+	if (!gnome_vfs_volume_is_mounted (volume))
+		return;
+
 	/* ignore network volumes */
 	device_type = gnome_vfs_volume_get_device_type (volume);
 	if (device_type == GNOME_VFS_DEVICE_TYPE_NFS ||
@@ -468,6 +472,8 @@
 	if (source == NULL && rb_ipod_is_volume_ipod (volume))
 		source = rb_ipod_source_new (shell, volume);
 #endif
+	if (source == NULL && rb_generic_player_is_volume_player (volume))
+		source = rb_generic_player_source_new (shell, volume);
 
 	if (source) {
 		g_hash_table_insert (priv->volume_mapping, volume, source);
Index: sources/Makefile.am
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/Makefile.am,v
retrieving revision 1.30
diff -u -u -r1.30 Makefile.am
--- sources/Makefile.am	10 Dec 2005 12:08:25 -0000	1.30
+++ sources/Makefile.am	15 Jan 2006 06:09:16 -0000
@@ -27,6 +27,8 @@
 	rb-auto-playlist-source.h	\
 	rb-static-playlist-source.c	\
 	rb-static-playlist-source.h	\
+	rb-generic-player-source.c	\
+	rb-geberic-player-source.h	\
 	rb-play-queue-source.c		\
 	rb-play-queue-source.h
 
Index: sources/rb-audiocd-source.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-audiocd-source.c,v
retrieving revision 1.17
diff -u -u -r1.17 rb-audiocd-source.c
--- sources/rb-audiocd-source.c	13 Jan 2006 12:20:01 -0000	1.17
+++ sources/rb-audiocd-source.c	15 Jan 2006 06:09:16 -0000
@@ -146,19 +146,17 @@
 RBRemovableMediaSource *
 rb_audiocd_source_new (RBShell *shell, GnomeVFSVolume *volume)
 {
-	char *display_name, *device_path;
+	char *device_path;
 	GObject *source;
 	RhythmDBEntryType entry_type;
 
 	g_assert (rb_audiocd_is_volume_audiocd (volume));
 
-	display_name = gnome_vfs_volume_get_display_name (volume);
-	device_path = gnome_vfs_volume_get_device_path (volume);
-
 	entry_type =  rhythmdb_entry_register_type ();
 
+	device_path = gnome_vfs_volume_get_device_path (volume);
+
 	source = g_object_new (RB_TYPE_AUDIOCD_SOURCE,
-			       "name", display_name,
 			       "entry-type", entry_type,
 			       "volume", volume,
 			       "shell", shell,
@@ -166,7 +164,6 @@
 			       NULL);
 
 	g_free (device_path);
-	g_free (display_name);
 
 	rb_shell_register_entry_type_for_source (shell, RB_SOURCE (source), entry_type);
 
Index: sources/rb-ipod-source.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-ipod-source.c,v
retrieving revision 1.31
diff -u -u -r1.31 rb-ipod-source.c
--- sources/rb-ipod-source.c	13 Jan 2006 12:20:01 -0000	1.31
+++ sources/rb-ipod-source.c	15 Jan 2006 06:09:16 -0000
@@ -137,7 +137,6 @@
 	entry_type =  rhythmdb_entry_register_type ();
 
 	source = RB_IPOD_SOURCE (g_object_new (RB_TYPE_IPOD_SOURCE,
-					  "name", _("iPod"),
 					  "entry-type", entry_type,
 					  "volume", volume,
 					  "shell", shell,
@@ -486,41 +485,51 @@
 
 	result = FALSE;
 	dbus_error_init (&error);
+	
 	conn = NULL;
 	ctx = libhal_ctx_new ();
 	if (ctx == NULL) {
 		/* FIXME: should we return an error somehow so that we can 
 		 * fall back to a check for iTunesDB presence instead ?
 		 */
-		g_print ("Error: %s\n", error.message);
+		rb_debug ("cannot connect to HAL");
 		goto end;
 	}
 	conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
-	if (conn == NULL) {
-		g_print ("Error: %s\n", error.message);
+	if (conn == NULL || dbus_error_is_set (&error))
 		goto end;
-	}
+
 	libhal_ctx_set_dbus_connection (ctx, conn);
-	if (!libhal_ctx_init (ctx, &error)) {
-		g_print ("Error: %s\n", error.message);
+	if (!libhal_ctx_init (ctx, &error) || dbus_error_is_set (&error))
 		goto end;
-	}
 
 	parent_udi = libhal_device_get_property_string (ctx, udi,
 			"info.parent", &error);
+	if (parent_udi == NULL || dbus_error_is_set (&error))
+		goto end;
+		
 	parent_name = libhal_device_get_property_string (ctx, parent_udi,
 			"storage.model", &error);
 	g_free (parent_udi);
-	if (parent_name != NULL && strcmp (parent_name, "iPod") == 0) {
+	if (parent_name == NULL || dbus_error_is_set (&error))
+		goto end;
+
+	if (strcmp (parent_name, "iPod") == 0)
 		result = TRUE;
-	}
 
 	g_free (parent_name);
 end:
+	if (dbus_error_is_set (&error)) {
+		rb_debug ("Error: %s\n", error.message);
+		dbus_error_free (&error);
+		dbus_error_init (&error);
+	}
+
 	if (ctx) {
 		libhal_ctx_shutdown (ctx, &error);
 		libhal_ctx_free(ctx);
 	}
+
 	dbus_error_free (&error);
 
 	return result;
Index: sources/rb-removable-media-source.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-removable-media-source.c,v
retrieving revision 1.7
diff -u -u -r1.7 rb-removable-media-source.c
--- sources/rb-removable-media-source.c	30 Nov 2005 22:18:28 -0000	1.7
+++ sources/rb-removable-media-source.c	15 Jan 2006 06:09:16 -0000
@@ -37,6 +37,9 @@
 #include "rb-dialog.h"
 #include "rb-util.h"
 
+static GObject *rb_removable_media_source_constructor (GType type,
+						       guint n_construct_properties,
+						       GObjectConstructParam *construct_properties);
 static void rb_removable_media_source_dispose (GObject *object);
 
 static void rb_removable_media_source_set_property (GObject *object,
@@ -75,6 +78,7 @@
 	RBSourceClass *source_class = RB_SOURCE_CLASS (klass);
 	RBLibrarySourceClass *library_source_class = RB_LIBRARY_SOURCE_CLASS (klass);
 
+	object_class->constructor = rb_removable_media_source_constructor;
 	object_class->dispose = rb_removable_media_source_dispose;
 	object_class->set_property = rb_removable_media_source_set_property;
 	object_class->get_property = rb_removable_media_source_get_property;
@@ -111,6 +115,29 @@
 {
 
 }
+
+static GObject *
+rb_removable_media_source_constructor (GType type, guint n_construct_properties,
+				       GObjectConstructParam *construct_properties)
+{
+	GObject *source; 
+	GnomeVFSVolume *volume;
+	char *display_name;
+
+	source = G_OBJECT_CLASS(rb_removable_media_source_parent_class)
+			->constructor (type, n_construct_properties, construct_properties);
+
+	g_object_get (source, "volume", &volume, NULL);
+	
+	display_name = gnome_vfs_volume_get_display_name (volume);
+	g_object_set (source, "name", display_name, NULL);
+	g_free (display_name);
+
+	g_object_unref (volume);
+
+	return source;
+}
+
 
 static void 
 rb_removable_media_source_dispose (GObject *object)
