Index: configure.in
===================================================================
RCS file: /cvs/gnome/nautilus/configure.in,v
retrieving revision 1.656
diff -u -p -r1.656 configure.in
--- configure.in	31 Jan 2006 01:04:25 -0000	1.656
+++ configure.in	24 Feb 2006 22:01:09 -0000
@@ -12,6 +12,8 @@ m4_define(gnome_desktop_minver,        2
 m4_define(gnome_minver,                2.1.1)
 m4_define(gnome_ui_minver,             2.6.0)
 m4_define(gnome_vfs_minver,            2.13.2)
+m4_define(gstreamer_minver,            0.10)
+m4_define(gstreamer_base_minver,       0.10)
 m4_define(orbit_minver,                2.4.0)
 m4_define(pango_minver,                1.1.2)
 m4_define(gtk_minver,                  2.6.0)
@@ -38,7 +40,6 @@ AC_SUBST(ART_REQUIRED, [art_minver])
 AC_SUBST(BONOBO_ACTIVATION_REQUIRED, [bonobo_activation_minver])
 AC_SUBST(BONOBO_REQUIRED, [bonobo_minver])
 AC_SUBST(EEL_REQUIRED, [eel_minver])
-AC_SUBST(ESOUND_REQUIRED, [esound_minver])
 AC_SUBST(GLIB_REQUIRED [glib_minver])
 AC_SUBST(GNOME_DESKTOP_REQUIRED, [gnome_desktop_minver])
 AC_SUBST(GNOME_REQUIRED, [gnome_minver])
@@ -133,6 +134,25 @@ AC_SUBST(ENABLE_PROFILER)
 AM_CONDITIONAL(ENABLE_PROFILER, test "x$ENABLE_PROFILER" = "x1")
 
 dnl ==========================================================================
+dnl Check for gstreamer
+
+AC_ARG_ENABLE(gstreamer, [  --disable-gstreamer     build without GStreamer support])
+msg_gstreamer=no
+if test "x$enable_gstreamer" != "xno"; then
+	PKG_CHECK_MODULES(GSTREAMER,
+			  gstreamer-0.10 >= gstreamer_minver
+			  gstreamer-base-0.10 >= gstreamer_base_minver, [
+		  	  AM_CONDITIONAL(HAVE_GSTREAMER, true)
+			  AC_DEFINE(HAVE_GSTREAMER, 1, [Define to enable GStreamer support])
+			  ]
+                          msg_gstreamer=yes,
+	          	  [AM_CONDITIONAL(HAVE_GSTREAMER, false)])
+        AC_SUBST(GSTREAMER_CFLAGS)
+	AC_SUBST(GSTREAMER_LIBS)
+fi
+
+
+dnl ==========================================================================
 dnl Check for popt
     
 AC_CHECK_LIB(popt, poptGetArg, POPT_LIBS=-lpopt,
@@ -420,6 +440,7 @@ nautilus-$VERSION:
 	compiler:		${CC}
 	tracker support:	$msg_tracker
 	beagle support:		$msg_beagle
+	GStreamer support:	$msg_gstreamer
 
 	profiling support:      ${profiling_support}
 "
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gnome/nautilus/src/Makefile.am,v
retrieving revision 1.163
diff -u -p -r1.163 Makefile.am
--- src/Makefile.am	12 Dec 2005 16:59:11 -0000	1.163
+++ src/Makefile.am	24 Feb 2006 22:01:14 -0000
@@ -14,6 +14,7 @@ INCLUDES =							\
 	-I$(top_srcdir)/cut-n-paste-code			\
 	-I$(top_builddir)/libnautilus-private 			\
 	$(CORE_CFLAGS) 						\
+	$(GSTREAMER_CFLAGS) 					\
 	$(EXIF_CFLAGS)						\
 	-DDATADIR=\""$(datadir)"\" 				\
 	-DLIBDIR=\""$(libdir)"\" 				\
@@ -31,6 +32,7 @@ LDADD =\
 	$(top_builddir)/libnautilus-private/libnautilus-private.la  \
         $(top_builddir)/cut-n-paste-code/gsequence/libgsequence.la \
 	$(CORE_LIBS) \
+	$(GSTREAMER_LIBS) \
 	$(EXIF_LIBS) \
 	$(POPT_LIBS) \
 	$(NULL)
Index: src/nautilus-main.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-main.c,v
retrieving revision 1.151
diff -u -p -r1.151 nautilus-main.c
--- src/nautilus-main.c	15 Dec 2005 14:25:57 -0000	1.151
+++ src/nautilus-main.c	24 Feb 2006 22:01:16 -0000
@@ -58,6 +58,10 @@
 #include <string.h>
 #include <unistd.h>
 
+#ifdef HAVE_GSTREAMER
+ #include <gst/gst.h>
+#endif
+
 /* Keeps track of everyone who wants the main event loop kept active */
 static GSList *event_loop_registrants;
 
@@ -331,6 +335,9 @@ main (int argc, char *argv[])
 				      GNOME_PARAM_POPT_TABLE, options,
 				      GNOME_PARAM_HUMAN_READABLE_NAME, _("Nautilus"),
 				      NULL);
+#ifdef HAVE_GSTREAMER
+	gst_init (&argc, &argv);
+#endif
 
 	/* Do this here so that gdk_display is initialized */
 	if (startup_id_copy == NULL) {
Index: src/file-manager/Makefile.am
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/Makefile.am,v
retrieving revision 1.80
diff -u -p -r1.80 Makefile.am
--- src/file-manager/Makefile.am	25 Nov 2004 14:59:54 -0000	1.80
+++ src/file-manager/Makefile.am	24 Feb 2006 22:01:20 -0000
@@ -6,6 +6,7 @@ INCLUDES = 					\
 	-I$(top_srcdir) 			\
 	-I$(top_srcdir)/cut-n-paste-code	\
 	$(CORE_CFLAGS)				\
+	$(GSTREAMER_CFLAGS)			\
 	-DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \
 	-DDATADIR=\""$(datadir)"\"		\
 	$(DISABLE_DEPRECATED_CFLAGS)            \
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.734
diff -u -p -r1.734 fm-directory-view.c
--- src/file-manager/fm-directory-view.c	26 Jan 2006 22:20:59 -0000	1.734
+++ src/file-manager/fm-directory-view.c	24 Feb 2006 22:01:22 -0000
@@ -39,6 +39,7 @@
 #include <libgnome/gnome-url.h>
 #include <eel/eel-alert-dialog.h>
 #include <eel/eel-background.h>
+#include <eel/eel-debug.h>
 #include <eel/eel-glib-extensions.h>
 #include <eel/eel-gnome-extensions.h>
 #include <eel/eel-gtk-extensions.h>
@@ -75,6 +76,7 @@
 #include <libgnomevfs/gnome-vfs-result.h>
 #include <libgnomevfs/gnome-vfs-uri.h>
 #include <libgnomevfs/gnome-vfs-utils.h>
+#include <libgnomevfs/gnome-vfs-volume-monitor.h>
 #include <libnautilus-private/nautilus-recent.h>
 #include <libnautilus-extension/nautilus-menu-provider.h>
 #include <libnautilus-private/nautilus-clipboard-monitor.h>
@@ -148,6 +150,12 @@
 
 #define MAX_MENU_LEVELS 5
 
+#ifdef HAVE_GSTREAMER
+ #include <gst/gst.h>
+#endif
+
+static int preview_sound_auto_value;
+
 enum {
 	ADD_FILE,
 	BEGIN_FILE_CHANGES,
@@ -385,6 +393,9 @@ static gboolean activate_check_mime_type
 								gboolean warn_on_mismatch);
 static GdkDragAction ask_link_action                           (FMDirectoryView      *view);
 
+static void file_get_volume_and_drive (NautilusFile    *file,
+				       GnomeVFSVolume **volume,
+				       GnomeVFSDrive  **drive);
 
 static void action_open_scripts_folder_callback    (GtkAction *action,
 						    gpointer   callback_data);
@@ -461,8 +472,6 @@ typedef struct {
 	FMDirectoryView *directory_view;
 } CreateTemplateParameters;
 
-
-
 static GList *
 file_and_directory_list_to_files (GList *fad_list)
 {
@@ -9539,7 +9801,90 @@ fm_directory_view_handle_text_drop (FMDi
 	g_free (container_uri);
 }
 
+static gboolean
+should_preview_audio (NautilusFile *file)
+{
+	char *mime_type, *uri;
+	static gboolean setup_sound_preview = FALSE;
+
+	g_assert (NAUTILUS_IS_FILE (file));
+
+	if (!setup_sound_preview) {
+		eel_preferences_add_auto_enum (NAUTILUS_PREFERENCES_PREVIEW_SOUND,
+					       &preview_sound_auto_value);
+
+		setup_sound_preview = TRUE;
+	}
+
+	/* Check user performance preference */	
+	if (preview_sound_auto_value == NAUTILUS_SPEED_TRADEOFF_NEVER) {
+		return FALSE;
+	}
+
+	uri = nautilus_file_get_uri (file);
+	if (uri && eel_istr_has_prefix (uri, "burn:")) {
+		g_free (uri);
+		return FALSE;
+	}
+	g_free (uri);
+
+	/* preview audio files based on the mime type. */
+	mime_type = nautilus_file_get_mime_type (file);
+	if ((eel_istr_has_prefix (mime_type, "audio/")
+	     || eel_istr_has_prefix (mime_type, "application/ogg")
+	     || eel_istr_has_prefix (mime_type, "application/x-ogg"))
+	    && eel_strcasecmp (mime_type, "audio/x-pn-realaudio") != 0
+	    && eel_strcasecmp (mime_type, "audio/x-mpegurl") != 0) {
+		g_free (mime_type);
+		return TRUE;
+	}
+	g_free (mime_type);
+
+	return FALSE;
+}
 
+
+gboolean
+fm_directory_view_preview_audio (FMDirectoryView *view,
+				 NautilusFile *file)
+{
+	g_assert (FM_IS_DIRECTORY_VIEW (view));
+
+#ifdef HAVE_GSTREAMER
+	char *uri;
+	static GstElement *playbin = NULL;
+	GstElement *fakesink;
+
+	if (playbin == NULL) {
+		playbin = gst_element_factory_make ("playbin", "play");
+		if (playbin != NULL) {
+			/* surpress video playback */
+			fakesink = gst_element_factory_make ("fakesink", "sink");
+			g_object_set (G_OBJECT (playbin), "video-sink", fakesink, NULL);
+
+			eel_debug_call_at_shutdown_with_data ((GFreeFunc) g_object_unref, playbin);
+		} else {
+			/* warn user? We depend on gstreamer-base, so this really shouldn't happen */
+			return FALSE;
+		}
+	}
+
+	gst_element_set_state (playbin, GST_STATE_NULL);
+
+	if (file != NULL && should_preview_audio (file)) {
+		uri = nautilus_file_get_uri (file);
+
+		g_object_set (G_OBJECT (playbin), "uri", uri, NULL);
+		gst_element_set_state (playbin, GST_STATE_PLAYING);
+
+		g_free (uri);
+
+		return TRUE;
+	}
+#endif
+
+	return FALSE;
+}
 
 static GArray *
 real_get_selected_icon_locations (FMDirectoryView *view)
Index: src/file-manager/fm-directory-view.h
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.h,v
retrieving revision 1.143
diff -u -p -r1.143 fm-directory-view.h
--- src/file-manager/fm-directory-view.h	12 Dec 2005 16:59:11 -0000	1.143
+++ src/file-manager/fm-directory-view.h	24 Feb 2006 22:01:22 -0000
@@ -429,4 +429,7 @@ void                fm_directory_view_re
 
 gboolean            fm_directory_view_is_editable                     (FMDirectoryView *view);
 
+gboolean            fm_directory_view_preview_audio                   (FMDirectoryView *view,
+								       NautilusFile    *file);
+
 #endif /* FM_DIRECTORY_VIEW_H */
Index: src/file-manager/fm-icon-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-icon-view.c,v
retrieving revision 1.318
diff -u -p -r1.318 fm-icon-view.c
--- src/file-manager/fm-icon-view.c	12 Dec 2005 16:59:11 -0000	1.318
+++ src/file-manager/fm-icon-view.c	24 Feb 2006 22:01:23 -0000
@@ -115,8 +115,6 @@ struct FMIconViewDetails
 	guint icon_merge_id;
 	
 	NautilusAudioPlayerData *audio_player_data;
-	int audio_preview_timeout;
-	NautilusFile *audio_preview_file;
 
 	gboolean filter_by_screen;
 	int num_screens;
@@ -166,12 +164,6 @@ static const SortCriterion sort_criteria
 };
 
 static gboolean default_sort_in_reverse_order = FALSE;
-static int preview_sound_auto_value;
-static gboolean gnome_esd_enabled_auto_value;
-
-#if USE_OLD_AUDIO_PREVIEW
-static pid_t audio_preview_pid = 0;
-#endif
 
 static void                 fm_icon_view_set_directory_sort_by        (FMIconView           *icon_view,
 								       NautilusFile         *file,
@@ -189,9 +181,6 @@ static void                 set_sort_cri
 static gboolean             set_sort_reversed                         (FMIconView           *icon_view,
 								       gboolean              new_value);
 static void                 switch_to_manual_layout                   (FMIconView           *view);
-static void                 preview_audio                             (FMIconView           *icon_view,
-								       NautilusFile         *file,
-								       gboolean              start_flag);
 static void                 update_layout_menus                       (FMIconView           *view);
 
 static void fm_icon_view_iface_init (NautilusViewIface *iface);
@@ -214,7 +203,7 @@ fm_icon_view_destroy (GtkObject *object)
         }
 
 	/* kill any sound preview process that is ongoing */
-	preview_audio (icon_view, NULL, FALSE);
+	fm_directory_view_preview_audio (FM_DIRECTORY_VIEW (icon_view), NULL);
 
 	if (icon_view->details->icons_not_positioned) {
 		nautilus_file_list_free (icon_view->details->icons_not_positioned);
@@ -1064,9 +1053,6 @@ fm_icon_view_begin_loading (FMDirectoryV
 	nautilus_icon_container_set_allow_moves (NAUTILUS_ICON_CONTAINER (icon_container),
 						 fm_directory_view_get_allow_moves (view));
 
-	/* kill any sound preview process that is ongoing */
-	preview_audio (icon_view, NULL, FALSE);
-
 	/* FIXME bugzilla.gnome.org 45060: Should use methods instead
 	 * of hardcoding desktop knowledge in here.
 	 */
@@ -1714,265 +1700,14 @@ band_select_ended_callback (NautilusIcon
 	fm_directory_view_stop_batching_selection_changes (FM_DIRECTORY_VIEW (icon_view));
 }
 
-/* handle the preview signal by inspecting the mime type.  For now, we only preview local sound files. */
-
-/* here's the timer task that actually plays the file using mpg123, ogg123 or play. */
-/* FIXME bugzilla.gnome.org 41258: we should get the application from our mime-type stuff */
-static gboolean
-play_file (gpointer callback_data)
-{
-#if USE_OLD_AUDIO_PREVIEW	
-	NautilusFile *file;
-	FMIconView *icon_view;
-	FILE *sound_process;
-	char *file_uri;
-	char *suffix;
-	char *mime_type;
-	const char *command_str;
-	gboolean is_mp3;
-	gboolean is_ogg;
-	pid_t mp3_pid;
-	
-	GnomeVFSResult result;
-	GnomeVFSHandle *handle;
-	char *buffer;
-	const char *audio_device = NULL;
-	GnomeVFSFileSize bytes_read;
-
-	audio_device = g_getenv ("AUDIODEV");
-	icon_view = FM_ICON_VIEW (callback_data);
-	
-	file = icon_view->details->audio_preview_file;
-	file_uri = nautilus_file_get_uri (file);
-	mime_type = nautilus_file_get_mime_type (file);
-	is_mp3 = eel_strcasecmp (mime_type, "audio/mpeg") == 0;
-	is_ogg = eel_strcasecmp (mime_type, "application/ogg") == 0 ||
-                eel_strcasecmp (mime_type, "application/x-ogg") == 0;
-	
-	mp3_pid = fork ();
-	if (mp3_pid == (pid_t) 0) {
-		/* Set the group (session) id to this process for future killing. */
-		setsid();
-		if (is_mp3) {
-			command_str = "mpg123 -y -q -";
-		} else if (is_ogg) {
-			command_str = "ogg123 -q -";
-		} else {
-			suffix = strrchr(file_uri, '.');
-			if (suffix == NULL) {
-				suffix = "wav";
-			} else {
-				suffix += 1; /* skip the period */
-			}
-			if (audio_device) {
-				command_str = g_strdup_printf("play -d %s -t %s -", audio_device, suffix);
-			} else {
-				command_str = g_strdup_printf("play -t %s -", suffix);
-			}
-		}
-
-		/* read the file with gnome-vfs, feeding it to the sound player's standard input */
-		/* First, open the file. */
-		result = gnome_vfs_open (&handle, file_uri, GNOME_VFS_OPEN_READ);
-		if (result != GNOME_VFS_OK) {
-			_exit (0);
-		}
-			
-		/* since the uri could be local or remote, we launch the sound player with popen and feed it
-		 * the data by fetching it with gnome_vfs
-		 */
-		sound_process = popen(command_str, "w");
-		if (sound_process == 0) {
-			/* Close the file. */
-			result = gnome_vfs_close (handle);			
-			_exit (0);
-		}
-			
-		/* allocate a buffer. */
-		buffer = g_malloc(READ_CHUNK_SIZE);
-			
-		/* read and write a chunk at a time, until we're done */
-		do {
-			result = gnome_vfs_read (handle,
-					buffer,
-					READ_CHUNK_SIZE,
-					&bytes_read);
-			if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) {
-				g_free (buffer);
-				gnome_vfs_close (handle);
-				break;
-			}
-
-			/* pass the data the buffer to the sound process by writing to it */
-			fwrite(buffer, 1, bytes_read, sound_process);
-
-		} while (result == GNOME_VFS_OK);
-
-		/* Close the file. */
-		result = gnome_vfs_close (handle);			
-		g_free(buffer);
-		pclose(sound_process);
-		_exit (0);
-	} else if (mp3_pid > (pid_t) 0) {
-		if (audio_preview_pid > 0) {
-			kill (-audio_preview_pid, SIGTERM);
-			waitpid (audio_preview_pid, NULL, 0);
-		}
-		audio_preview_pid = mp3_pid;
-	}
-		
-	g_free (file_uri);
-	g_free (mime_type);
-
-	icon_view->details->audio_preview_timeout = 0;
-#else
-	char *file_path, *file_uri, *mime_type;
-	gboolean is_mp3;
-	FMIconView *icon_view;
-	
-	icon_view = FM_ICON_VIEW (callback_data);
-		
-	file_uri = nautilus_file_get_uri (icon_view->details->audio_preview_file);
-	file_path = gnome_vfs_get_local_path_from_uri (file_uri);
-	mime_type = nautilus_file_get_mime_type (icon_view->details->audio_preview_file);
-
-	is_mp3 = eel_strcasecmp (mime_type, "audio/mpeg") == 0;
-
-	if (file_path != NULL && !is_mp3) {
-		icon_view->details->audio_player_data = nautilus_audio_player_play (file_path);
-	}
-	
-	g_free (file_uri);
-	g_free (file_path);	
-	g_free (mime_type);
-
-	icon_view->details->audio_preview_timeout = 0;
-	icon_view->details->audio_preview_file = NULL;
-#endif
-	return FALSE;
-}
-
-/* FIXME bugzilla.gnome.org 42530: Hardcoding this here sucks. We should be using components
- * for open ended things like this.
- */
-
-/* this routine is invoked from the preview signal handler to preview a sound file.  We
-   want to wait a suitable delay until we actually do it, so set up a timer task to actually
-   start playing.  If we move out before the task files, we remove it. */
-
-static void
-preview_audio (FMIconView *icon_view, NautilusFile *file, gboolean start_flag)
-{		
-	/* Stop current audio playback */
-#if USE_OLD_AUDIO_PREVIEW
-	if (audio_preview_pid > 0) {
-		kill (-audio_preview_pid, SIGTERM);
-		waitpid (audio_preview_pid, NULL, 0);
-		audio_preview_pid = 0;
-	}
-#else
-	if (icon_view->details->audio_player_data != NULL) {
-		nautilus_audio_player_stop (icon_view->details->audio_player_data);
-		g_free (icon_view->details->audio_player_data);
-		icon_view->details->audio_player_data = NULL;
-	}
-#endif
-	if (icon_view->details->audio_preview_timeout != 0) {
-		g_source_remove (icon_view->details->audio_preview_timeout);
-		icon_view->details->audio_preview_timeout = 0;
-	}
-			
-	if (start_flag) {
-		icon_view->details->audio_preview_file = file;
-#if USE_OLD_AUDIO_PREVIEW			
-		icon_view->details->audio_preview_timeout = g_timeout_add (1000, play_file, icon_view);
-#else
-		/* FIXME: Need to kill the existing timeout if there is one? */
-		icon_view->details->audio_preview_timeout = g_timeout_add (1000, play_file, icon_view);
-#endif
-	}
-}
-
-static gboolean
-should_preview_sound (NautilusFile *file)
-{
-	char *uri;
-
-	/* Check gnome config sound preference */
-	if (!gnome_esd_enabled_auto_value) {
-		return FALSE;
-	}
-
-	uri = nautilus_file_get_uri (file);
-	if (uri && eel_istr_has_prefix (uri, "burn:")) {
-		g_free (uri);
-		return FALSE;
-	}
-	g_free (uri);
-
-	/* Check user performance preference */	
-	if (preview_sound_auto_value == NAUTILUS_SPEED_TRADEOFF_NEVER) {
-		return FALSE;
-	}
-		
-	if (preview_sound_auto_value == NAUTILUS_SPEED_TRADEOFF_ALWAYS) {
-		return TRUE;
-	}
-	
-	return nautilus_file_is_local (file);
-}
-
-static inline gboolean
-can_play_sound (void)
-{
-	int open_result;
-
-#if USE_OLD_AUDIO_PREVIEW			
-	/* first see if there's already one in progress; if so, return true */
-	if (audio_preview_pid > 0) {
-		return TRUE;
-	}
-#endif
-
-	/* Now check and see if system has audio out capabilites */
-        open_result = esd_open_sound (NULL);
-        if (open_result == -1) {
-                return FALSE;
-        }
-
-	esd_close (open_result);
-
-	return TRUE;
-}
-
 static int
 icon_container_preview_callback (NautilusIconContainer *container,
 				 NautilusFile *file,
 				 gboolean start_flag,
 				 FMIconView *icon_view)
 {
-	int result;
-	char *mime_type, *file_name, *message;
-		
-	result = 0;
-	
-	/* preview files based on the mime_type. */
-	/* at first, we just handle sounds */
-	if (should_preview_sound (file)) {
-		mime_type = nautilus_file_get_mime_type (file);
-
-		if ((eel_istr_has_prefix (mime_type, "audio/")
-		     || eel_istr_has_prefix (mime_type, "application/ogg")
-		     || eel_istr_has_prefix (mime_type, "application/x-ogg"))
-		    && eel_strcasecmp (mime_type, "audio/x-pn-realaudio") != 0
-		    && eel_strcasecmp (mime_type, "audio/x-mpegurl") != 0
-		    && can_play_sound ()) {
-			result = 1;
-			preview_audio (icon_view, file, start_flag);
-		}	
-		g_free (mime_type);
-	}
-	
+	char *file_name, *message;
+
 	/* Display file name in status area at low zoom levels, since
 	 * the name is not displayed or hard to read in the icon view.
 	 */
@@ -1989,8 +1724,9 @@ icon_container_preview_callback (Nautilu
 			fm_directory_view_display_selection_info (FM_DIRECTORY_VIEW(icon_view));
 		}
 	}
-	
-	return result;
+
+	return fm_directory_view_preview_audio (FM_DIRECTORY_VIEW (icon_view),
+						start_flag ? file : NULL);
 }
 
 static void
@@ -2671,8 +2407,6 @@ fm_icon_view_iface_init (NautilusViewIfa
 static void
 fm_icon_view_init (FMIconView *icon_view)
 {
-	static gboolean setup_sound_preview = FALSE;
-
         g_return_if_fail (GTK_BIN (icon_view)->child == NULL);
 
 	icon_view->details = g_new0 (FMIconViewDetails, 1);
@@ -2680,17 +2414,6 @@ fm_icon_view_init (FMIconView *icon_view
 	icon_view->details->filter_by_screen = FALSE;
 
 	create_icon_container (icon_view);
-
-	if (!setup_sound_preview) {
-		eel_preferences_add_auto_enum (NAUTILUS_PREFERENCES_PREVIEW_SOUND,
-					       &preview_sound_auto_value);
-
-		eel_preferences_monitor_directory ("/desktop/gnome/sound");
-		eel_preferences_add_auto_boolean ("/desktop/gnome/sound/enable_esd",
-						  &gnome_esd_enabled_auto_value);
-		
-		setup_sound_preview = TRUE;
-	}
 
 	eel_preferences_add_callback_while_alive (NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER,
 						  default_sort_order_changed_callback,
Index: src/file-manager/fm-list-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-list-view.c,v
retrieving revision 1.265
diff -u -p -r1.265 fm-list-view.c
--- src/file-manager/fm-list-view.c	31 Jan 2006 00:23:55 -0000	1.265
+++ src/file-manager/fm-list-view.c	24 Feb 2006 22:01:24 -0000
@@ -430,6 +430,7 @@ motion_notify_callback (GtkWidget *widge
 			gpointer callback_data)
 {
 	FMListView *view;
+	NautilusFile *file;
 	GdkDragContext *context;
 	GdkCursor *cursor;
 	GtkTreePath *last_hover_path;
@@ -469,12 +470,20 @@ motion_notify_callback (GtkWidget *widge
 				}
 			}
 
+			file = NULL;
 			if (view->details->hover_path) {
+				file = fm_list_model_file_for_path (view->details->model,
+								    view->details->hover_path);
+				g_assert (NAUTILUS_IS_FILE (file));
+
 				gtk_tree_model_get_iter (GTK_TREE_MODEL (view->details->model),
 							 &iter, view->details->hover_path);
 				gtk_tree_model_row_changed (GTK_TREE_MODEL (view->details->model),
 							    view->details->hover_path, &iter);
 			}
+
+			fm_directory_view_preview_audio (FM_DIRECTORY_VIEW (view), file);
+			nautilus_file_unref (file);
 		}
 
 		gtk_tree_path_free (last_hover_path);
@@ -2354,6 +2363,8 @@ static void
 fm_list_view_finalize (GObject *object)
 {
 	FMListView *list_view;
+
+	fm_directory_view_preview_audio (FM_DIRECTORY_VIEW (object), NULL);
 
 	list_view = FM_LIST_VIEW (object);
 
