Only in nautilus-2.2.3.gst/components/emblem: Nautilus_View_emblem.server
Only in nautilus-2.2.3.gst/components/emblem: Nautilus_View_emblem.server.in
Only in nautilus-2.2.3: configure
diff -ur nautilus-2.2.3/configure.in nautilus-2.2.3.gst/configure.in
--- nautilus-2.2.3/configure.in	2003-03-31 15:52:26.000000000 +0200
+++ nautilus-2.2.3.gst/configure.in	2003-04-21 13:48:37.000000000 +0200
@@ -19,6 +19,8 @@
 MEDUSA_REQUIRED=0.5.1
 RSVG_REQUIRED=2.0.1
 XML_REQUIRED=2.4.7
+GSTREAMER_REQUIRED=0.6
+GSTREAMER_GCONF_REQUIRED=0.6
 
 AC_SUBST(ART_REQUIRED)
 AC_SUBST(BONOBO_ACTIVATION_REQUIRED)
@@ -37,6 +39,8 @@
 AC_SUBST(MEDUSA_REQUIRED)
 AC_SUBST(RSVG_REQUIRED)
 AC_SUBST(XML_REQUIRED)
+AC_SUBST(GSTREAMER_REQUIRED)
+AC_SUBST(GSTREAMER_GCONF_REQUIRED)
 
 dnl ===========================================================================
 
@@ -73,7 +77,9 @@
 	libgnome-2.0 >= $GNOME_REQUIRED \
 	libgnomeui-2.0 >= $GNOME_UI_REQUIRED \
 	librsvg-2.0 >= $RSVG_REQUIRED \
-	libxml-2.0 >= $XML_REQUIRED)
+	libxml-2.0 >= $XML_REQUIRED \
+	gstreamer-0.6 >= $GSTREAMER_REQUIRED \
+	gstreamer-gconf-0.6 >= $GSTREAMER_GCONF_REQUIRED)
 dnl ==========================================================================
 
 ALL_LINGUAS="am ar az be bg ca cs da de el en_GB es et eu fa fi fr ga gl he hi hu it ja ko lt lv mk ml mn ms nl nn no pl pt pt_BR ro ru sk sl sq sv ta th tr uk vi wa yi zh_CN zh_TW"
@@ -281,7 +287,7 @@
 AC_SUBST(LIBNAUTILUS_IDL_INCLUDES)
 
 dnl core nautilus (must list bonobo-activation and libbonobo because idldir does not respect "requires")
-CORE_MODULES="eel-2.0 librsvg-2.0 bonobo-activation-2.0 libbonobo-2.0 libbonoboui-2.0 esound gnome-desktop-2.0 $EXTRA_CORE_MODULES"
+CORE_MODULES="eel-2.0 librsvg-2.0 bonobo-activation-2.0 libbonobo-2.0 libbonoboui-2.0 esound gnome-desktop-2.0 gstreamer-0.6 gstreamer-gconf-0.6 $EXTRA_CORE_MODULES"
 CORE_CFLAGS="`$PKG_CONFIG --cflags $CORE_MODULES` $x_cflags"
 AC_SUBST(CORE_CFLAGS)
 CORE_LIBS="`$PKG_CONFIG --libs $CORE_MODULES` $CDDA_LIBS $LIBJPEG $x_libs"
Only in nautilus-2.2.3.gst/: intltool-extract
Only in nautilus-2.2.3.gst/: intltool-merge
Only in nautilus-2.2.3.gst/: intltool-update
Only in nautilus-2.2.3: nautilus.spec
Only in nautilus-2.2.3/po: am.gmo
Only in nautilus-2.2.3/po: ar.gmo
Only in nautilus-2.2.3/po: az.gmo
Only in nautilus-2.2.3/po: be.gmo
Only in nautilus-2.2.3/po: bg.gmo
Only in nautilus-2.2.3/po: ca.gmo
Only in nautilus-2.2.3/po: cs.gmo
Only in nautilus-2.2.3/po: da.gmo
Only in nautilus-2.2.3/po: de.gmo
Only in nautilus-2.2.3/po: el.gmo
Only in nautilus-2.2.3/po: en_GB.gmo
Only in nautilus-2.2.3/po: es.gmo
Only in nautilus-2.2.3/po: et.gmo
Only in nautilus-2.2.3/po: eu.gmo
Only in nautilus-2.2.3/po: fa.gmo
Only in nautilus-2.2.3/po: fi.gmo
Only in nautilus-2.2.3/po: fr.gmo
Only in nautilus-2.2.3/po: ga.gmo
Only in nautilus-2.2.3/po: gl.gmo
Only in nautilus-2.2.3/po: he.gmo
Only in nautilus-2.2.3/po: hi.gmo
Only in nautilus-2.2.3/po: hu.gmo
Only in nautilus-2.2.3/po: it.gmo
Only in nautilus-2.2.3/po: ja.gmo
Only in nautilus-2.2.3/po: ko.gmo
Only in nautilus-2.2.3/po: lt.gmo
Only in nautilus-2.2.3/po: lv.gmo
Only in nautilus-2.2.3/po: mk.gmo
Only in nautilus-2.2.3/po: ml.gmo
Only in nautilus-2.2.3/po: mn.gmo
Only in nautilus-2.2.3/po: ms.gmo
Only in nautilus-2.2.3/po: nl.gmo
Only in nautilus-2.2.3/po: nn.gmo
Only in nautilus-2.2.3/po: no.gmo
Only in nautilus-2.2.3/po: pl.gmo
Only in nautilus-2.2.3/po: pt.gmo
Only in nautilus-2.2.3/po: pt_BR.gmo
Only in nautilus-2.2.3/po: ro.gmo
Only in nautilus-2.2.3/po: ru.gmo
Only in nautilus-2.2.3/po: sk.gmo
Only in nautilus-2.2.3/po: sl.gmo
Only in nautilus-2.2.3/po: sq.gmo
Only in nautilus-2.2.3/po: sv.gmo
Only in nautilus-2.2.3/po: ta.gmo
Only in nautilus-2.2.3/po: th.gmo
Only in nautilus-2.2.3/po: tr.gmo
Only in nautilus-2.2.3/po: uk.gmo
Only in nautilus-2.2.3/po: vi.gmo
Only in nautilus-2.2.3/po: wa.gmo
Only in nautilus-2.2.3/po: yi.gmo
Only in nautilus-2.2.3/po: zh_CN.gmo
Only in nautilus-2.2.3/po: zh_TW.gmo
diff -ur nautilus-2.2.3/src/file-manager/fm-icon-view.c nautilus-2.2.3.gst/src/file-manager/fm-icon-view.c
--- nautilus-2.2.3/src/file-manager/fm-icon-view.c	2003-03-28 10:09:20.000000000 +0100
+++ nautilus-2.2.3.gst/src/file-manager/fm-icon-view.c	2003-04-21 14:27:06.000000000 +0200
@@ -77,8 +77,10 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <unistd.h>
+#include <gst/gst.h>
+#include <gst/gconf/gconf.h>
 
-#define USE_OLD_AUDIO_PREVIEW 1
+#define USE_GST_AUDIO_PREVIEW 1
 #define READ_CHUNK_SIZE 16384
 
 /* Paths to use when creating & referring to Bonobo menu items */
@@ -142,7 +144,6 @@
 	int num_screens;
 };
 
-
 /* Note that the first item in this list is the default sort,
  * and that the items show up in the menu in the order they
  * appear in this list.
@@ -188,6 +189,7 @@
 static gboolean default_sort_in_reverse_order = FALSE;
 static int preview_sound_auto_value;
 static gboolean gnome_esd_enabled_auto_value;
+static GstElement *thread;
 
 static void                 fm_icon_view_set_directory_sort_by                 (FMIconView           *icon_view,
 										NautilusFile         *file,
@@ -1575,6 +1577,25 @@
 	fm_directory_view_stop_batching_selection_changes (FM_DIRECTORY_VIEW (icon_view));
 }
 
+
+
+#if USE_GST_AUDIO_PREVIEW
+static void
+gst_end_of_stream_callback (GstElement *src, gpointer callback_data) 
+{
+	FMIconView *icon_view;
+
+	icon_view = FM_ICON_VIEW (callback_data);
+
+	gst_element_set_state (GST_ELEMENT (thread), GST_STATE_NULL);
+
+	if (icon_view->details->audio_preview_timeout != 0) {
+		g_source_remove (icon_view->details->audio_preview_timeout);
+		icon_view->details->audio_preview_timeout = 0;
+	}
+}
+#endif
+
 /* 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. */
@@ -1582,97 +1603,37 @@
 static gboolean
 play_file (gpointer callback_data)
 {
-#if USE_OLD_AUDIO_PREVIEW	
-	NautilusFile *file;
+#if USE_GST_AUDIO_PREVIEW	
+	gchar *file_uri;
+	GstElement *filesrc, *decoder, *audiosink;
+
 	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;
-	GnomeVFSFileSize bytes_read;
 
 	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/x-mp3") == 0;
-	is_ogg = 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 */
-			}
-			command_str = g_strdup_printf("play -t %s -", suffix);
-		}
-			
-		/* 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) {
-			return FALSE;
-		}
-			
-		/* 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) {
-			return FALSE;
-		}
+	file_uri = nautilus_file_get_uri (icon_view->details->audio_preview_file);
 
-		/* 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;
-			}
+	if (file_uri != NULL && gst_init_check (NULL, NULL)) { 
+		thread = gst_thread_new ("thread");
 
-			/* pass the data the buffer to the sound process by writing to it */
-			fwrite(buffer, 1, bytes_read, sound_process);
+		filesrc = gst_element_factory_make ("gnomevfssrc", "disk_source");
+		decoder = gst_element_factory_make ("spider", "spider");
+		audiosink = gst_gconf_get_default_audio_sink (); 
 
-		} while (result == GNOME_VFS_OK);
+		g_object_set (G_OBJECT (filesrc), "location", file_uri, NULL);
 
-		/* Close the file. */
-		result = gnome_vfs_close (handle);			
-		g_free(buffer);
-		pclose(sound_process);
-		_exit (0);
-	} else {
-		nautilus_sound_register_sound (mp3_pid);
+		g_signal_connect (G_OBJECT (filesrc), "eos", G_CALLBACK (gst_end_of_stream_callback), icon_view);
+
+		gst_bin_add_many (GST_BIN (thread), filesrc, decoder, audiosink, NULL);
+		gst_element_link_many (filesrc, decoder, audiosink, NULL);
+
+		gst_element_set_state (GST_ELEMENT (thread), GST_STATE_PLAYING);
 	}
-		
+
 	g_free (file_uri);
-	g_free (mime_type);
 
 	icon_view->details->audio_preview_timeout = 0;
+	icon_view->details->audio_preview_file = NULL;
 #else
 	char *file_path, *file_uri, *mime_type;
 	gboolean is_mp3;
@@ -1712,8 +1673,10 @@
 preview_audio (FMIconView *icon_view, NautilusFile *file, gboolean start_flag)
 {		
 	/* Stop current audio playback */
-#if USE_OLD_AUDIO_PREVIEW
-	nautilus_sound_kill_sound ();
+#if USE_GST_AUDIO_PREVIEW
+	if (thread != NULL) {
+		gst_element_set_state (GST_ELEMENT (thread), GST_STATE_NULL);
+	}
 #else
 	if (icon_view->details->audio_player_data != NULL) {
 		nautilus_audio_player_stop (icon_view->details->audio_player_data);
@@ -1728,7 +1691,7 @@
 			
 	if (start_flag) {
 		icon_view->details->audio_preview_file = file;
-#if USE_OLD_AUDIO_PREVIEW			
+#if USE_GST_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? */
