? po/stamp-it
Index: libmuine/metadata.c
===================================================================
RCS file: /cvs/gnome/muine/libmuine/metadata.c,v
retrieving revision 1.22
diff -u -p -r1.22 metadata.c
--- libmuine/metadata.c	29 Jan 2006 07:12:57 -0000	1.22
+++ libmuine/metadata.c	15 Aug 2006 11:38:29 -0000
@@ -340,7 +340,7 @@ get_mp3_comment_value (struct id3_tag *t
 }
 
 static Metadata *
-assign_metadata_mp3 (const char *filename,
+assign_metadata_mp3 (const char *uri,
 		     GnomeVFSFileInfo *info,
 		     char **error_message_return)
 {
@@ -352,7 +352,7 @@ assign_metadata_mp3 (const char *filenam
 	char *track_number_raw;
 	char *disc_number_raw;
 
-	file = id3_vfs_open (filename, ID3_FILE_MODE_READONLY);
+	file = id3_vfs_open (uri, ID3_FILE_MODE_READONLY);
 	if (file == NULL) {
 		*error_message_return = g_strdup ("Failed to open file for reading");
 		return NULL;
@@ -456,7 +456,7 @@ mp4_seek_callback (void *user_data, uint
 }
 
 static Metadata *
-assign_metadata_mp4 (const char *filename,
+assign_metadata_mp4 (const char *uri,
 		     char **error_message_return)
 {
 	Metadata *m = NULL;
@@ -472,7 +472,7 @@ assign_metadata_mp4 (const char *filenam
 	long samples;
 	float f = 1024.0;
 
-	if (gnome_vfs_open (&fh, filename, GNOME_VFS_OPEN_READ) != GNOME_VFS_OK) {
+	if (gnome_vfs_open (&fh, uri, GNOME_VFS_OPEN_READ) != GNOME_VFS_OK) {
                 *error_message_return = g_strdup ("Failed to open file for reading");
                 return NULL;
         }
@@ -670,7 +670,7 @@ assign_metadata_vorbiscomment (Metadata 
 }
 
 static Metadata *
-assign_metadata_ogg (const char *filename,
+assign_metadata_ogg (const char *uri,
 		     char **error_message_return)
 {
 	Metadata *metadata = NULL;
@@ -680,7 +680,7 @@ assign_metadata_ogg (const char *filenam
 	OggVorbis_File vf;
 	vorbis_comment *comment;
 
-	res = gnome_vfs_open (&handle, filename, GNOME_VFS_OPEN_READ);
+	res = gnome_vfs_open (&handle, uri, GNOME_VFS_OPEN_READ);
 	if (res != GNOME_VFS_OK) {
 		*error_message_return = g_strdup ("Failed to open file for reading");
 		return NULL;
@@ -790,7 +790,7 @@ FLAC_error_callback (const FLAC__StreamD
 }
 
 static Metadata *
-assign_metadata_flac (const char *filename,
+assign_metadata_flac (const char *uri,
 		      char **error_message_return)
 {
 	Metadata *metadata = NULL;
@@ -800,7 +800,7 @@ assign_metadata_flac (const char *filena
 	FLAC__StreamDecoder *flac_decoder;
 	CallbackData *callback_data;
 
-	res = gnome_vfs_open (&handle, filename, GNOME_VFS_OPEN_READ);
+	res = gnome_vfs_open (&handle, uri, GNOME_VFS_OPEN_READ);
 	if (res != GNOME_VFS_OK) {
 		*error_message_return = g_strdup ("Failed to open file for reading");
 		return NULL;
@@ -861,33 +861,37 @@ metadata_load (const char *filename,
 {
 	Metadata *m = NULL;
 	GnomeVFSFileInfo *info;
-	char *escaped;
+	char *uri;
 
 	g_return_val_if_fail (filename != NULL, NULL);
 
-	escaped = gnome_vfs_escape_path_string (filename);
+	uri = gnome_vfs_get_uri_from_local_path (filename);
+	if (uri == NULL) {
+		*error_message_return = g_strdup ("Failed to convert filename to URI.");
+		return NULL;
+	}
 
 	info = gnome_vfs_file_info_new ();
-	gnome_vfs_get_file_info (escaped, info,
-				 GNOME_VFS_FILE_INFO_GET_MIME_TYPE | GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
-
-	if (info->mime_type == NULL)
+	if (gnome_vfs_get_file_info (uri, info,
+				     GNOME_VFS_FILE_INFO_GET_MIME_TYPE | GNOME_VFS_FILE_INFO_FOLLOW_LINKS) != GNOME_VFS_OK) {
+		*error_message_return = g_strdup ("Failed to get file info.");
+	} else if (info->mime_type == NULL)
 		*error_message_return = g_strdup ("Unknown format");
 	else if (!strcmp (info->mime_type, "application/x-ogg") ||
 		 !strcmp (info->mime_type, "application/ogg"))
-		m = assign_metadata_ogg (escaped, error_message_return);
+		m = assign_metadata_ogg (uri, error_message_return);
 #if HAVE_ID3TAG
 	else if (!strcmp (info->mime_type, "audio/x-mp3") ||
 	         !strcmp (info->mime_type, "audio/mpeg"))
-		m = assign_metadata_mp3 (escaped, info, error_message_return);
+		m = assign_metadata_mp3 (uri, info, error_message_return);
 #endif /* HAVE_ID3TAG */
 	else if (!strcmp (info->mime_type, "application/x-flac") ||
 		 !strcmp (info->mime_type, "audio/x-flac"))
-		m = assign_metadata_flac (escaped, error_message_return);
+		m = assign_metadata_flac (uri, error_message_return);
 #if HAVE_FAAD
 	else if (!strcmp (info->mime_type, "application/x-m4a") ||
 		 !strcmp (info->mime_type, "audio/x-m4a"))
-		m = assign_metadata_mp4 (filename, error_message_return);
+		m = assign_metadata_mp4 (uri, error_message_return);
 #endif /* HAVE_FAAD */
 	else
 		*error_message_return = g_strdup ("Unknown format");
@@ -901,7 +905,7 @@ metadata_load (const char *filename,
 
 	gnome_vfs_file_info_unref (info);
 
-	g_free (escaped);
+	g_free (uri);
 
 	return m;
 }
Index: libmuine/player-gst-0.8.c
===================================================================
RCS file: /cvs/gnome/muine/libmuine/player-gst-0.8.c,v
retrieving revision 1.1
diff -u -p -r1.1 player-gst-0.8.c
--- libmuine/player-gst-0.8.c	1 Feb 2006 06:35:03 -0000	1.1
+++ libmuine/player-gst-0.8.c	15 Aug 2006 11:38:30 -0000
@@ -347,14 +347,16 @@ player_set_file (Player     *player,
 	if (!file)
 		return FALSE;
 
+	player->priv->current_file = gnome_vfs_get_uri_from_local_path (file);
+	if (player->priv->current_file == NULL)
+	  {
+	    *error = g_strdup ("Failed to convert filename to URI.");
+	    return FALSE;
+	  }
+
 	g_timer_stop (player->priv->timer);
 	g_timer_reset (player->priv->timer);
 	player->priv->timer_add = 0;
-
-	escaped = gnome_vfs_escape_path_string (file);
-	// FIXME get rid of this one when the switch to gnome-vfs is made
-	player->priv->current_file = g_strdup_printf ("file://%s", escaped);
-	g_free (escaped);
 
 	g_object_set (G_OBJECT (player->priv->play), "uri",
 		      player->priv->current_file, NULL);
Index: libmuine/player-gst.c
===================================================================
RCS file: /cvs/gnome/muine/libmuine/player-gst.c,v
retrieving revision 1.16
diff -u -p -r1.16 player-gst.c
--- libmuine/player-gst.c	1 Feb 2006 06:35:03 -0000	1.16
+++ libmuine/player-gst.c	15 Aug 2006 11:38:30 -0000
@@ -297,8 +297,6 @@ player_set_file (Player     *player,
 		 const char *file,
 		 char      **error)
 {
-	char *escaped;
-
 	g_return_val_if_fail (IS_PLAYER (player), FALSE);
 
 	*error = NULL;
@@ -308,14 +306,16 @@ player_set_file (Player     *player,
 	if (!file)
 		return FALSE;
 
+	player->priv->current_file = gnome_vfs_get_uri_from_local_path (file);
+	if (player->priv->current_file == NULL)
+	  {
+	    *error = g_strdup ("Failed to convert filename to URI.");
+	    return FALSE;
+	  }
+
 	g_timer_stop (player->priv->timer);
 	g_timer_reset (player->priv->timer);
 	player->priv->timer_add = 0;
-
-	escaped = gnome_vfs_escape_path_string (file);
-	// FIXME get rid of this one when the switch to gnome-vfs is made
-	player->priv->current_file = g_strdup_printf ("file://%s", escaped);
-	g_free (escaped);
 
 	g_object_set (G_OBJECT (player->priv->play), "uri",
 		      player->priv->current_file, NULL);
Index: libmuine/player-xine.c
===================================================================
RCS file: /cvs/gnome/muine/libmuine/player-xine.c,v
retrieving revision 1.13
diff -u -p -r1.13 player-xine.c
--- libmuine/player-xine.c	9 Feb 2005 21:23:36 -0000	1.13
+++ libmuine/player-xine.c	15 Aug 2006 11:38:30 -0000
@@ -439,7 +439,7 @@ player_set_file (Player *player,
 		 char      **error)
 {
   PlayerPriv *priv;
-  char *escaped;
+  char *uri;
 
   g_return_val_if_fail (IS_PLAYER (player), FALSE);
 
@@ -447,14 +447,19 @@ player_set_file (Player *player,
 
   *error = NULL;
 
-  escaped = gnome_vfs_escape_path_string (file);
-  if (!player_open (player, escaped, error))
+  uri = gnome_vfs_get_uri_from_local_path (file);
+  if (uri == NULL)
     {
-      g_free (escaped);
+      *error = g_strdup ("Failed to convert filename to URI.");
+      return FALSE;
+    }
+  else if (!player_open (player, uri, error))
+    {
+      g_free (uri);
       return FALSE;
     }
 
-  g_free (escaped);
+  g_free (uri);
 
   return TRUE;
 }
