[brasero: 1/3] 2009-04-22 Philippe Rouquier <bonfire-app wanadoo fr>



commit 41b472b687acd09d7194144d4c0ae3f3c92fa899
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Wed Apr 22 09:25:56 2009 +0200

    2009-04-22  Philippe Rouquier  <bonfire-app wanadoo fr>
    
    	Moved some files to libbrasero-utils so they can be used by
    	libbrasero-burn as well
    
    	* libbrasero-utils/brasero-async-task-manager.c
    	(brasero_async_task_manager_get_type),
    	(brasero_async_task_manager_class_init),
    	(brasero_async_task_manager_init),
    	(brasero_async_task_manager_finalize),
    	(brasero_async_task_manager_insert_task),
    	(brasero_async_task_manager_thread),
    	(brasero_async_task_manager_queue),
    	(brasero_async_task_manager_foreach_active),
    	(brasero_async_task_manager_foreach_active_remove),
    	(brasero_async_task_manager_foreach_unprocessed_remove),
    	(brasero_async_task_manager_find_urgent_task):
    	* libbrasero-utils/brasero-async-task-manager.h:
    	* libbrasero-utils/brasero-io.c
    	(brasero_io_job_progress_report_cb),
    	(brasero_io_job_progress_report_start),
    	(brasero_io_job_progress_report_stop),
    	(brasero_io_job_progress_get_current),
    	(brasero_io_job_progress_get_file_processed),
    	(brasero_io_job_progress_get_read),
    	(brasero_io_job_progress_get_total),
    	(brasero_io_job_progress_get_phase),
    	(brasero_io_unref_result_callback_data),
    	(brasero_io_job_result_free), (brasero_io_return_result_idle),
    	(brasero_io_queue_result), (brasero_io_return_result),
    	(brasero_io_set_job), (brasero_io_push_job), (brasero_io_job_free),
    	(brasero_io_job_destroy), (brasero_io_mount_enclosing_volume_cb),
    	(brasero_io_mount_enclosing_volume),
    	(brasero_io_check_for_parent_symlink),
    	(brasero_io_get_uri_from_path), (brasero_io_check_symlink_target),
    	(brasero_io_metadata_lookup_buffer),
    	(brasero_io_metadata_cached_free),
    	(brasero_io_set_metadata_attributes), (brasero_io_find_metadata),
    	(brasero_io_wait_for_metadata), (brasero_io_get_metadata_info),
    	(brasero_io_get_file_info_thread_real),
    	(brasero_io_get_file_info_thread), (brasero_io_new_file_info_job),
    	(brasero_io_get_file_info), (brasero_io_playlist_clear),
    	(brasero_io_add_playlist_entry_parsed_cb),
    	(brasero_io_start_playlist_cb),
    	(brasero_io_parse_playlist_get_uris),
    	(brasero_io_parse_playlist_thread), (brasero_io_parse_playlist),
    	(brasero_io_get_file_count_destroy),
    	(brasero_io_get_file_count_process_playlist),
    	(brasero_io_get_file_count_process_file),
    	(brasero_io_get_file_count_process_directory),
    	(brasero_io_get_file_count_start),
    	(brasero_io_get_file_count_progress_cb),
    	(brasero_io_get_file_count_thread), (brasero_io_get_file_count),
    	(brasero_io_load_directory_destroy),
    	(brasero_io_load_directory_playlist),
    	(brasero_io_load_directory_thread), (brasero_io_load_directory),
    	(brasero_io_cancel_result), (brasero_io_cancel_tasks_by_base_cb),
    	(brasero_io_cancel_by_base), (brasero_io_cancel_tasks_by_data_cb),
    	(brasero_io_cancel_by_data), (brasero_io_compare_unprocessed_task),
    	(brasero_io_find_urgent), (brasero_io_register), (brasero_io_init),
    	(brasero_io_free_async_queue), (brasero_io_finalize),
    	(brasero_io_class_init), (brasero_io_last_reference_cb),
    	(brasero_io_get_default):
    	* libbrasero-utils/brasero-io.h:
    	* libbrasero-utils/brasero-metadata.c
    	(brasero_metadata_info_clear), (brasero_metadata_info_free),
    	(brasero_metadata_info_copy), (brasero_metadata_stop_pipeline),
    	(brasero_metadata_destroy_pipeline), (brasero_metadata_stop),
    	(brasero_metadata_cancel), (brasero_metadata_completed),
    	(brasero_metadata_thumbnail), (brasero_metadata_is_seekable),
    	(brasero_metadata_get_mime_type), (brasero_metadata_is_mp3),
    	(foreach_tag), (brasero_metadata_process_pending_tag_messages),
    	(brasero_metadata_success), (brasero_metadata_get_duration),
    	(brasero_metadata_mp3_bus_messages),
    	(brasero_metadata_create_mp3_pipeline),
    	(brasero_metadata_success_main),
    	(brasero_metadata_install_plugins_add_downloaded),
    	(brasero_metadata_install_plugins_free_data),
    	(brasero_metadata_install_plugins_success),
    	(brasero_metadata_install_plugins_abort),
    	(brasero_metadata_install_plugins_completed),
    	(brasero_metadata_install_plugins_result),
    	(brasero_metadata_is_downloading),
    	(brasero_metadata_install_missing_plugins),
    	(brasero_metadata_bus_messages),
    	(brasero_metadata_create_audio_pipeline),
    	(brasero_metadata_create_video_pipeline),
    	(brasero_metadata_error_on_pad_linking),
    	(brasero_metadata_link_dummy_pad),
    	(brasero_metadata_new_decoded_pad_cb),
    	(brasero_metadata_create_pipeline), (brasero_metadata_set_new_uri),
    	(brasero_metadata_set_uri), (brasero_metadata_get_info_async),
    	(brasero_metadata_wait_cancelled), (brasero_metadata_wait),
    	(brasero_metadata_increase_listener_number),
    	(brasero_metadata_decrease_listener_number),
    	(brasero_metadata_get_uri), (brasero_metadata_get_flags),
    	(brasero_metadata_get_result), (brasero_metadata_init),
    	(brasero_metadata_finalize), (brasero_metadata_get_property),
    	(brasero_metadata_set_property), (brasero_metadata_class_init),
    	(brasero_metadata_new):
    	* libbrasero-utils/brasero-metadata.h:
    	* src/brasero-async-task-manager.c:
    	* src/brasero-async-task-manager.h:
    	* src/brasero-io.c:
    	* src/brasero-io.h:
    	* src/brasero-metadata.c:
    	* src/brasero-metadata.h:
---
 ChangeLog                                          |  108 ++++++++++
 libbrasero-burn/burn-basics.h                      |    8 -
 libbrasero-burn/burn-debug.h                       |    7 +-
 libbrasero-utils/Makefile.am                       |   16 ++-
 .../brasero-async-task-manager.c                   |   40 ++--
 .../brasero-async-task-manager.h                   |   40 ++--
 {src => libbrasero-utils}/brasero-io.c             |  222 ++++----------------
 {src => libbrasero-utils}/brasero-io.h             |   73 ++++++-
 {src => libbrasero-utils}/brasero-metadata.c       |  153 +++++++-------
 {src => libbrasero-utils}/brasero-metadata.h       |   40 ++--
 libbrasero-utils/brasero-misc.c                    |   54 +++++
 libbrasero-utils/brasero-misc.h                    |   40 ++++-
 plugins/cdrkit/burn-wodim.c                        |    4 +-
 plugins/cdrtools/burn-cdrecord.c                   |    4 +-
 plugins/dvdcss/burn-dvdcss.c                       |    6 -
 plugins/growisofs/burn-growisofs.c                 |    2 +-
 plugins/libburnia/burn-libburn.c                   |   15 +-
 plugins/transcode/burn-transcode.c                 |   14 +-
 src/Makefile.am                                    |    6 -
 src/brasero-audio-disc.c                           |    1 +
 src/brasero-data-session.c                         |  124 +++++++++++
 src/brasero-player.c                               |    5 +-
 src/brasero-playlist.c                             |    2 +
 src/brasero-utils.h                                |    4 -
 src/brasero-video-disc.c                           |    1 +
 25 files changed, 624 insertions(+), 365 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3c096ed..845a082 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,111 @@
+2009-04-22  Philippe Rouquier  <bonfire-app wanadoo fr>
+
+	Moved some files to libbrasero-utils so they can be used by
+	libbrasero-burn as well
+
+	* libbrasero-utils/brasero-async-task-manager.c
+	(brasero_async_task_manager_get_type),
+	(brasero_async_task_manager_class_init),
+	(brasero_async_task_manager_init),
+	(brasero_async_task_manager_finalize),
+	(brasero_async_task_manager_insert_task),
+	(brasero_async_task_manager_thread),
+	(brasero_async_task_manager_queue),
+	(brasero_async_task_manager_foreach_active),
+	(brasero_async_task_manager_foreach_active_remove),
+	(brasero_async_task_manager_foreach_unprocessed_remove),
+	(brasero_async_task_manager_find_urgent_task):
+	* libbrasero-utils/brasero-async-task-manager.h:
+	* libbrasero-utils/brasero-io.c
+	(brasero_io_job_progress_report_cb),
+	(brasero_io_job_progress_report_start),
+	(brasero_io_job_progress_report_stop),
+	(brasero_io_job_progress_get_current),
+	(brasero_io_job_progress_get_file_processed),
+	(brasero_io_job_progress_get_read),
+	(brasero_io_job_progress_get_total),
+	(brasero_io_job_progress_get_phase),
+	(brasero_io_unref_result_callback_data),
+	(brasero_io_job_result_free), (brasero_io_return_result_idle),
+	(brasero_io_queue_result), (brasero_io_return_result),
+	(brasero_io_set_job), (brasero_io_push_job), (brasero_io_job_free),
+	(brasero_io_job_destroy), (brasero_io_mount_enclosing_volume_cb),
+	(brasero_io_mount_enclosing_volume),
+	(brasero_io_check_for_parent_symlink),
+	(brasero_io_get_uri_from_path), (brasero_io_check_symlink_target),
+	(brasero_io_metadata_lookup_buffer),
+	(brasero_io_metadata_cached_free),
+	(brasero_io_set_metadata_attributes), (brasero_io_find_metadata),
+	(brasero_io_wait_for_metadata), (brasero_io_get_metadata_info),
+	(brasero_io_get_file_info_thread_real),
+	(brasero_io_get_file_info_thread), (brasero_io_new_file_info_job),
+	(brasero_io_get_file_info), (brasero_io_playlist_clear),
+	(brasero_io_add_playlist_entry_parsed_cb),
+	(brasero_io_start_playlist_cb),
+	(brasero_io_parse_playlist_get_uris),
+	(brasero_io_parse_playlist_thread), (brasero_io_parse_playlist),
+	(brasero_io_get_file_count_destroy),
+	(brasero_io_get_file_count_process_playlist),
+	(brasero_io_get_file_count_process_file),
+	(brasero_io_get_file_count_process_directory),
+	(brasero_io_get_file_count_start),
+	(brasero_io_get_file_count_progress_cb),
+	(brasero_io_get_file_count_thread), (brasero_io_get_file_count),
+	(brasero_io_load_directory_destroy),
+	(brasero_io_load_directory_playlist),
+	(brasero_io_load_directory_thread), (brasero_io_load_directory),
+	(brasero_io_cancel_result), (brasero_io_cancel_tasks_by_base_cb),
+	(brasero_io_cancel_by_base), (brasero_io_cancel_tasks_by_data_cb),
+	(brasero_io_cancel_by_data), (brasero_io_compare_unprocessed_task),
+	(brasero_io_find_urgent), (brasero_io_register), (brasero_io_init),
+	(brasero_io_free_async_queue), (brasero_io_finalize),
+	(brasero_io_class_init), (brasero_io_last_reference_cb),
+	(brasero_io_get_default):
+	* libbrasero-utils/brasero-io.h:
+	* libbrasero-utils/brasero-metadata.c
+	(brasero_metadata_info_clear), (brasero_metadata_info_free),
+	(brasero_metadata_info_copy), (brasero_metadata_stop_pipeline),
+	(brasero_metadata_destroy_pipeline), (brasero_metadata_stop),
+	(brasero_metadata_cancel), (brasero_metadata_completed),
+	(brasero_metadata_thumbnail), (brasero_metadata_is_seekable),
+	(brasero_metadata_get_mime_type), (brasero_metadata_is_mp3),
+	(foreach_tag), (brasero_metadata_process_pending_tag_messages),
+	(brasero_metadata_success), (brasero_metadata_get_duration),
+	(brasero_metadata_mp3_bus_messages),
+	(brasero_metadata_create_mp3_pipeline),
+	(brasero_metadata_success_main),
+	(brasero_metadata_install_plugins_add_downloaded),
+	(brasero_metadata_install_plugins_free_data),
+	(brasero_metadata_install_plugins_success),
+	(brasero_metadata_install_plugins_abort),
+	(brasero_metadata_install_plugins_completed),
+	(brasero_metadata_install_plugins_result),
+	(brasero_metadata_is_downloading),
+	(brasero_metadata_install_missing_plugins),
+	(brasero_metadata_bus_messages),
+	(brasero_metadata_create_audio_pipeline),
+	(brasero_metadata_create_video_pipeline),
+	(brasero_metadata_error_on_pad_linking),
+	(brasero_metadata_link_dummy_pad),
+	(brasero_metadata_new_decoded_pad_cb),
+	(brasero_metadata_create_pipeline), (brasero_metadata_set_new_uri),
+	(brasero_metadata_set_uri), (brasero_metadata_get_info_async),
+	(brasero_metadata_wait_cancelled), (brasero_metadata_wait),
+	(brasero_metadata_increase_listener_number),
+	(brasero_metadata_decrease_listener_number),
+	(brasero_metadata_get_uri), (brasero_metadata_get_flags),
+	(brasero_metadata_get_result), (brasero_metadata_init),
+	(brasero_metadata_finalize), (brasero_metadata_get_property),
+	(brasero_metadata_set_property), (brasero_metadata_class_init),
+	(brasero_metadata_new):
+	* libbrasero-utils/brasero-metadata.h:
+	* src/brasero-async-task-manager.c:
+	* src/brasero-async-task-manager.h:
+	* src/brasero-io.c:
+	* src/brasero-io.h:
+	* src/brasero-metadata.c:
+	* src/brasero-metadata.h:
+
 2009-04-20  Philippe Rouquier  <ykw localhost localdomain>
 
 	Add virtual methods to retrieve all information about a data track
diff --git a/libbrasero-burn/burn-basics.h b/libbrasero-burn/burn-basics.h
index caca936..c3d11c3 100644
--- a/libbrasero-burn/burn-basics.h
+++ b/libbrasero-burn/burn-basics.h
@@ -39,14 +39,6 @@
 
 G_BEGIN_DECLS
 
-#define BRASERO_GET_BASENAME_FOR_DISPLAY(uri, name)				\
-{										\
-    	gchar *escaped_basename;						\
-	escaped_basename = g_path_get_basename (uri);				\
-    	name = g_uri_unescape_string (escaped_basename, NULL);			\
-	g_free (escaped_basename);						\
-}
-
 #define BRASERO_PLUGIN_DIRECTORY		BRASERO_LIBDIR "/brasero/plugins"
 #define BRASERO_PLUGIN_KEY			"/apps/brasero/config/plugins"
 
diff --git a/libbrasero-burn/burn-debug.h b/libbrasero-burn/burn-debug.h
index 184d7fa..c7589ec 100644
--- a/libbrasero-burn/burn-debug.h
+++ b/libbrasero-burn/burn-debug.h
@@ -35,6 +35,7 @@
 #include <gmodule.h>
 
 #include "brasero-medium.h"
+
 #include "brasero-track.h"
 #include "brasero-plugin-registration.h"
 
@@ -42,9 +43,9 @@ G_BEGIN_DECLS
 
 #define BRASERO_BURN_LOG_DOMAIN					"BraseroBurn"
 
-#define BRASERO_BURN_LOG(format, ...)				\
-		brasero_burn_debug_message (G_STRLOC,		\
-					    format,		\
+#define BRASERO_BURN_LOG(format, ...)						\
+		brasero_burn_debug_message (G_STRLOC,				\
+					    format,				\
 					    ##__VA_ARGS__);
 
 #define BRASERO_BURN_LOGV(format, args_list)			\
diff --git a/libbrasero-utils/Makefile.am b/libbrasero-utils/Makefile.am
index 1ac2bb7..b1440a7 100644
--- a/libbrasero-utils/Makefile.am
+++ b/libbrasero-utils/Makefile.am
@@ -9,6 +9,10 @@ INCLUDES = \
 	-DBRASERO_LIBDIR=\"$(libdir)\"  	         		\
 	$(DISABLE_DEPRECATED)						\
 	$(BRASERO_GLIB_CFLAGS)						\
+	$(BRASERO_GIO_CFLAGS)						\
+	$(BRASERO_PL_PARSER_CFLAGS)					\
+	$(BRASERO_GSTREAMER_CFLAGS)					\
+	$(BRASERO_GSTREAMER_BASE_CFLAGS)				\
 	$(BRASERO_GTK_CFLAGS)
 
 
@@ -17,6 +21,10 @@ lib_LTLIBRARIES = \
 
 libbrasero_utils_la_LIBADD =					\
 	$(BRASERO_GLIB_LIBS)					\
+	$(BRASERO_GIO_LIBS)		\
+	$(BRASERO_GSTREAMER_LIBS)	\
+	$(BRASERO_GSTREAMER_BASE_LIBS)	\
+	$(BRASERO_PL_PARSER_LIBS)	\
 	$(BRASERO_GTK_LIBS)
 
 
@@ -44,7 +52,13 @@ libbrasero_utils_la_SOURCES =		\
 	brasero-jacket-view.c        \
 	brasero-jacket-view.h        \
 	brasero-tool-color-picker.c        \
-	brasero-tool-color-picker.h
+	brasero-tool-color-picker.h        \
+	brasero-async-task-manager.c        \
+	brasero-async-task-manager.h        \
+	brasero-io.c        \
+	brasero-io.h        \
+	brasero-metadata.c        \
+	brasero-metadata.h
 
 # EXTRA_DIST =			\
 #	libbrasero-utils.symbols
diff --git a/src/brasero-async-task-manager.c b/libbrasero-utils/brasero-async-task-manager.c
similarity index 89%
rename from src/brasero-async-task-manager.c
rename to libbrasero-utils/brasero-async-task-manager.c
index 4153972..0daea33 100644
--- a/src/brasero-async-task-manager.c
+++ b/libbrasero-utils/brasero-async-task-manager.c
@@ -1,24 +1,28 @@
-/***************************************************************************
- *            async-task-manager.c
- *
- *  ven avr  7 14:39:35 2006
- *  Copyright  2006  Rouquier Philippe
- *  brasero-app wanadoo fr
- ***************************************************************************/
-
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
- *  Brasero 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 of the License, or
- *  (at your option) any later version.
+ * Libbrasero-misc
+ * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app wanadoo fr>
  *
- *  Brasero 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 Library General Public License for more details.
+ * Libbrasero-misc 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 of the License, or
+ * (at your option) any later version.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to:
+ * The Libbrasero-misc authors hereby grant permission for non-GPL compatible
+ * GStreamer plugins to be used and distributed together with GStreamer
+ * and Libbrasero-misc. This permission is above and beyond the permissions granted
+ * by the GPL license by which Libbrasero-burn is covered. If you modify this code
+ * you may extend this exception to your version of the code, but you are not
+ * obligated to do so. If you do not wish to do so, delete this exception
+ * statement from your version.
+ * 
+ * Libbrasero-misc 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 Library 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.,
  * 	51 Franklin Street, Fifth Floor
  * 	Boston, MA  02110-1301, USA.
diff --git a/src/brasero-async-task-manager.h b/libbrasero-utils/brasero-async-task-manager.h
similarity index 70%
rename from src/brasero-async-task-manager.h
rename to libbrasero-utils/brasero-async-task-manager.h
index 25bafac..ce9a91c 100644
--- a/src/brasero-async-task-manager.h
+++ b/libbrasero-utils/brasero-async-task-manager.h
@@ -1,24 +1,28 @@
-/***************************************************************************
- *            async-task-manager.h
- *
- *  ven avr  7 14:39:35 2006
- *  Copyright  2006  Rouquier Philippe
- *  brasero-app wanadoo fr
- ***************************************************************************/
-
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
- *  Brasero 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 of the License, or
- *  (at your option) any later version.
+ * Libbrasero-misc
+ * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app wanadoo fr>
  *
- *  Brasero 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 Library General Public License for more details.
+ * Libbrasero-misc 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 of the License, or
+ * (at your option) any later version.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to:
+ * The Libbrasero-misc authors hereby grant permission for non-GPL compatible
+ * GStreamer plugins to be used and distributed together with GStreamer
+ * and Libbrasero-misc. This permission is above and beyond the permissions granted
+ * by the GPL license by which Libbrasero-burn is covered. If you modify this code
+ * you may extend this exception to your version of the code, but you are not
+ * obligated to do so. If you do not wish to do so, delete this exception
+ * statement from your version.
+ * 
+ * Libbrasero-misc 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 Library 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.,
  * 	51 Franklin Street, Fifth Floor
  * 	Boston, MA  02110-1301, USA.
diff --git a/src/brasero-io.c b/libbrasero-utils/brasero-io.c
similarity index 92%
rename from src/brasero-io.c
rename to libbrasero-utils/brasero-io.c
index 164e473..a90eef0 100644
--- a/src/brasero-io.c
+++ b/libbrasero-utils/brasero-io.c
@@ -1,20 +1,28 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
- * brasero
- * Copyright (C) Philippe Rouquier 2005-2008 <bonfire-app wanadoo fr>
+ * Libbrasero-misc
+ * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app wanadoo fr>
+ *
+ * Libbrasero-misc 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 of the License, or
+ * (at your option) any later version.
+ *
+ * The Libbrasero-misc authors hereby grant permission for non-GPL compatible
+ * GStreamer plugins to be used and distributed together with GStreamer
+ * and Libbrasero-misc. This permission is above and beyond the permissions granted
+ * by the GPL license by which Libbrasero-burn is covered. If you modify this code
+ * you may extend this exception to your version of the code, but you are not
+ * obligated to do so. If you do not wish to do so, delete this exception
+ * statement from your version.
  * 
- *  Brasero 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 of the License, or
- *  (at your option) any later version.
- * 
- * brasero is distributed in the hope that it will be useful,
+ * Libbrasero-misc 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.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Library General Public License for more details.
  * 
  * You should have received a copy of the GNU General Public License
- * along with brasero.  If not, write to:
+ * along with this program; if not, write to:
  * 	The Free Software Foundation, Inc.,
  * 	51 Franklin Street, Fifth Floor
  * 	Boston, MA  02110-1301, USA.
@@ -40,12 +48,7 @@
 #include <totem-pl-parser.h>
 #endif
 
-#include "burn-basics.h"
-#include "burn-debug.h"
-#include "burn-volume.h"
-
-#include "brasero-app.h"
-#include "brasero-utils.h"
+#include "brasero-misc.h"
 #include "brasero-io.h"
 #include "brasero-metadata.h"
 #include "brasero-async-task-manager.h"
@@ -83,23 +86,6 @@ struct _BraseroIOPrivate
 #define MAX_CONCURENT_META 	2
 #define MAX_BUFFERED_META	20
 
-struct _BraseroIOResultCallbackData {
-	gpointer callback_data;
-	gint ref;
-};
-typedef struct _BraseroIOResultCallbackData BraseroIOResultCallbackData;
-
-struct _BraseroIOJob {
-	gchar *uri;
-	BraseroIOFlags options;
-
-	const BraseroIOJobBase *base;
-	BraseroIOResultCallbackData *callback_data;
-};
-typedef struct _BraseroIOJob BraseroIOJob;
-
-#define BRASERO_IO_JOB(data)	((BraseroIOJob *) (data))
-
 struct _BraseroIOJobResult {
 	const BraseroIOJobBase *base;
 	BraseroIOResultCallbackData *callback_data;
@@ -134,7 +120,6 @@ struct _BraseroIOJobProgress {
 
 G_DEFINE_TYPE (BraseroIO, brasero_io, BRASERO_TYPE_ASYNC_TASK_MANAGER);
 
-
 /**
  * That's the structure to pass the progress on
  */
@@ -369,7 +354,7 @@ brasero_io_queue_result (BraseroIO *self,
 	g_mutex_unlock (priv->lock);
 }
 
-static void
+void
 brasero_io_return_result (BraseroIO *self,
 			  const BraseroIOJobBase *base,
 			  const gchar *uri,
@@ -400,7 +385,7 @@ brasero_io_return_result (BraseroIO *self,
  * Used to push a job
  */
 
-static void
+void
 brasero_io_set_job (BraseroIOJob *job,
 		    const BraseroIOJobBase *base,
 		    const gchar *uri,
@@ -416,7 +401,7 @@ brasero_io_set_job (BraseroIOJob *job,
 		g_atomic_int_inc (&job->callback_data->ref);
 }
 
-static void
+void
 brasero_io_push_job (BraseroIO *self,
 		     BraseroIOJob *job,
 		     const BraseroAsyncTaskType *type)
@@ -442,7 +427,7 @@ brasero_io_push_job (BraseroIO *self,
  * Job destruction
  */
 
-static void
+void
 brasero_io_job_free (BraseroIO *self,
 		     gboolean cancelled,
 		     BraseroIOJob *job)
@@ -524,7 +509,6 @@ brasero_io_mount_enclosing_volume_cb (GObject *source,
 {
 	BraseroIOMount *mount = callback_data;
 
-	BRASERO_BURN_LOG ("Volume mounting operation result");
 	mount->result = g_file_mount_enclosing_volume_finish (G_FILE (source),
 							      result,
 							      &mount->error);
@@ -541,7 +525,8 @@ brasero_io_mount_enclosing_volume (BraseroIO *self,
 	GMountOperation *operation;
 	BraseroIOMount mount = { NULL, };
 
-	operation = gtk_mount_operation_new (GTK_WINDOW (brasero_app_get_default ()));
+	/* FIXME: need a way to get a window for the operation */
+//	operation = gtk_mount_operation_new (GTK_WINDOW (brasero_app_get_default ()));
 	g_file_mount_enclosing_volume (file,
 				       G_MOUNT_MOUNT_NONE,
 				       operation,
@@ -576,9 +561,9 @@ brasero_io_mount_enclosing_volume (BraseroIO *self,
 	else if (mount.error)
 		g_error_free (mount.error);
 
-	BRASERO_BURN_LOG ("Parent volume is %s",
-			  (mounted != NULL && !g_cancellable_is_cancelled (cancel))?
-			  "mounted":"not mounted");
+	BRASERO_UTILS_LOG ("Parent volume is %s",
+			   (mounted != NULL && !g_cancellable_is_cancelled (cancel))?
+			   "mounted":"not mounted");
 
 	return (mounted != NULL && !g_cancellable_is_cancelled (cancel));
 }
@@ -801,7 +786,7 @@ brasero_io_find_metadata (BraseroIO *self,
 
 	priv = BRASERO_IO_PRIVATE (self);
 
-	BRASERO_BURN_LOG ("Retrieving available metadata %s", uri);
+	BRASERO_UTILS_LOG ("Retrieving available metadata %s", uri);
 
 	/* First see if a metadata is running with the same uri and the same
 	 * flags as us. In this case, acquire the lock and wait for the lock
@@ -829,7 +814,7 @@ brasero_io_find_metadata (BraseroIO *self,
 			 * do what they need to do then lock the metadata lock
 			 * Let the thread that got the lock first move it back
 			 * to waiting queue */
-			BRASERO_BURN_LOG ("Already ongoing search for %s", uri);
+			BRASERO_UTILS_LOG ("Already ongoing search for %s", uri);
 			brasero_metadata_increase_listener_number (metadata);
 			return metadata;
 		}
@@ -911,7 +896,7 @@ brasero_io_wait_for_metadata (BraseroIO *self,
 	}
 
 	/* Make sure it is stopped */
-	BRASERO_BURN_LOG ("Stopping metadata information retrieval (%p)", metadata);
+	BRASERO_UTILS_LOG ("Stopping metadata information retrieval (%p)", metadata);
 	brasero_metadata_cancel (metadata);
 
 	priv->metadata_running = g_slist_remove (priv->metadata_running, metadata);
@@ -949,7 +934,7 @@ brasero_io_get_metadata_info (BraseroIO *self,
 	||  !strcmp (mime, "application/octet-stream")))
 		return FALSE;
 
-	BRASERO_BURN_LOG ("Retrieving metadata info");
+	BRASERO_UTILS_LOG ("Retrieving metadata info");
 	g_mutex_lock (priv->lock_metadata);
 
 	/* Seek in the buffer if we have already explored these metadata. Check 
@@ -985,7 +970,7 @@ brasero_io_get_metadata_info (BraseroIO *self,
 		g_queue_remove (priv->meta_buffer, cached);
 		brasero_io_metadata_cached_free (cached);
 
-		BRASERO_BURN_LOG ("Updating cache information for %s", uri);
+		BRASERO_UTILS_LOG ("Updating cache information for %s", uri);
 	}
 
 	/* Find a metadata */
@@ -1048,7 +1033,7 @@ brasero_io_get_file_info_thread_real (BraseroAsyncTaskManager *manager,
 		if (local_error && local_error->code == G_IO_ERROR_NOT_MOUNTED) {
 			gboolean res;
 
-			BRASERO_BURN_LOG ("Starting to mount parent volume");
+			BRASERO_UTILS_LOG ("Starting to mount parent volume");
 			g_error_free (local_error);
 			local_error = NULL;
 
@@ -1080,8 +1065,8 @@ brasero_io_get_file_info_thread_real (BraseroAsyncTaskManager *manager,
 		parent = g_file_get_parent (file);
 		if (!brasero_io_check_symlink_target (parent, info)) {
 			g_set_error (error,
-				     BRASERO_ERROR,
-				     BRASERO_ERROR_SYMLINK_LOOP,
+				     BRASERO_UTILS_ERROR,
+				     BRASERO_UTILS_ERROR_SYMLINK_LOOP,
 				     _("Recursive symbolic link"));
 
 			g_object_unref (info);
@@ -1309,8 +1294,8 @@ brasero_io_parse_playlist_get_uris (const gchar *uri,
 
 	if (!result) {
 		g_set_error (error,
-			     BRASERO_ERROR,
-			     BRASERO_ERROR_GENERAL,
+			     BRASERO_UTILS_ERROR,
+			     BRASERO_UTILS_ERROR_GENERAL,
 			     _("The file does not appear to be a playlist"));
 
 		return FALSE;
@@ -1955,8 +1940,8 @@ brasero_io_load_directory_thread (BraseroAsyncTaskManager *manager,
 		/* special case for symlinks */
 		if (g_file_info_get_is_symlink (info)) {
 			if (!brasero_io_check_symlink_target (file, info)) {
-				error = g_error_new (BRASERO_ERROR,
-						     BRASERO_ERROR_SYMLINK_LOOP,
+				error = g_error_new (BRASERO_UTILS_ERROR,
+						     BRASERO_UTILS_ERROR_SYMLINK_LOOP,
 						     _("Recursive symbolic link"));
 
 				/* since we checked for the existence of the file
@@ -2081,129 +2066,6 @@ brasero_io_load_directory (BraseroIO *self,
 	brasero_io_push_job (self, BRASERO_IO_JOB (data), &contents_type);
 }
 
-/**
- * to evaluate the contents of a medium or image async
- */
-struct _BraseroIOImageContentsData {
-	BraseroIOJob job;
-	gchar *dev_image;
-
-	gint64 session_block;
-	gint64 block;
-};
-typedef struct _BraseroIOImageContentsData BraseroIOImageContentsData;
-
-static void
-brasero_io_image_directory_contents_destroy (BraseroAsyncTaskManager *manager,
-					     gboolean cancelled,
-					     gpointer callback_data)
-{
-	BraseroIOImageContentsData *data = callback_data;
-
-	g_free (data->dev_image);
-	brasero_io_job_free (BRASERO_IO (manager), cancelled, BRASERO_IO_JOB (data));
-}
-
-static BraseroAsyncTaskResult
-brasero_io_image_directory_contents_thread (BraseroAsyncTaskManager *manager,
-					    GCancellable *cancel,
-					    gpointer callback_data)
-{
-	BraseroIOImageContentsData *data = callback_data;
-	BraseroDeviceHandle *handle;
-	GList *children, *iter;
-	GError *error = NULL;
-	BraseroVolSrc *vol;
-
-	handle = brasero_device_handle_open (data->job.uri, FALSE, NULL);
-	vol = brasero_volume_source_open_device_handle (handle, &error);
-	if (!vol) {
-		brasero_device_handle_close (handle);
-		brasero_io_return_result (BRASERO_IO (manager),
-					  data->job.base,
-					  data->job.uri,
-					  NULL,
-					  error,
-					  data->job.callback_data);
-		return BRASERO_ASYNC_TASK_FINISHED;
-	}
-
-	children = brasero_volume_load_directory_contents (vol,
-							   data->session_block,
-							   data->block,
-							   &error);
-	brasero_volume_source_close (vol);
-	brasero_device_handle_close (handle);
-
-	for (iter = children; iter; iter = iter->next) {
-		BraseroVolFile *file;
-		GFileInfo *info;
-
-		file = iter->data;
-
-		info = g_file_info_new ();
-		g_file_info_set_file_type (info, file->isdir? G_FILE_TYPE_DIRECTORY:G_FILE_TYPE_REGULAR);
-		g_file_info_set_name (info, BRASERO_VOLUME_FILE_NAME (file));
-
-		if (file->isdir)
-			g_file_info_set_attribute_int64 (info,
-							 BRASERO_IO_DIR_CONTENTS_ADDR,
-							 file->specific.dir.address);
-		else
-			g_file_info_set_size (info, BRASERO_VOLUME_FILE_SIZE (file));
-
-		brasero_io_return_result (BRASERO_IO (manager),
-					  data->job.base,
-					  data->job.uri,
-					  info,
-					  NULL,
-					  data->job.callback_data);
-	}
-
-	g_list_foreach (children, (GFunc) brasero_volume_file_free, NULL);
-	g_list_free (children);
-
-	return BRASERO_ASYNC_TASK_FINISHED;
-}
-
-static const BraseroAsyncTaskType image_contents_type = {
-	brasero_io_image_directory_contents_thread,
-	brasero_io_image_directory_contents_destroy
-};
-
-void
-brasero_io_load_image_directory (BraseroIO *self,
-				 const gchar *dev_image,
-				 gint64 session_block,
-				 gint64 block,
-				 const BraseroIOJobBase *base,
-				 BraseroIOFlags options,
-				 gpointer user_data)
-{
-	BraseroIOImageContentsData *data;
-	BraseroIOResultCallbackData *callback_data = NULL;
-
-	if (user_data) {
-		callback_data = g_new0 (BraseroIOResultCallbackData, 1);
-		callback_data->callback_data = user_data;
-	}
-
-	data = g_new0 (BraseroIOImageContentsData, 1);
-	data->block = block;
-	data->session_block = session_block;
-
-	brasero_io_set_job (BRASERO_IO_JOB (data),
-			    base,
-			    dev_image,
-			    options,
-			    callback_data);
-
-	brasero_io_push_job (self,
-			     BRASERO_IO_JOB (data),
-			     &image_contents_type);
-
-}
-					 
 static void
 brasero_io_cancel_result (BraseroIO *self,
 			  BraseroIOJobResult *result)
@@ -2480,7 +2342,7 @@ brasero_io_finalize (GObject *object)
 
 			mount = iter->data;
 
-			BRASERO_BURN_LOG ("Unmountin volume");
+			BRASERO_UTILS_LOG ("Unmountin volume");
 			g_mount_unmount (mount,
 					 G_MOUNT_UNMOUNT_NONE,
 					 NULL,
diff --git a/src/brasero-io.h b/libbrasero-utils/brasero-io.h
similarity index 72%
rename from src/brasero-io.h
rename to libbrasero-utils/brasero-io.h
index 7da312e..75286db 100644
--- a/src/brasero-io.h
+++ b/libbrasero-utils/brasero-io.h
@@ -1,20 +1,28 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
- * brasero
- * Copyright (C) Philippe Rouquier 2005-2008 <bonfire-app wanadoo fr>
+ * Libbrasero-misc
+ * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app wanadoo fr>
+ *
+ * Libbrasero-misc 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 of the License, or
+ * (at your option) any later version.
+ *
+ * The Libbrasero-misc authors hereby grant permission for non-GPL compatible
+ * GStreamer plugins to be used and distributed together with GStreamer
+ * and Libbrasero-misc. This permission is above and beyond the permissions granted
+ * by the GPL license by which Libbrasero-burn is covered. If you modify this code
+ * you may extend this exception to your version of the code, but you are not
+ * obligated to do so. If you do not wish to do so, delete this exception
+ * statement from your version.
  * 
- *  Brasero 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 of the License, or
- *  (at your option) any later version.
- * 
- * brasero is distributed in the hope that it will be useful,
+ * Libbrasero-misc 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.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Library General Public License for more details.
  * 
  * You should have received a copy of the GNU General Public License
- * along with brasero.  If not, write to:
+ * along with this program; if not, write to:
  * 	The Free Software Foundation, Inc.,
  * 	51 Franklin Street, Fifth Floor
  * 	Boston, MA  02110-1301, USA.
@@ -68,6 +76,7 @@ typedef enum {
 	BRASERO_IO_INFO_IDLE			= 1 << 10
 } BraseroIOFlags;
 
+
 typedef enum {
 	BRASERO_IO_PHASE_START		= 0,
 	BRASERO_IO_PHASE_DOWNLOAD,
@@ -118,6 +127,7 @@ typedef void		(*BraseroIODestroyCallback)	(GObject *object,
 typedef gboolean	(*BraseroIOCompareCallback)	(gpointer data,
 							 gpointer user_data);
 
+
 struct _BraseroIOJobBase {
 	GObject *object;
 	BraseroIOResultCallback callback;
@@ -126,6 +136,47 @@ struct _BraseroIOJobBase {
 };
 typedef struct _BraseroIOJobBase BraseroIOJobBase;
 
+struct _BraseroIOResultCallbackData {
+	gpointer callback_data;
+	gint ref;
+};
+typedef struct _BraseroIOResultCallbackData BraseroIOResultCallbackData;
+
+struct _BraseroIOJob {
+	gchar *uri;
+	BraseroIOFlags options;
+
+	const BraseroIOJobBase *base;
+	BraseroIOResultCallbackData *callback_data;
+};
+typedef struct _BraseroIOJob BraseroIOJob;
+
+#define BRASERO_IO_JOB(data)	((BraseroIOJob *) (data))
+
+void
+brasero_io_job_free (BraseroIO *self,
+		     gboolean cancelled,
+		     BraseroIOJob *job);
+
+void
+brasero_io_set_job (BraseroIOJob *job,
+		    const BraseroIOJobBase *base,
+		    const gchar *uri,
+		    BraseroIOFlags options,
+		    BraseroIOResultCallbackData *callback_data);
+
+void
+brasero_io_push_job (BraseroIO *self,
+		     BraseroIOJob *job,
+		     const BraseroAsyncTaskType *type);
+
+void
+brasero_io_return_result (BraseroIO *self,
+			  const BraseroIOJobBase *base,
+			  const gchar *uri,
+			  GFileInfo *info,
+			  GError *error,
+			  BraseroIOResultCallbackData *callback_data);
 
 BraseroIO *
 brasero_io_get_default (void);
diff --git a/src/brasero-metadata.c b/libbrasero-utils/brasero-metadata.c
similarity index 91%
rename from src/brasero-metadata.c
rename to libbrasero-utils/brasero-metadata.c
index c333a8a..672026c 100644
--- a/src/brasero-metadata.c
+++ b/libbrasero-utils/brasero-metadata.c
@@ -1,24 +1,28 @@
-/***************************************************************************
- *            metadata.c
- *
- *  jeu jui 28 12:49:41 2005
- *  Copyright  2005  Philippe Rouquier
- *  brasero-app wanadoo fr
- ***************************************************************************/
-
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
- *  Brasero 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 of the License, or
- *  (at your option) any later version.
+ * Libbrasero-misc
+ * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app wanadoo fr>
  *
- *  Brasero 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 Library General Public License for more details.
+ * Libbrasero-misc 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 of the License, or
+ * (at your option) any later version.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to:
+ * The Libbrasero-misc authors hereby grant permission for non-GPL compatible
+ * GStreamer plugins to be used and distributed together with GStreamer
+ * and Libbrasero-misc. This permission is above and beyond the permissions granted
+ * by the GPL license by which Libbrasero-burn is covered. If you modify this code
+ * you may extend this exception to your version of the code, but you are not
+ * obligated to do so. If you do not wish to do so, delete this exception
+ * statement from your version.
+ * 
+ * Libbrasero-misc 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 Library 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.,
  * 	51 Franklin Street, Fifth Floor
  * 	Boston, MA  02110-1301, USA.
@@ -43,8 +47,7 @@
 #include <gst/tag/tag.h>
 
 #include "brasero-metadata.h"
-#include "brasero-utils.h"
-#include "burn-debug.h"
+#include "brasero-misc.h"
 
 #define BRASERO_METADATA_INITIAL_STATE		GST_STATE_PAUSED
 
@@ -252,8 +255,8 @@ brasero_metadata_stop_pipeline (GstElement *pipeline)
 						&state,
 						&pending,
 						GST_MSECOND);
-		BRASERO_BURN_LOG ("Get state (current = %i pending = %i) returned %i",
-				  state, pending, change);
+		BRASERO_UTILS_LOG ("Get state (current = %i pending = %i) returned %i",
+				   state, pending, change);
 	}
 
 	if (change == GST_STATE_CHANGE_FAILURE)
@@ -324,9 +327,9 @@ brasero_metadata_stop (BraseroMetadata *self)
 
 	priv = BRASERO_METADATA_PRIVATE (self);
 
-	BRASERO_BURN_LOG ("Retrieval ended for %s %p",
-  			  priv->info ? priv->info->uri:"Unknown",
-			  self);
+	BRASERO_UTILS_LOG ("Retrieval ended for %s %p",
+  			   priv->info ? priv->info->uri:"Unknown",
+			   self);
 
 	g_mutex_lock (priv->mutex);
 
@@ -383,9 +386,9 @@ brasero_metadata_cancel (BraseroMetadata *self)
 
 	priv = BRASERO_METADATA_PRIVATE (self);
 
-	BRASERO_BURN_LOG ("Metadata retrieval cancelled for %s %p",
-			  priv->info ? priv->info->uri:"Unknown",
-			  self);
+	BRASERO_UTILS_LOG ("Metadata retrieval cancelled for %s %p",
+			   priv->info ? priv->info->uri:"Unknown",
+			   self);
 	
 	brasero_metadata_stop (self);
 	if (priv->error) {
@@ -402,7 +405,7 @@ brasero_metadata_completed (BraseroMetadata *self)
 	priv = BRASERO_METADATA_PRIVATE (self);
 
 	if (priv->error) {
-		BRASERO_BURN_LOG ("Operation completed with an error %s", priv->error->message);
+		BRASERO_UTILS_LOG ("Operation completed with an error %s", priv->error->message);
 	}
 
 	/* we send a message only if we haven't got a loop (= async mode) */
@@ -446,7 +449,7 @@ brasero_metadata_thumbnail (BraseroMetadata *self)
 				       GST_SEEK_FLAG_FLUSH,
 				       position);
 
-	BRASERO_BURN_LOG ("Seeking forward %i for %s", res, priv->info->uri);
+	BRASERO_UTILS_LOG ("Seeking forward %i for %s", res, priv->info->uri);
 	if (!res)
 		return brasero_metadata_completed (self);
 
@@ -621,7 +624,7 @@ brasero_metadata_success (BraseroMetadata *self)
 
 	priv = BRASERO_METADATA_PRIVATE (self);
 
-	BRASERO_BURN_LOG ("Metadata retrieval completed for %s", priv->info->uri);
+	BRASERO_UTILS_LOG ("Metadata retrieval completed for %s", priv->info->uri);
 
 	/* check if that's a seekable one */
 	brasero_metadata_is_seekable (self);
@@ -666,8 +669,8 @@ brasero_metadata_get_duration (BraseroMetadata *self,
 			gchar *name;
 
 			BRASERO_GET_BASENAME_FOR_DISPLAY (priv->info->uri, name);
-			priv->error = g_error_new (BRASERO_ERROR,
-						   BRASERO_ERROR_GENERAL,
+			priv->error = g_error_new (BRASERO_UTILS_ERROR,
+						   BRASERO_UTILS_ERROR_GENERAL,
 						   _("\"%s\" could not be handled by Gstreamer."),
 						   name);
 			g_free (name);
@@ -676,7 +679,7 @@ brasero_metadata_get_duration (BraseroMetadata *self,
 		return brasero_metadata_completed (self);
 	}
 
-	BRASERO_BURN_LOG ("found duration %lli for %s", duration, priv->info->uri);
+	BRASERO_UTILS_LOG ("found duration %lli for %s", duration, priv->info->uri);
 
 	priv->info->len = duration;
 	return brasero_metadata_success (self);
@@ -701,7 +704,7 @@ brasero_metadata_mp3_bus_messages (GstBus *bus,
 	case GST_MESSAGE_ERROR:
 		/* save the error message */
 		gst_message_parse_error (msg, &error, &debug_string);
-		BRASERO_BURN_LOG ("Gstreamer error - mp3 - (%s)", debug_string);
+		BRASERO_UTILS_LOG ("Gstreamer error - mp3 - (%s)", debug_string);
 		g_free (debug_string);
 		if (!priv->error && error)
 			priv->error = error;
@@ -710,7 +713,7 @@ brasero_metadata_mp3_bus_messages (GstBus *bus,
 		return FALSE;
 
 	case GST_MESSAGE_EOS:
-		BRASERO_BURN_LOG ("End of stream reached - mp3 - for %s", priv->info->uri);
+		BRASERO_UTILS_LOG ("End of stream reached - mp3 - for %s", priv->info->uri);
 		brasero_metadata_get_duration (self, priv->pipeline_mp3, FALSE);
 		return FALSE;
 
@@ -738,8 +741,8 @@ brasero_metadata_create_mp3_pipeline (BraseroMetadata *self)
 					    priv->info->uri,
 					    NULL);
 	if (!source) {
-		priv->error = g_error_new (BRASERO_ERROR,
-					   BRASERO_ERROR_GENERAL,
+		priv->error = g_error_new (BRASERO_UTILS_ERROR,
+					   BRASERO_UTILS_ERROR_GENERAL,
 					   _("%s element could not be created"),
 					   "\"Source\"");
 
@@ -751,8 +754,8 @@ brasero_metadata_create_mp3_pipeline (BraseroMetadata *self)
 
 	parse = gst_element_factory_make ("mp3parse", NULL);
 	if (!parse) {
-		priv->error = g_error_new (BRASERO_ERROR,
-					   BRASERO_ERROR_GENERAL,
+		priv->error = g_error_new (BRASERO_UTILS_ERROR,
+					   BRASERO_UTILS_ERROR_GENERAL,
 					   _("%s element could not be created"),
 					   "\"mp3parse\"");
 
@@ -764,8 +767,8 @@ brasero_metadata_create_mp3_pipeline (BraseroMetadata *self)
 
 	sink = gst_element_factory_make ("fakesink", NULL);
 	if (!sink) {
-		priv->error = g_error_new (BRASERO_ERROR,
-					   BRASERO_ERROR_GENERAL,
+		priv->error = g_error_new (BRASERO_UTILS_ERROR,
+					   BRASERO_UTILS_ERROR_GENERAL,
 					   _("%s element could not be created"),
 					   "\"Fakesink\"");
 
@@ -800,7 +803,7 @@ brasero_metadata_success_main (BraseroMetadata *self)
 
 	priv = BRASERO_METADATA_PRIVATE (self);
 
-	BRASERO_BURN_LOG ("Metadata retrieval successfully completed for %s", priv->info->uri);
+	BRASERO_UTILS_LOG ("Metadata retrieval successfully completed for %s", priv->info->uri);
 
 	/* find the type of the file */
 	brasero_metadata_get_mime_type (self);
@@ -811,7 +814,7 @@ brasero_metadata_success_main (BraseroMetadata *self)
 	/* get the size */
 	if (brasero_metadata_is_mp3 (self)) {
 		if (!brasero_metadata_create_mp3_pipeline (self)) {
-			BRASERO_BURN_LOG ("Impossible to run mp3 specific pipeline");
+			BRASERO_UTILS_LOG ("Impossible to run mp3 specific pipeline");
 			return brasero_metadata_completed (self);
 		}
 
@@ -993,7 +996,7 @@ brasero_metadata_install_missing_plugins (BraseroMetadata *self)
 
 	priv = BRASERO_METADATA_PRIVATE (self);
 
-	BRASERO_BURN_LOG ("Starting to download missing plugins");
+	BRASERO_UTILS_LOG ("Starting to download missing plugins");
 
 	details = g_ptr_array_new ();
 	for (iter = priv->missing_plugins; iter; iter = iter->next) {
@@ -1052,7 +1055,7 @@ brasero_metadata_install_missing_plugins (BraseroMetadata *self)
 	gst_install_plugins_context_free (context);
 	g_ptr_array_free (details, FALSE);
 
-	BRASERO_BURN_LOG ("Download status %i", status);
+	BRASERO_UTILS_LOG ("Download status %i", status);
 
 	if (status != GST_INSTALL_PLUGINS_STARTED_OK) {
 		brasero_metadata_install_plugins_free_data (downloads);
@@ -1087,7 +1090,7 @@ brasero_metadata_bus_messages (GstBus *bus,
 			priv->info->snapshot = g_value_get_object (value);
 			g_object_ref (priv->info->snapshot);
 
-			BRASERO_BURN_LOG ("Received pixbuf snapshot sink (%p) for %s", priv->info->snapshot, priv->info->uri);
+			BRASERO_UTILS_LOG ("Received pixbuf snapshot sink (%p) for %s", priv->info->snapshot, priv->info->uri);
 
 			/* Now we can stop */
 			return brasero_metadata_completed (self);
@@ -1117,7 +1120,7 @@ brasero_metadata_bus_messages (GstBus *bus,
 				 * then consider that silence started from 0 */
 				gst_element_query_position (priv->pipeline, &format, &pos);
 				if (pos == -1) {
-					BRASERO_BURN_LOG ("impossible to retrieve position");
+					BRASERO_UTILS_LOG ("impossible to retrieve position");
 					return TRUE;
 				}
 
@@ -1135,10 +1138,10 @@ brasero_metadata_bus_messages (GstBus *bus,
 				else
 					priv->silence->end = pos;
 
-				BRASERO_BURN_LOG ("silence detected at %lli", pos);
+				BRASERO_UTILS_LOG ("silence detected at %lli", pos);
 			}
 			else if (priv->silence) {
-				BRASERO_BURN_LOG ("silence finished");
+				BRASERO_UTILS_LOG ("silence finished");
 
 				priv->info->silences = g_slist_append (priv->info->silences,
 								       priv->silence);
@@ -1151,7 +1154,7 @@ brasero_metadata_bus_messages (GstBus *bus,
 	case GST_MESSAGE_ERROR:
 		/* save the error message */
 		gst_message_parse_error (msg, &error, &debug_string);
-		BRASERO_BURN_LOG ("Gstreamer error (%s)", debug_string);
+		BRASERO_UTILS_LOG ("Gstreamer error (%s)", debug_string);
 		g_free (debug_string);
 		if (!priv->error && error)
 			priv->error = error;
@@ -1167,7 +1170,7 @@ brasero_metadata_bus_messages (GstBus *bus,
 		break;
 
 	case GST_MESSAGE_EOS:
-		BRASERO_BURN_LOG ("End of stream reached for %s", priv->info->uri);
+		BRASERO_UTILS_LOG ("End of stream reached for %s", priv->info->uri);
 		return brasero_metadata_success_main (self);
 
 	case GST_MESSAGE_TAG:
@@ -1269,7 +1272,7 @@ brasero_metadata_create_audio_pipeline (BraseroMetadata *self)
 	gst_object_unref (audio_pad);
 
 	gst_bin_add (GST_BIN (priv->pipeline), priv->audio);
-	BRASERO_BURN_LOG ("Adding audio pipeline for %s", priv->info->uri);
+	BRASERO_UTILS_LOG ("Adding audio pipeline for %s", priv->info->uri);
 
 	return TRUE;
 }
@@ -1290,7 +1293,7 @@ brasero_metadata_create_video_pipeline (BraseroMetadata *self)
 		gst_object_unref (priv->video);
 		priv->video = NULL;
 
-		BRASERO_BURN_LOG ("gdkpixbufsink is not installed");
+		BRASERO_UTILS_LOG ("gdkpixbufsink is not installed");
 		return FALSE;
 	}
 	gst_bin_add (GST_BIN (priv->video), priv->snapshot);
@@ -1306,7 +1309,7 @@ brasero_metadata_create_video_pipeline (BraseroMetadata *self)
 		gst_object_unref (priv->video);
 		priv->video = NULL;
 
-		BRASERO_BURN_LOG ("ffmpegcolorspace is not installed");
+		BRASERO_UTILS_LOG ("ffmpegcolorspace is not installed");
 		return FALSE;
 	}
 	gst_bin_add (GST_BIN (priv->video), colorspace);
@@ -1325,7 +1328,7 @@ brasero_metadata_create_video_pipeline (BraseroMetadata *self)
 	gst_object_unref (video_pad);
 
 	gst_bin_add (GST_BIN (priv->pipeline), priv->video);
-	BRASERO_BURN_LOG ("Adding pixbuf snapshot sink for %s", priv->info->uri);
+	BRASERO_UTILS_LOG ("Adding pixbuf snapshot sink for %s", priv->info->uri);
 
 	return TRUE;
 }
@@ -1359,7 +1362,7 @@ brasero_metadata_link_dummy_pad (BraseroMetadata *self,
 
 	priv = BRASERO_METADATA_PRIVATE (self);
 
-	BRASERO_BURN_LOG ("Linking to a fake sink");
+	BRASERO_UTILS_LOG ("Linking to a fake sink");
 
 	/* It doesn't hurt to link to a fakesink and can avoid some deadlocks.
 	 * I don't know why but some demuxers in particular will lock (probably
@@ -1404,7 +1407,7 @@ brasero_metadata_new_decoded_pad_cb (GstElement *decode,
 
 	res = GST_PAD_LINK_REFUSED;
 
-	BRASERO_BURN_LOG ("New pad for %s", priv->info->uri);
+	BRASERO_UTILS_LOG ("New pad for %s", priv->info->uri);
 
 	/* make sure that this is audio / video */
 	caps = gst_pad_get_caps (pad);
@@ -1424,7 +1427,7 @@ brasero_metadata_new_decoded_pad_cb (GstElement *decode,
 		sink = gst_element_get_static_pad (priv->audio, "sink");
 		if (sink && !GST_PAD_IS_LINKED (sink)) {
 			res = gst_pad_link (pad, sink);
-			BRASERO_BURN_LOG ("Audio stream link %i for %s", res, priv->info->uri);
+			BRASERO_UTILS_LOG ("Audio stream link %i for %s", res, priv->info->uri);
 			gst_object_unref (sink);
 
 			priv->audio_linked = (res == GST_PAD_LINK_OK);
@@ -1433,7 +1436,7 @@ brasero_metadata_new_decoded_pad_cb (GstElement *decode,
 	}
 
 	if (g_strrstr (name, "video/x-raw-") && !priv->video_linked) {
-		BRASERO_BURN_LOG ("RAW video stream found");
+		BRASERO_UTILS_LOG ("RAW video stream found");
 
 		if (!priv->video && (priv->flags & BRASERO_METADATA_FLAG_THUMBNAIL)) {
 			/* we shouldn't error out if we can't create a video
@@ -1441,7 +1444,7 @@ brasero_metadata_new_decoded_pad_cb (GstElement *decode,
 			/* FIXME: we should nevertheless tell the user what
 			 * plugin he is missing. */
 			if (!brasero_metadata_create_video_pipeline (self)) {
-				BRASERO_BURN_LOG ("Impossible to create video pipeline");
+				BRASERO_UTILS_LOG ("Impossible to create video pipeline");
 
 				gst_caps_unref (caps);
 
@@ -1464,7 +1467,7 @@ brasero_metadata_new_decoded_pad_cb (GstElement *decode,
 
 			gst_element_set_state (priv->video, BRASERO_METADATA_INITIAL_STATE);
 
-			BRASERO_BURN_LOG ("Video stream link %i for %s", res, priv->info->uri);
+			BRASERO_UTILS_LOG ("Video stream link %i for %s", res, priv->info->uri);
 		}
 		else if (!brasero_metadata_link_dummy_pad (self, pad))
 			brasero_metadata_error_on_pad_linking (self);
@@ -1486,8 +1489,8 @@ brasero_metadata_create_pipeline (BraseroMetadata *self)
 
 	priv->decode = gst_element_factory_make ("decodebin", NULL);
 	if (priv->decode == NULL) {
-		priv->error = g_error_new (BRASERO_ERROR,
-					   BRASERO_ERROR_GENERAL,
+		priv->error = g_error_new (BRASERO_UTILS_ERROR,
+					   BRASERO_UTILS_ERROR_GENERAL,
 					   _("%s element could not be created"),
 					   "\"Decodebin\"");
 		return FALSE;
@@ -1501,8 +1504,8 @@ brasero_metadata_create_pipeline (BraseroMetadata *self)
 	/* the two following objects don't always run */
 	priv->convert = gst_element_factory_make ("audioconvert", NULL);
 	if (!priv->convert) {
-		priv->error = g_error_new (BRASERO_ERROR,
-					   BRASERO_ERROR_GENERAL,
+		priv->error = g_error_new (BRASERO_UTILS_ERROR,
+					   BRASERO_UTILS_ERROR_GENERAL,
 					   _("%s element could not be created"),
 					   "\"Audioconvert\"");
 		return FALSE;
@@ -1510,8 +1513,8 @@ brasero_metadata_create_pipeline (BraseroMetadata *self)
 
 	priv->level = gst_element_factory_make ("level", NULL);
 	if (!priv->level) {
-		priv->error = g_error_new (BRASERO_ERROR,
-					   BRASERO_ERROR_GENERAL,
+		priv->error = g_error_new (BRASERO_UTILS_ERROR,
+					   BRASERO_UTILS_ERROR_GENERAL,
 					   _("%s element could not be created"),
 					   "\"Level\"");
 		return FALSE;
@@ -1523,8 +1526,8 @@ brasero_metadata_create_pipeline (BraseroMetadata *self)
 
 	priv->sink = gst_element_factory_make ("fakesink", NULL);
 	if (priv->sink == NULL) {
-		priv->error = g_error_new (BRASERO_ERROR,
-					   BRASERO_ERROR_GENERAL,
+		priv->error = g_error_new (BRASERO_UTILS_ERROR,
+					   BRASERO_UTILS_ERROR_GENERAL,
 					   _("%s element could not be created"),
 					   "\"Fakesink\"");
 		return FALSE;
@@ -1542,7 +1545,7 @@ brasero_metadata_set_new_uri (BraseroMetadata *self,
 
 	priv = BRASERO_METADATA_PRIVATE (self);
 
-	BRASERO_BURN_LOG ("New retrieval for %s %p", uri, self);
+	BRASERO_UTILS_LOG ("New retrieval for %s %p", uri, self);
 
 	if (priv->error) {
 		g_error_free (priv->error);
@@ -1593,8 +1596,8 @@ brasero_metadata_set_new_uri (BraseroMetadata *self,
 						  uri,
 						  NULL);
 	if (!priv->source) {
-		priv->error = g_error_new (BRASERO_ERROR,
-					   BRASERO_ERROR_GENERAL,
+		priv->error = g_error_new (BRASERO_UTILS_ERROR,
+					   BRASERO_UTILS_ERROR_GENERAL,
 					   "Can't create file source");
 		return FALSE;
 	}
@@ -1690,7 +1693,7 @@ static void
 brasero_metadata_wait_cancelled (GCancellable *cancel,
 				 GCond *condition)
 {
-	BRASERO_BURN_LOG ("Thread waiting for retrieval end cancelled");
+	BRASERO_UTILS_LOG ("Thread waiting for retrieval end cancelled");
 	g_cond_broadcast (condition);
 }
 
@@ -1704,7 +1707,7 @@ brasero_metadata_wait (BraseroMetadata *self,
 
 	priv = BRASERO_METADATA_PRIVATE (self);
 
-	BRASERO_BURN_LOG ("Metadata lock and wait %p", self);
+	BRASERO_UTILS_LOG ("Metadata lock and wait %p", self);
 
 	g_mutex_lock (priv->mutex);
 
diff --git a/src/brasero-metadata.h b/libbrasero-utils/brasero-metadata.h
similarity index 69%
rename from src/brasero-metadata.h
rename to libbrasero-utils/brasero-metadata.h
index 1c345c7..7734419 100644
--- a/src/brasero-metadata.h
+++ b/libbrasero-utils/brasero-metadata.h
@@ -1,24 +1,28 @@
-/***************************************************************************
- *            metadata.h
- *
- *  jeu jui 28 12:49:41 2005
- *  Copyright  2005  Philippe Rouquier
- *  brasero-app wanadoo fr
- ***************************************************************************/
-
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
- *  Brasero 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 of the License, or
- *  (at your option) any later version.
+ * Libbrasero-misc
+ * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app wanadoo fr>
  *
- *  Brasero 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 Library General Public License for more details.
+ * Libbrasero-misc 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 of the License, or
+ * (at your option) any later version.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to:
+ * The Libbrasero-misc authors hereby grant permission for non-GPL compatible
+ * GStreamer plugins to be used and distributed together with GStreamer
+ * and Libbrasero-misc. This permission is above and beyond the permissions granted
+ * by the GPL license by which Libbrasero-burn is covered. If you modify this code
+ * you may extend this exception to your version of the code, but you are not
+ * obligated to do so. If you do not wish to do so, delete this exception
+ * statement from your version.
+ * 
+ * Libbrasero-misc 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 Library 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.,
  * 	51 Franklin Street, Fifth Floor
  * 	Boston, MA  02110-1301, USA.
diff --git a/libbrasero-utils/brasero-misc.c b/libbrasero-utils/brasero-misc.c
index 93a717a..228b978 100644
--- a/libbrasero-utils/brasero-misc.c
+++ b/libbrasero-utils/brasero-misc.c
@@ -44,6 +44,60 @@
 
 #include "brasero-misc.h"
 
+
+/**
+ * Error reporting
+ */
+
+GQuark
+brasero_utils_error_quark (void)
+{
+	static GQuark quark = 0;
+
+	if (!quark)
+		quark = g_quark_from_static_string ("Brasero_utils_error");
+
+	return quark;
+}
+
+/**
+ * Debug
+ */
+
+static gboolean use_debug = FALSE;
+
+void
+brasero_utils_set_use_debug (gboolean active)
+{
+	use_debug = active;
+}
+
+void
+brasero_utils_debug_message (const gchar *domain,
+			     const gchar *location,
+			     const gchar *format,
+			     ...)
+{
+	va_list arg_list;
+	gchar *format_real;
+
+	if (!use_debug)
+		return;
+
+	format_real = g_strdup_printf ("At %s: %s",
+				       location,
+				       format);
+
+	va_start (arg_list, format);
+	g_logv (domain,
+		G_LOG_LEVEL_DEBUG,
+		format_real,
+		arg_list);
+	va_end (arg_list);
+
+	g_free (format_real);
+}
+
 GtkWidget *
 brasero_utils_pack_properties_list (const gchar *title, GSList *list)
 {
diff --git a/libbrasero-utils/brasero-misc.h b/libbrasero-utils/brasero-misc.h
index 566f835..9a74e93 100644
--- a/libbrasero-utils/brasero-misc.h
+++ b/libbrasero-utils/brasero-misc.h
@@ -34,11 +34,47 @@
 #include <glib.h>
 #include <gtk/gtk.h>
 
-#ifndef _MISC_H
-#define _MISC_H
+#ifndef _BRASERO_MISC_H
+#define _BRASERO_MISC_H
 
 G_BEGIN_DECLS
 
+GQuark brasero_utils_error_quark (void);
+
+#define BRASERO_UTILS_ERROR				brasero_utils_error_quark()
+
+typedef enum {
+	BRASERO_UTILS_ERROR_NONE,
+	BRASERO_UTILS_ERROR_GENERAL,
+	BRASERO_UTILS_ERROR_SYMLINK_LOOP
+} BraseroUtilsErrors;
+
+#define BRASERO_UTILS_LOG_DOMAIN			"BraseroUtils"
+
+void
+brasero_utils_set_use_debug (gboolean active);
+
+void
+brasero_utils_debug_message (const gchar *domain,
+			     const gchar *location,
+			     const gchar *format,
+			     ...);
+
+#define BRASERO_UTILS_LOG(format, ...)						\
+	brasero_utils_debug_message (BRASERO_UTILS_LOG_DOMAIN,			\
+				     G_STRLOC,					\
+				     format,					\
+				     ##__VA_ARGS__);
+
+
+#define BRASERO_GET_BASENAME_FOR_DISPLAY(uri, name)				\
+{										\
+    	gchar *escaped_basename;						\
+	escaped_basename = g_path_get_basename (uri);				\
+    	name = g_uri_unescape_string (escaped_basename, NULL);			\
+	g_free (escaped_basename);						\
+}
+
 GtkWidget *
 brasero_utils_pack_properties (const gchar *title, ...);
 GtkWidget *
diff --git a/plugins/cdrkit/burn-wodim.c b/plugins/cdrkit/burn-wodim.c
index 0f519c1..fc09dba 100644
--- a/plugins/cdrkit/burn-wodim.c
+++ b/plugins/cdrkit/burn-wodim.c
@@ -289,7 +289,7 @@ brasero_wodim_stdout_read (BraseroProcess *process, const gchar *line)
 
 		priv->current_track_written = mb_written * 1048576;
 		if (brasero_job_get_fd_in (BRASERO_JOB (wodim), NULL) == BRASERO_BURN_OK) {
-			guint64 bytes = 0;
+			goffset bytes = 0;
 
 			/* we must ask the imager what is the total size */
 			brasero_job_get_session_output_size (BRASERO_JOB (wodim),
@@ -772,7 +772,7 @@ brasero_wodim_set_argv_record (BraseroWodim *wodim,
 	if (brasero_job_get_fd_in (BRASERO_JOB (wodim), NULL) == BRASERO_BURN_OK) {
 		BraseroBurnResult result;
 		int buffer_size;
-		guint64 sectors;
+		goffset sectors;
 		
 		/* we need to know what is the type of the track (audio / data) */
 		result = brasero_job_get_input_type (BRASERO_JOB (wodim), type);
diff --git a/plugins/cdrtools/burn-cdrecord.c b/plugins/cdrtools/burn-cdrecord.c
index d07cc18..86b49f6 100644
--- a/plugins/cdrtools/burn-cdrecord.c
+++ b/plugins/cdrtools/burn-cdrecord.c
@@ -277,7 +277,7 @@ brasero_cdrecord_stdout_read (BraseroProcess *process, const gchar *line)
 
 		priv->current_track_written = mb_written * 1048576;
 		if (brasero_job_get_fd_in (BRASERO_JOB (cdrecord), NULL) == BRASERO_BURN_OK) {
-			guint64 bytes = 0;
+			goffset bytes = 0;
 
 			/* we must ask the imager what is the total size */
 			brasero_job_get_session_output_size (BRASERO_JOB (cdrecord),
@@ -756,7 +756,7 @@ brasero_cdrecord_set_argv_record (BraseroCDRecord *cdrecord,
 	if (brasero_job_get_fd_in (BRASERO_JOB (cdrecord), NULL) == BRASERO_BURN_OK) {
 		BraseroBurnResult result;
 		int buffer_size;
-		guint64 sectors;
+		goffset sectors;
 		
 		/* we need to know what is the type of the track (audio / data) */
 		result = brasero_job_get_input_type (BRASERO_JOB (cdrecord), type);
diff --git a/plugins/dvdcss/burn-dvdcss.c b/plugins/dvdcss/burn-dvdcss.c
index ce08939..4f33882 100644
--- a/plugins/dvdcss/burn-dvdcss.c
+++ b/plugins/dvdcss/burn-dvdcss.c
@@ -42,7 +42,6 @@
 
 #include "brasero-units.h"
 
-#include "burn-debug.h"
 #include "burn-job.h"
 #include "brasero-plugin-registration.h"
 #include "burn-dvdcss.h"
@@ -90,11 +89,6 @@ brasero_dvdcss_library_init (GError **error)
 		goto error_version;
 
 	dvdcss_interface_2 = address;
-	BRASERO_BURN_LOG ("libdvdcss version %d.%d.%d\n",
-			  (guchar) dvdcss_interface_2 [0],
-			  (guchar) dvdcss_interface_2 [1],
-			  (guchar) dvdcss_interface_2 [2]);
-
 	if (!g_module_symbol (module, "dvdcss_open", &address))
 		goto error_loading;
 	dvdcss_open = address;
diff --git a/plugins/growisofs/burn-growisofs.c b/plugins/growisofs/burn-growisofs.c
index a544445..c1ee208 100644
--- a/plugins/growisofs/burn-growisofs.c
+++ b/plugins/growisofs/burn-growisofs.c
@@ -411,7 +411,7 @@ brasero_growisofs_set_argv_record (BraseroGrowisofs *growisofs,
 	BraseroBurnResult result;
 	BraseroJobAction action;
 	BraseroBurnFlag flags;
-	guint64 sectors = 0;
+	goffset sectors = 0;
 	gchar *device;
 	guint speed;
 
diff --git a/plugins/libburnia/burn-libburn.c b/plugins/libburnia/burn-libburn.c
index 92b4d89..56ed619 100644
--- a/plugins/libburnia/burn-libburn.c
+++ b/plugins/libburnia/burn-libburn.c
@@ -297,7 +297,7 @@ brasero_libburn_setup_session_fd (BraseroLibburn *self,
 			          GError **error)
 {
 	int fd;
-	guint64 size = 0;
+	goffset bytes = 0;
 	BraseroLibburnPrivate *priv;
 	BraseroTrackType *type = NULL;
 	BraseroBurnResult result = BRASERO_BURN_OK;
@@ -323,17 +323,18 @@ brasero_libburn_setup_session_fd (BraseroLibburn *self,
 
 		brasero_job_get_session_output_size (BRASERO_JOB (self),
 						     NULL,
-						     &size);
+						     &bytes);
 
 		result = brasero_libburn_add_fd_track (session,
 						       fd,
 						       mode,
-						       size,
+						       bytes,
 						       priv->pvd,
 						       error);
 	}
 	else if (brasero_track_type_get_has_stream (type)) {
 		GSList *tracks;
+		guint64 length = 0;
 
 		brasero_track_type_free (type);
 
@@ -342,15 +343,15 @@ brasero_libburn_setup_session_fd (BraseroLibburn *self,
 			BraseroTrack *track;
 
 			track = tracks->data;
-			brasero_track_stream_get_length (BRASERO_TRACK_STREAM (track), &size);
-			size = BRASERO_DURATION_TO_BYTES (size);
+			brasero_track_stream_get_length (BRASERO_TRACK_STREAM (track), &length);
+			bytes = BRASERO_DURATION_TO_BYTES (length);
 
 			/* we dup the descriptor so the same 
 			 * will be shared by all tracks */
 			result = brasero_libburn_add_fd_track (session,
 							       dup (fd),
 							       BURN_AUDIO,
-							       size,
+							       bytes,
 							       NULL,
 							       error);
 			if (result != BRASERO_BURN_OK)
@@ -476,7 +477,7 @@ brasero_libburn_start_record (BraseroLibburn *self,
 			      GError **error)
 {
 	guint64 rate;
-	guint64 blocks = 0;
+	goffset blocks = 0;
 	BraseroMedia media;
 	BraseroBurnFlag flags;
 	BraseroBurnResult result;
diff --git a/plugins/transcode/burn-transcode.c b/plugins/transcode/burn-transcode.c
index 5b67160..7d08c31 100644
--- a/plugins/transcode/burn-transcode.c
+++ b/plugins/transcode/burn-transcode.c
@@ -1316,8 +1316,13 @@ brasero_transcode_active_state (BraseroTranscode *transcode)
 				 uri);
 
 		if (priv->mp3_size_pipeline) {
+			gchar *escaped_basename;
+
 			/* Run the pipeline till the end */
-			BRASERO_GET_BASENAME_FOR_DISPLAY (uri, name);
+			escaped_basename = g_path_get_basename (uri);
+			name = g_uri_unescape_string (escaped_basename, NULL);
+			g_free (escaped_basename);
+
 			string = g_strdup_printf (_("Analysing \"%s\""), name);
 			g_free (name);
 		
@@ -1349,7 +1354,12 @@ brasero_transcode_active_state (BraseroTranscode *transcode)
 		return FALSE;
 	}
 	else {
-		BRASERO_GET_BASENAME_FOR_DISPLAY (uri, name);
+		gchar *escaped_basename;
+
+		escaped_basename = g_path_get_basename (uri);
+		name = g_uri_unescape_string (escaped_basename, NULL);
+		g_free (escaped_basename);
+
 		string = g_strdup_printf (_("Transcoding \"%s\""), name);
 		g_free (name);
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 159dc26..ba9576e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -53,8 +53,6 @@ brasero_SOURCES = \
 	brasero-player.h         \
 	brasero-eject-dialog.c		\
 	brasero-eject-dialog.h		\
-	brasero-metadata.c         \
-	brasero-metadata.h         \
 	brasero-disc.c         \
 	brasero-disc.h         \
 	brasero-audio-disc.c         \
@@ -75,8 +73,6 @@ brasero_SOURCES = \
 	brasero-layout.h         \
 	brasero-file-chooser.c         \
 	brasero-file-chooser.h         \
-	brasero-async-task-manager.c         \
-	brasero-async-task-manager.h         \
 	eggtreemultidnd.c         \
 	eggtreemultidnd.h         \
 	brasero-multi-dnd.c         \
@@ -113,8 +109,6 @@ brasero_SOURCES = \
 	brasero-filter-option.c         \
 	baobab-cell-renderer-progress.c         \
 	baobab-cell-renderer-progress.h         \
-	brasero-io.h         \
-	brasero-io.c         \
 	brasero-multi-song-props.h         \
 	brasero-multi-song-props.c         \
 	brasero-rename.h         \
diff --git a/src/brasero-audio-disc.c b/src/brasero-audio-disc.c
index aa640d4..ee6d0ca 100644
--- a/src/brasero-audio-disc.c
+++ b/src/brasero-audio-disc.c
@@ -39,6 +39,7 @@
 
 #include <gtk/gtk.h>
 
+#include "brasero-misc.h"
 #include "burn-basics.h"
 #include "burn-debug.h"
 #include "brasero-app.h"
diff --git a/src/brasero-data-session.c b/src/brasero-data-session.c
index b93d6f7..73acb60 100644
--- a/src/brasero-data-session.c
+++ b/src/brasero-data-session.c
@@ -34,6 +34,7 @@
 #include "brasero-drive.h"
 #include "brasero-medium.h"
 #include "brasero-medium-monitor.h"
+#include "burn-volume.h"
 
 #include "brasero-burn-lib.h"
 
@@ -78,6 +79,129 @@ enum {
 
 static gulong brasero_data_session_signals [LAST_SIGNAL] = { 0 };
 
+/**
+ * to evaluate the contents of a medium or image async
+ */
+struct _BraseroIOImageContentsData {
+	BraseroIOJob job;
+	gchar *dev_image;
+
+	gint64 session_block;
+	gint64 block;
+};
+typedef struct _BraseroIOImageContentsData BraseroIOImageContentsData;
+
+static void
+brasero_io_image_directory_contents_destroy (BraseroAsyncTaskManager *manager,
+					     gboolean cancelled,
+					     gpointer callback_data)
+{
+	BraseroIOImageContentsData *data = callback_data;
+
+	g_free (data->dev_image);
+	brasero_io_job_free (BRASERO_IO (manager), cancelled, BRASERO_IO_JOB (data));
+}
+
+static BraseroAsyncTaskResult
+brasero_io_image_directory_contents_thread (BraseroAsyncTaskManager *manager,
+					    GCancellable *cancel,
+					    gpointer callback_data)
+{
+	BraseroIOImageContentsData *data = callback_data;
+	BraseroDeviceHandle *handle;
+	GList *children, *iter;
+	GError *error = NULL;
+	BraseroVolSrc *vol;
+
+	handle = brasero_device_handle_open (data->job.uri, FALSE, NULL);
+	vol = brasero_volume_source_open_device_handle (handle, &error);
+	if (!vol) {
+		brasero_device_handle_close (handle);
+		brasero_io_return_result (BRASERO_IO (manager),
+					  data->job.base,
+					  data->job.uri,
+					  NULL,
+					  error,
+					  data->job.callback_data);
+		return BRASERO_ASYNC_TASK_FINISHED;
+	}
+
+	children = brasero_volume_load_directory_contents (vol,
+							   data->session_block,
+							   data->block,
+							   &error);
+	brasero_volume_source_close (vol);
+	brasero_device_handle_close (handle);
+
+	for (iter = children; iter; iter = iter->next) {
+		BraseroVolFile *file;
+		GFileInfo *info;
+
+		file = iter->data;
+
+		info = g_file_info_new ();
+		g_file_info_set_file_type (info, file->isdir? G_FILE_TYPE_DIRECTORY:G_FILE_TYPE_REGULAR);
+		g_file_info_set_name (info, BRASERO_VOLUME_FILE_NAME (file));
+
+		if (file->isdir)
+			g_file_info_set_attribute_int64 (info,
+							 BRASERO_IO_DIR_CONTENTS_ADDR,
+							 file->specific.dir.address);
+		else
+			g_file_info_set_size (info, BRASERO_VOLUME_FILE_SIZE (file));
+
+		brasero_io_return_result (BRASERO_IO (manager),
+					  data->job.base,
+					  data->job.uri,
+					  info,
+					  NULL,
+					  data->job.callback_data);
+	}
+
+	g_list_foreach (children, (GFunc) brasero_volume_file_free, NULL);
+	g_list_free (children);
+
+	return BRASERO_ASYNC_TASK_FINISHED;
+}
+
+static const BraseroAsyncTaskType image_contents_type = {
+	brasero_io_image_directory_contents_thread,
+	brasero_io_image_directory_contents_destroy
+};
+
+void
+brasero_io_load_image_directory (BraseroIO *self,
+				 const gchar *dev_image,
+				 gint64 session_block,
+				 gint64 block,
+				 const BraseroIOJobBase *base,
+				 BraseroIOFlags options,
+				 gpointer user_data)
+{
+	BraseroIOImageContentsData *data;
+	BraseroIOResultCallbackData *callback_data = NULL;
+
+	if (user_data) {
+		callback_data = g_new0 (BraseroIOResultCallbackData, 1);
+		callback_data->callback_data = user_data;
+	}
+
+	data = g_new0 (BraseroIOImageContentsData, 1);
+	data->block = block;
+	data->session_block = session_block;
+
+	brasero_io_set_job (BRASERO_IO_JOB (data),
+			    base,
+			    dev_image,
+			    options,
+			    callback_data);
+
+	brasero_io_push_job (self,
+			     BRASERO_IO_JOB (data),
+			     &image_contents_type);
+
+}
+
 static void
 brasero_data_session_check_size (BraseroDataSession *self)
 {
diff --git a/src/brasero-player.c b/src/brasero-player.c
index 3e9985b..199144d 100644
--- a/src/brasero-player.c
+++ b/src/brasero-player.c
@@ -37,12 +37,15 @@
 
 #include <gconf/gconf-client.h>
 
+#include "brasero-misc.h"
+
+#include "burn-debug.h"
+
 #include "brasero-player.h"
 #include "brasero-player-bacon.h"
 #include "brasero-utils.h"
 #include "brasero-metadata.h"
 #include "brasero-io.h"
-#include "burn-debug.h"
 
 G_DEFINE_TYPE (BraseroPlayer, brasero_player, GTK_TYPE_ALIGNMENT);
 
diff --git a/src/brasero-playlist.c b/src/brasero-playlist.c
index 55b0d24..de689a8 100644
--- a/src/brasero-playlist.c
+++ b/src/brasero-playlist.c
@@ -47,6 +47,8 @@
 
 #include <totem-pl-parser.h>
 
+#include "brasero-misc.h"
+
 #include "brasero-app.h"
 #include "brasero-playlist.h"
 #include "brasero-utils.h"
diff --git a/src/brasero-utils.h b/src/brasero-utils.h
index bde8197..73856f6 100644
--- a/src/brasero-utils.h
+++ b/src/brasero-utils.h
@@ -40,10 +40,6 @@ G_BEGIN_DECLS
 
 #define BRASERO_ERROR brasero_error_quark()
 
-typedef char *(*BraseroFormatTime) (double time,
-				    gboolean with_unit,
-				    gboolean round);
-
 typedef enum {
 	BRASERO_ERROR_NONE,
 	BRASERO_ERROR_GENERAL,
diff --git a/src/brasero-video-disc.c b/src/brasero-video-disc.c
index c2abe94..cf48fba 100644
--- a/src/brasero-video-disc.c
+++ b/src/brasero-video-disc.c
@@ -34,6 +34,7 @@
 
 #include "brasero-tags.h"
 
+#include "brasero-misc.h"
 #include "burn-debug.h"
 #include "brasero-app.h"
 #include "brasero-disc.h"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]