brasero r1358 - in trunk: . src



Author: philippr
Date: Wed Oct  8 16:24:31 2008
New Revision: 1358
URL: http://svn.gnome.org/viewvc/brasero?rev=1358&view=rev

Log:
	Cleanups and rotten code removal
	New CD-TEXT retrieval function => brasero displays the CD-TEXT title for the medium
	Fix plugin flag declaration when multiple flags set were defined for a same medium
	Fix a problem with drive locking when doing multisession with multiple medium inserted
	Fix a problem with DVD+RW selection when copying with two writable media with data
	<= don\'t always add FAST flag

	* src/Makefile.am:
	* src/brasero-burn-options.c (brasero_burn_options_lock_selection):
	* src/brasero-dest-selection.c (brasero_dest_selection_lock),
	(brasero_dest_selection_medium_changed),
	(brasero_dest_selection_set_property):
	* src/brasero-disc-option-dialog.c
	(brasero_disc_option_dialog_load_multi_state),
	(brasero_disc_option_dialog_update_multi),
	(brasero_disc_option_dialog_set_multi),
	(brasero_disc_option_dialog_set_disc),
	(brasero_disc_option_dialog_valid_media_cb):
	* src/brasero-session-cfg.c
	(brasero_session_cfg_save_drive_properties),
	(brasero_session_cfg_add_drive_properties_flags),
	(brasero_session_cfg_check_drive_settings),
	(brasero_session_cfg_add_flags),
	(brasero_session_cfg_remove_flags),
	(brasero_session_cfg_is_supported),
	(brasero_session_cfg_is_compulsory):
	* src/brasero-session-cfg.h:
	* src/burn-caps.c (brasero_burn_caps_get_flags_for_medium),
	(brasero_caps_disc_lookup_or_create), (brasero_caps_disc_new):
	* src/burn-medium.c (brasero_medium_get_CD_TEXT),
	(brasero_medium_read_CD_TEXT), (brasero_medium_init_real),
	(brasero_medium_reload_info), (brasero_medium_finalize),
	(brasero_medium_get_CD_TEXT_title):
	* src/burn-medium.h:
	* src/burn-plugin.c (brasero_plugin_set_flags),
	(brasero_plugin_get_all_flags):
	* src/burn-plugin.h:
	* src/burn-volume-obj.c (brasero_volume_get_name):

Modified:
   trunk/ChangeLog
   trunk/src/Makefile.am
   trunk/src/brasero-burn-options.c
   trunk/src/brasero-dest-selection.c
   trunk/src/brasero-disc-option-dialog.c
   trunk/src/brasero-session-cfg.c
   trunk/src/brasero-session-cfg.h
   trunk/src/burn-caps.c
   trunk/src/burn-medium.c
   trunk/src/burn-medium.h
   trunk/src/burn-plugin.c
   trunk/src/burn-plugin.h
   trunk/src/burn-volume-obj.c

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Wed Oct  8 16:24:31 2008
@@ -274,7 +274,9 @@
 	brasero-medium-properties.h           \
 	brasero-medium-properties.c           \
 	brasero-src-image.h           \
-	brasero-src-image.c
+	brasero-src-image.c           \
+	burn-media.c           \
+	burn-media.h
 
 if BUILD_INOTIFY
 brasero_SOURCES += brasero-file-monitor.c brasero-file-monitor.h

Modified: trunk/src/brasero-burn-options.c
==============================================================================
--- trunk/src/brasero-burn-options.c	(original)
+++ trunk/src/brasero-burn-options.c	Wed Oct  8 16:24:31 2008
@@ -138,6 +138,8 @@
 	BraseroBurnOptionsPrivate *priv;
 
 	priv = BRASERO_BURN_OPTIONS_PRIVATE (self);
+	brasero_medium_selection_set_active (BRASERO_MEDIUM_SELECTION (priv->selection),
+					     brasero_drive_get_medium (brasero_burn_session_get_burner (BRASERO_BURN_SESSION (priv->session))));
 	brasero_dest_selection_lock (BRASERO_DEST_SELECTION (priv->selection), TRUE);
 }
 

Modified: trunk/src/brasero-dest-selection.c
==============================================================================
--- trunk/src/brasero-dest-selection.c	(original)
+++ trunk/src/brasero-dest-selection.c	Wed Oct  8 16:24:31 2008
@@ -97,6 +97,7 @@
 
 		drive = brasero_medium_selection_get_active_drive (BRASERO_MEDIUM_SELECTION (self));
 		priv->locked_drive = drive;
+
 		if (priv->locked_drive)
 			brasero_drive_lock (priv->locked_drive,
 					    _("ongoing burning process"),
@@ -152,13 +153,13 @@
 		goto chain;
 	}
 
-	brasero_burn_session_set_burner (priv->session, drive);
 	if (priv->locked_drive && priv->locked_drive != drive) {
-		brasero_drive_unlock (priv->locked_drive);
-		g_object_unref (priv->locked_drive);
-		priv->locked_drive = NULL;
+		brasero_medium_selection_set_active (BRASERO_MEDIUM_SELECTION (combo),
+						     brasero_drive_get_medium (priv->locked_drive));
+		goto chain;
 	}
 
+	brasero_burn_session_set_burner (priv->session, drive);
 	gtk_widget_set_sensitive (GTK_WIDGET (combo), (priv->locked_drive == NULL));
 
 chain:
@@ -299,10 +300,17 @@
 		priv->session = session;
 		g_object_ref (session);
 
-		drive = brasero_medium_selection_get_active_drive (BRASERO_MEDIUM_SELECTION (object));
-		if (drive) {
-			brasero_burn_session_set_burner (session, drive);
-			g_object_unref (drive);
+		if (brasero_burn_session_get_flags (session) & BRASERO_BURN_FLAG_MERGE) {
+			drive = brasero_burn_session_get_burner (session);
+			brasero_medium_selection_set_active (BRASERO_MEDIUM_SELECTION (object),
+							     brasero_drive_get_medium (drive));
+		}
+		else {
+			drive = brasero_medium_selection_get_active_drive (BRASERO_MEDIUM_SELECTION (object));
+			if (drive) {
+				brasero_burn_session_set_burner (session, drive);
+				g_object_unref (drive);
+			}
 		}
 
 		priv->valid_sig = g_signal_connect (session,

Modified: trunk/src/brasero-disc-option-dialog.c
==============================================================================
--- trunk/src/brasero-disc-option-dialog.c	(original)
+++ trunk/src/brasero-disc-option-dialog.c	Wed Oct  8 16:24:31 2008
@@ -39,8 +39,6 @@
 #include <gtk/gtkvbox.h>
 #include <gtk/gtkbutton.h>
 
-#include <gconf/gconf-client.h>
-
 #include "burn-basics.h"
 #include "burn-drive.h"
 #include "burn-medium.h"
@@ -87,64 +85,36 @@
 static GtkDialogClass *parent_class = NULL;
 
 static void
-brasero_disc_option_dialog_save_multi_state (BraseroDiscOptionDialog *dialog)
+brasero_disc_option_dialog_load_multi_state (BraseroDiscOptionDialog *dialog)
 {
 	BraseroDiscOptionDialogPrivate *priv;
 	BraseroBurnSession *session;
-	GConfClient *client;
-	gboolean multi_on;
-	gchar *key;
+	gboolean value;
 
 	priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
 
 	session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
-	key = brasero_burn_session_get_config_key (session, "multi");
-	if (!key) {
+
+	if (!brasero_session_cfg_is_supported (BRASERO_SESSION_CFG (session), BRASERO_BURN_FLAG_MULTI)) {
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->multi_toggle), FALSE);
+		gtk_widget_set_sensitive (priv->multi_toggle, FALSE);
 		g_object_unref (session);
 		return;
 	}
 
-	multi_on = (brasero_burn_session_get_flags (session) & BRASERO_BURN_FLAG_MULTI) != 0;
-
-	client = gconf_client_get_default ();
-	gconf_client_set_int (client, key, multi_on, NULL);
-	g_object_unref (client);
-	g_object_unref (session);
-	g_free (key);
-}
+	value = (brasero_burn_session_get_flags (session) & BRASERO_BURN_FLAG_MULTI) != 0;
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->multi_toggle), value);
 
-static void
-brasero_disc_option_dialog_load_multi_state (BraseroDiscOptionDialog *dialog)
-{
-	BraseroDiscOptionDialogPrivate *priv;
-	BraseroBurnSession *session;
-	GConfClient *client;
-	gboolean multi_on;
-	gchar *key;
-
-	priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
-
-	session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
-
-	/* That's only provided multi is not compulsory or unsupported */
-	key = brasero_burn_session_get_config_key (session, "multi");
-	if (!key) {
+	if (!value) {
 		g_object_unref (session);
 		return;
 	}
 
-	client = gconf_client_get_default ();
-	multi_on = gconf_client_get_int (client, key, NULL);
+	/* set sensitivity */
+	value = brasero_session_cfg_is_compulsory (BRASERO_SESSION_CFG (session),
+						   BRASERO_BURN_FLAG_MULTI);
+	gtk_widget_set_sensitive (priv->multi_toggle, value != TRUE);
 	g_object_unref (session);
-	g_object_unref (client);
-	g_free (key);
-
-	/* NOTE: no need to take care of adding/removing MULTI flag to session,
-	 * the callback for the button will do it on its own. */
-	if (multi_on)
-		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->multi_toggle), TRUE);
-	else
-		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->multi_toggle), FALSE);
 }
 
 /**
@@ -219,8 +189,6 @@
 	BraseroTrackType input;
 	BraseroBurnSession *session;
 	BraseroDiscOptionDialogPrivate *priv;
-	BraseroBurnFlag supported = BRASERO_BURN_FLAG_NONE;
-	BraseroBurnFlag compulsory = BRASERO_BURN_FLAG_NONE;
 
 	priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
 
@@ -229,58 +197,19 @@
 
 	session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
 	brasero_burn_session_get_input_type (session, &input);
+
+	/* MULTI and Video projects don't get along */
 	if (input.type == BRASERO_TRACK_TYPE_DATA
 	&& (input.subtype.fs_type & BRASERO_IMAGE_FS_VIDEO)
 	&& (brasero_burn_session_get_dest_media (session) & (BRASERO_MEDIUM_DVD|BRASERO_MEDIUM_DVD_DL))) {
-		gtk_widget_set_sensitive (priv->multi_toggle, FALSE);
-		goto end;
-	}
-
-	/* Wipe out some flags before trying to see if MULTI is supported:
-	 * DAO don't really get along well with MULTI */
-	brasero_burn_session_remove_flag (session, BRASERO_BURN_FLAG_DAO);
-
-	/* see if multi disc option is supported or compulsory. The returned
-	 * value just indicate if the button state can be modified. */
-	brasero_burn_caps_get_flags (priv->caps,
-				     session,
-				     &supported,
-				     &compulsory);
-
-	if (!(supported & BRASERO_BURN_FLAG_MULTI)) {
-		/* just in case it was already set */
-		brasero_burn_session_remove_flag (session, BRASERO_BURN_FLAG_MULTI);
-
-		gtk_widget_set_sensitive (priv->multi_toggle, FALSE);
+		brasero_session_cfg_remove_flags (BRASERO_SESSION_CFG (session), BRASERO_BURN_FLAG_MULTI);
 		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->multi_toggle), FALSE);
-		goto end;
-	}
-
-	if (compulsory & BRASERO_BURN_FLAG_MULTI) {
-		/* NOTE: in this case video button is updated later see caps_changed and media_changed */
-		brasero_burn_session_add_flag (session, BRASERO_BURN_FLAG_MULTI);
-
-		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->multi_toggle), TRUE);
 		gtk_widget_set_sensitive (priv->multi_toggle, FALSE);
-		goto end;
+		g_object_unref (session);
+		return;
 	}
 
-	/* only load preferences if it is supported and not compulsory */
-	gtk_widget_set_sensitive (priv->multi_toggle, TRUE);
 	brasero_disc_option_dialog_load_multi_state (dialog);
-
-end:
-	/* Try to see if previously wiped out flags can be re-enabled now */
-	brasero_burn_caps_get_flags (priv->caps,
-				     session,
-				     &supported,
-				     &compulsory);
-
-	/* Likewise DAO and MULTI don't always get along well but use DAO
-	 * whenever it's possible */
-	if (supported & BRASERO_BURN_FLAG_DAO)
-		brasero_burn_session_add_flag (session, BRASERO_BURN_FLAG_DAO);
-
 	g_object_unref (session);
 }
 
@@ -379,14 +308,12 @@
 
 	session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
 
-	if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->multi_toggle))) {
-		brasero_burn_session_remove_flag (session, BRASERO_BURN_FLAG_MULTI);
-		brasero_disc_option_dialog_save_multi_state (dialog);
-	}
-	else {
-		brasero_burn_session_add_flag (session, BRASERO_BURN_FLAG_MULTI);
-		brasero_disc_option_dialog_save_multi_state (dialog);
-	}
+	if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->multi_toggle)))
+		brasero_session_cfg_remove_flags (BRASERO_SESSION_CFG (session),
+						  BRASERO_BURN_FLAG_MULTI);
+	else
+		brasero_session_cfg_add_flags (BRASERO_SESSION_CFG (session),
+					       BRASERO_BURN_FLAG_MULTI);
 
 	g_object_unref (session);
 }
@@ -992,10 +919,6 @@
 	session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
 	brasero_disc_set_session_param (disc, session);
 
-	/* see if we should lock the drive only with MERGE */
-	if (brasero_burn_session_get_flags (session) & BRASERO_BURN_FLAG_MERGE)
-		brasero_burn_options_lock_selection (BRASERO_BURN_OPTIONS (dialog));
-
 	brasero_burn_session_get_input_type (session, &type);
 	if (type.type == BRASERO_TRACK_TYPE_DATA) {
 		brasero_burn_options_set_type_shown (BRASERO_BURN_OPTIONS (dialog),
@@ -1017,6 +940,10 @@
 		}
 	}
 
+	/* see if we should lock the drive only with MERGE */
+	if (brasero_burn_session_get_flags (session) & BRASERO_BURN_FLAG_MERGE)
+		brasero_burn_options_lock_selection (BRASERO_BURN_OPTIONS (dialog));
+
 	g_object_unref (session);
 }
 
@@ -1044,10 +971,6 @@
 	if (priv->video_options)
 		gtk_widget_set_sensitive (priv->video_options, brasero_session_cfg_get_error (session) == BRASERO_SESSION_VALID);
 
-	/* update the multi button:
-	 * NOTE: order is important here multi then video */
-	brasero_disc_option_dialog_update_multi (self);
-
 	/* update the joliet button */
 	brasero_disc_option_dialog_update_joliet (self);
 

Modified: trunk/src/brasero-session-cfg.c
==============================================================================
--- trunk/src/brasero-session-cfg.c	(original)
+++ trunk/src/brasero-session-cfg.c	Wed Oct  8 16:24:31 2008
@@ -121,7 +121,7 @@
 	}
 
 	flags = gconf_client_get_int (client, key, NULL);
-	flags &= ~BRASERO_DRIVE_PROPERTIES_FLAGS;
+	flags &= ~BRASERO_DEST_SAVED_FLAGS;
 	flags |= (brasero_burn_session_get_flags (BRASERO_BURN_SESSION (self)) & BRASERO_DEST_SAVED_FLAGS);
 	gconf_client_set_int (client, key, flags, NULL);
 	g_free (key);
@@ -230,6 +230,9 @@
 						     BRASERO_BURN_SESSION (self),
 						     &priv->supported,
 						     &priv->compulsory);
+
+			/* NOTE: after setting DAO, some flags may become
+			 * compulsory like BLANK_BEFORE for CDRW with data */
 		}
 	}
 }
@@ -338,9 +341,10 @@
 
 	/* Try to properly update the flags for the current drive */
 	flags = brasero_burn_session_get_flags (BRASERO_BURN_SESSION (self));
-	if (brasero_burn_session_same_src_dest_drive (BRASERO_BURN_SESSION (self)))
+	if (brasero_burn_session_same_src_dest_drive (BRASERO_BURN_SESSION (self))) {
 		flags |= BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE|
 			 BRASERO_BURN_FLAG_FAST_BLANK;
+	}
 
 	/* check each flag before re-adding it */
 	brasero_session_cfg_add_drive_properties_flags (self, flags);
@@ -733,8 +737,64 @@
 brasero_session_cfg_add_flags (BraseroSessionCfg *self,
 			       BraseroBurnFlag flags)
 {
-	brasero_session_cfg_add_drive_properties_flags (self, flags);
-	brasero_session_cfg_update (self);
+	BraseroSessionCfgPrivate *priv;
+
+	priv = BRASERO_SESSION_CFG_PRIVATE (self);
+
+	if ((priv->supported & flags) != flags)
+		return;
+
+	if ((brasero_burn_session_get_flags (BRASERO_BURN_SESSION (self)) & flags) == flags)
+		return;
+
+	brasero_burn_session_add_flag (BRASERO_BURN_SESSION (self), flags);
+	priv->supported = BRASERO_BURN_FLAG_NONE;
+	priv->compulsory = BRASERO_BURN_FLAG_NONE;
+	brasero_burn_caps_get_flags (priv->caps,
+				     BRASERO_BURN_SESSION (self),
+				     &priv->supported,
+				     &priv->compulsory);
+
+	brasero_session_cfg_check (self);
+}
+
+void
+brasero_session_cfg_remove_flags (BraseroSessionCfg *self,
+				  BraseroBurnFlag flags)
+{
+	BraseroSessionCfgPrivate *priv;
+
+	priv = BRASERO_SESSION_CFG_PRIVATE (self);
+
+	brasero_burn_session_remove_flag (BRASERO_BURN_SESSION (self), flags);
+	priv->supported = BRASERO_BURN_FLAG_NONE;
+	priv->compulsory = BRASERO_BURN_FLAG_NONE;
+	brasero_burn_caps_get_flags (priv->caps,
+				     BRASERO_BURN_SESSION (self),
+				     &priv->supported,
+				     &priv->compulsory);
+
+	brasero_session_cfg_check (self);
+}
+
+gboolean
+brasero_session_cfg_is_supported (BraseroSessionCfg *self,
+				  BraseroBurnFlag flags)
+{
+	BraseroSessionCfgPrivate *priv;
+
+	priv = BRASERO_SESSION_CFG_PRIVATE (self);
+	return (priv->supported & flags) == flags;
+}
+
+gboolean
+brasero_session_cfg_is_compulsory (BraseroSessionCfg *self,
+				   BraseroBurnFlag flags)
+{
+	BraseroSessionCfgPrivate *priv;
+
+	priv = BRASERO_SESSION_CFG_PRIVATE (self);
+	return (priv->compulsory & flags) == flags;
 }
 
 static void

Modified: trunk/src/brasero-session-cfg.h
==============================================================================
--- trunk/src/brasero-session-cfg.h	(original)
+++ trunk/src/brasero-session-cfg.h	Wed Oct  8 16:24:31 2008
@@ -79,7 +79,15 @@
 void
 brasero_session_cfg_add_flags (BraseroSessionCfg *cfg,
 			       BraseroBurnFlag flags);
-
+void
+brasero_session_cfg_remove_flags (BraseroSessionCfg *cfg,
+				  BraseroBurnFlag flags);
+gboolean
+brasero_session_cfg_is_supported (BraseroSessionCfg *cfg,
+				  BraseroBurnFlag flags);
+gboolean
+brasero_session_cfg_is_compulsory (BraseroSessionCfg *cfg,
+				   BraseroBurnFlag flags);
 void
 brasero_session_cfg_disable (BraseroSessionCfg *self);
 

Modified: trunk/src/burn-caps.c
==============================================================================
--- trunk/src/burn-caps.c	(original)
+++ trunk/src/burn-caps.c	Wed Oct  8 16:24:31 2008
@@ -2567,13 +2567,28 @@
 {
 	BraseroBurnResult result;
 
+	/* See if medium is supported out of the box */
 	result = brasero_caps_get_flags_for_disc (session_flags,
 						  media,
 						  input,
 						  supported_flags,
 						  compulsory_flags);
 
-	if (result != BRASERO_BURN_OK) {
+	/* see if we can add BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE */
+	if ((media & (BRASERO_MEDIUM_HAS_AUDIO|BRASERO_MEDIUM_HAS_DATA))
+	&& !(session_flags & (BRASERO_BURN_FLAG_MERGE|BRASERO_BURN_FLAG_APPEND))
+	&&  brasero_burn_caps_can_blank_real (self, media, session_flags) == BRASERO_BURN_OK)
+		(*supported_flags) |= BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE;
+	else if (session_flags & BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE)
+		return BRASERO_BURN_NOT_SUPPORTED;
+
+	if (((*supported_flags) & BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE)) {
+		BraseroBurnFlag blank_compulsory = BRASERO_BURN_FLAG_NONE;
+		BraseroBurnFlag blank_supported = BRASERO_BURN_FLAG_NONE;
+
+		/* If BLANK flag is supported then MERGE/APPEND can't be compulsory */
+		(*compulsory_flags) &= ~(BRASERO_BURN_FLAG_MERGE|BRASERO_BURN_FLAG_APPEND);
+
 		/* we reached this point in two cases:
 		 * - if the disc cannot be handled
 		 * - if some flags are not handled
@@ -2585,23 +2600,18 @@
 		 * then write on its own. Basically that works only with
 		 * overwrite formatted discs, DVD+RW, ...) */
 
-		if (!(media & (BRASERO_MEDIUM_HAS_AUDIO|
-			       BRASERO_MEDIUM_HAS_DATA|
-			       BRASERO_MEDIUM_UNFORMATTED))) {
-			/* media must have data/audio */
-			return BRASERO_BURN_NOT_SUPPORTED;
-		}
-
-		if (session_flags & (BRASERO_BURN_FLAG_MERGE|BRASERO_BURN_FLAG_APPEND)) {
-			/* There is nothing we can do here */
-			return BRASERO_BURN_NOT_SUPPORTED;
-		}
-
-		if (brasero_burn_caps_can_blank_real (self, media, session_flags) != BRASERO_BURN_OK)
-			return BRASERO_BURN_NOT_SUPPORTED;
+		/* What's above is not entirely true. In fact we always need to
+		 * check even if we first succeeded. There are some cases like
+		 * CDRW where it's useful.
+		 * Ex: a CDRW with data appendable can be either appended (then
+		 * no DAO possible) or blanked and written (DAO possible). */
 
 		(*supported_flags) |= BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE;
-		(*compulsory_flags) |= BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE;
+
+		/* result here is the result of the first operation, so if it
+		 * failed, BLANK before becomes compulsory. */
+		if (result != BRASERO_BURN_OK)
+			(*compulsory_flags) |= BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE;
 
 		/* pretends it is blank and formatted to see if it would work.
 		 * If it works then that means that the BLANK_BEFORE_WRITE flag
@@ -2617,29 +2627,11 @@
 							  input,
 							  supported_flags,
 							  compulsory_flags);
-		if (result != BRASERO_BURN_OK)
-			return result;
-	}
-	else {
-		/* see if we can add BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE */
-		if ((media & (BRASERO_MEDIUM_HAS_AUDIO|BRASERO_MEDIUM_HAS_DATA))
-		&& !(session_flags & (BRASERO_BURN_FLAG_MERGE|BRASERO_BURN_FLAG_APPEND))
-		&&  brasero_burn_caps_can_blank_real (self, media, session_flags) == BRASERO_BURN_OK)
-			(*supported_flags) |= BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE;
-		else if (session_flags & BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE)
-			return BRASERO_BURN_NOT_SUPPORTED;
-	}
-
-	if (session_flags & BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE) {
-		/* make sure we remove MERGE/APPEND from supported and
-		 * compulsory since that's not possible anymore */
-		(*supported_flags) &= ~(BRASERO_BURN_FLAG_MERGE|BRASERO_BURN_FLAG_APPEND);
-		(*compulsory_flags) &= ~(BRASERO_BURN_FLAG_MERGE|BRASERO_BURN_FLAG_APPEND);
-	}
 
-	if ((*supported_flags) & BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE) {
-		BraseroBurnFlag blank_compulsory = BRASERO_BURN_FLAG_NONE;
-		BraseroBurnFlag blank_supported = BRASERO_BURN_FLAG_NONE;
+		/* if both attempts failed, drop it */
+		if (result != BRASERO_BURN_OK
+		&& (((*compulsory_flags) & BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE)))
+			return result;
 
 		/* need to add blanking flags */
 		brasero_burn_caps_get_blanking_flags_real (self,
@@ -2649,8 +2641,14 @@
 							   &blank_compulsory);
 		(*supported_flags) |= blank_supported;
 		(*compulsory_flags) |= blank_compulsory;
+	}
+	else if (result != BRASERO_BURN_OK)
+		return result;
 
-		/* If BLANK flag is supported then MERGE/APPEND can't be compulsory */
+	if (session_flags & BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE) {
+		/* make sure we remove MERGE/APPEND from supported and
+		 * compulsory since that's not possible anymore */
+		(*supported_flags) &= ~(BRASERO_BURN_FLAG_MERGE|BRASERO_BURN_FLAG_APPEND);
 		(*compulsory_flags) &= ~(BRASERO_BURN_FLAG_MERGE|BRASERO_BURN_FLAG_APPEND);
 	}
 
@@ -3435,6 +3433,10 @@
 
 	for (iter = default_caps->priv->caps_list; iter; iter = iter->next) {
 		caps = iter->data;
+
+		if (caps->type.type != BRASERO_TRACK_TYPE_DISC)
+			continue;
+
 		if (caps->type.subtype.media == media) {
 			BRASERO_BURN_LOG_WITH_TYPE (&caps->type,
 						    caps->flags,
@@ -3456,229 +3458,21 @@
 	return g_slist_prepend (retval, caps);
 }
 
-static GSList *
-brasero_caps_disc_new_status (GSList *retval,
-			      BraseroMedia media,
-			      BraseroMedia type)
-{
-	if ((type & BRASERO_MEDIUM_BLANK)
-	&& !(media & BRASERO_MEDIUM_ROM)) {
-		/* If media is blank there is no other possible property.
-		 * BRASERO_MEDIUM_IS (media, BRASERO_MEDIUM_DVDRW_RESTRICTED)
-		 * condition is checked but in fact it's never valid since
-		 * such a medium cannot exist if it hasn't been formatted before
-		 * which is in contradiction with the fact is unformatted. */
-		if (BRASERO_MEDIUM_IS (media, BRASERO_MEDIUM_DVDRW_PLUS)
-		||  BRASERO_MEDIUM_IS (media, BRASERO_MEDIUM_DVDRW_RESTRICTED)
-		||  BRASERO_MEDIUM_IS (media, BRASERO_MEDIUM_DVDRW)
-		||  BRASERO_MEDIUM_IS (media, BRASERO_MEDIUM_DVDRW_PLUS_DL)) {
-			/* This is only for above types */
-			retval = brasero_caps_disc_lookup_or_create (retval,
-								     media|
-								     BRASERO_MEDIUM_BLANK);
-			if (type & BRASERO_MEDIUM_UNFORMATTED)
-				retval = brasero_caps_disc_lookup_or_create (retval,
-									     media|
-									     BRASERO_MEDIUM_BLANK|
-									     BRASERO_MEDIUM_UNFORMATTED);
-		}
-		else
-			retval = brasero_caps_disc_lookup_or_create (retval,
-								     media|
-								     BRASERO_MEDIUM_BLANK);
-	}
-
-	if (type & BRASERO_MEDIUM_CLOSED) {
-		if (media & (BRASERO_MEDIUM_DVD|BRASERO_MEDIUM_DVD_DL))
-			retval = brasero_caps_disc_lookup_or_create (retval,
-								     media|
-								     BRASERO_MEDIUM_CLOSED|
-								     (type & BRASERO_MEDIUM_HAS_DATA)|
-								     (type & BRASERO_MEDIUM_PROTECTED));
-		else {
-			if (type & BRASERO_MEDIUM_HAS_AUDIO)
-				retval = brasero_caps_disc_lookup_or_create (retval,
-									     media|
-									     BRASERO_MEDIUM_CLOSED|
-									     BRASERO_MEDIUM_HAS_AUDIO);
-			if (type & BRASERO_MEDIUM_HAS_DATA)
-				retval = brasero_caps_disc_lookup_or_create (retval,
-									     media|
-									     BRASERO_MEDIUM_CLOSED|
-									     BRASERO_MEDIUM_HAS_DATA);
-			if (BRASERO_MEDIUM_IS (type, BRASERO_MEDIUM_HAS_AUDIO|BRASERO_MEDIUM_HAS_DATA))
-				retval = brasero_caps_disc_lookup_or_create (retval,
-									     media|
-									     BRASERO_MEDIUM_CLOSED|
-									     BRASERO_MEDIUM_HAS_DATA|
-									     BRASERO_MEDIUM_HAS_AUDIO);
-		}
-	}
-
-	if ((type & BRASERO_MEDIUM_APPENDABLE)
-	&& !(media & BRASERO_MEDIUM_ROM)
-	&& !(media & BRASERO_MEDIUM_RESTRICTED)
-	&& ! BRASERO_MEDIUM_IS (media, BRASERO_MEDIUM_DVD|BRASERO_MEDIUM_PLUS|BRASERO_MEDIUM_REWRITABLE)
-	&& ! BRASERO_MEDIUM_IS (media, BRASERO_MEDIUM_DVD_DL|BRASERO_MEDIUM_PLUS|BRASERO_MEDIUM_REWRITABLE)) {
-		if (media & BRASERO_MEDIUM_DVD)
-			retval = brasero_caps_disc_lookup_or_create (retval,
-								     media|
-								     BRASERO_MEDIUM_APPENDABLE|
-								     BRASERO_MEDIUM_HAS_DATA);
-		else {
-			if (type & BRASERO_MEDIUM_HAS_AUDIO)
-				retval = brasero_caps_disc_lookup_or_create (retval,
-									     media|
-									     BRASERO_MEDIUM_APPENDABLE|
-									     BRASERO_MEDIUM_HAS_AUDIO);
-			if (type & BRASERO_MEDIUM_HAS_DATA)
-				retval = brasero_caps_disc_lookup_or_create (retval,
-									     media|
-									     BRASERO_MEDIUM_APPENDABLE|
-									     BRASERO_MEDIUM_HAS_DATA);
-			if (BRASERO_MEDIUM_IS (type, BRASERO_MEDIUM_HAS_AUDIO|BRASERO_MEDIUM_HAS_DATA))
-				retval = brasero_caps_disc_lookup_or_create (retval,
-									     media|
-									     BRASERO_MEDIUM_HAS_DATA|
-									     BRASERO_MEDIUM_APPENDABLE|
-									     BRASERO_MEDIUM_HAS_AUDIO);
-		}
-	}
-
-	return retval;
-}
-
-static GSList *
-brasero_caps_disc_new_attribute (GSList *retval,
-				 BraseroMedia media,
-				 BraseroMedia type)
-{
-	if (type & BRASERO_MEDIUM_REWRITABLE) {
-		/* Always true for + media there are both single and dual layer */
-		if (media & BRASERO_MEDIUM_PLUS)
-			retval = brasero_caps_disc_new_status (retval,
-							       media|BRASERO_MEDIUM_REWRITABLE,
-							       type);
-		/* There is no dual layer DVD-RW */
-		else if (!(media & BRASERO_MEDIUM_DVD_DL))
-			retval = brasero_caps_disc_new_status (retval,
-							       media|BRASERO_MEDIUM_REWRITABLE,
-							       type);
-	}
-
-	if ((type & BRASERO_MEDIUM_WRITABLE)
-	&& !(media & BRASERO_MEDIUM_RESTRICTED))
-		retval = brasero_caps_disc_new_status (retval,
-						       media|BRASERO_MEDIUM_WRITABLE,
-						       type);
-
-	if (type & BRASERO_MEDIUM_ROM)
-		retval = brasero_caps_disc_new_status (retval,
-						       media|BRASERO_MEDIUM_ROM,
-						       type);
-
-	return retval;
-}
-
-static GSList *
-brasero_caps_disc_new_subtype (GSList *retval,
-			       BraseroMedia media,
-			       BraseroMedia type)
-{
-	if (media & BRASERO_MEDIUM_BD) {
-		if (type & BRASERO_MEDIUM_RANDOM)
-			retval = brasero_caps_disc_new_attribute (retval,
-								  media|BRASERO_MEDIUM_RANDOM,
-								  type);
-		if (type & BRASERO_MEDIUM_SRM)
-			retval = brasero_caps_disc_new_attribute (retval,
-								  media|BRASERO_MEDIUM_SRM,
-								  type);
-		if (type & BRASERO_MEDIUM_POW)
-			retval = brasero_caps_disc_new_attribute (retval,
-								  media|BRASERO_MEDIUM_POW,
-								  type);
-	}
-
-	if (media & BRASERO_MEDIUM_DVD) {
-		if (type & BRASERO_MEDIUM_SEQUENTIAL)
-			retval = brasero_caps_disc_new_attribute (retval,
-								  media|BRASERO_MEDIUM_SEQUENTIAL,
-								  type);
-
-		if (type & BRASERO_MEDIUM_RESTRICTED)
-			retval = brasero_caps_disc_new_attribute (retval,
-								  media|BRASERO_MEDIUM_RESTRICTED,
-								  type);
-
-		if (type & BRASERO_MEDIUM_PLUS)
-			retval = brasero_caps_disc_new_attribute (retval,
-								  media|BRASERO_MEDIUM_PLUS,
-								  type);
-		if (type & BRASERO_MEDIUM_ROM)
-			retval = brasero_caps_disc_new_status (retval,
-							       media|BRASERO_MEDIUM_ROM,
-							       type);
-	}
-
-	if (media & BRASERO_MEDIUM_DVD_DL) {
-		/* There is no such thing as DVD-RW DL */
-		if ((type & BRASERO_MEDIUM_SEQUENTIAL) && !(type & BRASERO_MEDIUM_REWRITABLE))
-			retval = brasero_caps_disc_new_attribute (retval,
-								  media|BRASERO_MEDIUM_SEQUENTIAL,
-								  type);
-
-		if ((type & BRASERO_MEDIUM_JUMP) && !(type & BRASERO_MEDIUM_REWRITABLE))
-			retval = brasero_caps_disc_new_attribute (retval,
-								  media|BRASERO_MEDIUM_JUMP,
-								  type);
-
-		if (type & BRASERO_MEDIUM_PLUS)
-			retval = brasero_caps_disc_new_attribute (retval,
-								  media|BRASERO_MEDIUM_PLUS,
-								  type);
-
-		if (type & BRASERO_MEDIUM_ROM)
-			retval = brasero_caps_disc_new_status (retval,
-							       media|BRASERO_MEDIUM_ROM,
-							       type);
-	}
-
-	return retval;
-}
-
 GSList *
 brasero_caps_disc_new (BraseroMedia type)
 {
 	GSList *retval = NULL;
+	GSList *list;
+	GSList *iter;
 
-	if (type & BRASERO_MEDIUM_FILE)
-		retval = brasero_caps_disc_lookup_or_create (retval, BRASERO_MEDIUM_FILE);					       
+	list = brasero_media_get_all_list (type);
+	for (iter = list; iter; iter = iter->next) {
+		BraseroMedia medium;
 
-	if (type & BRASERO_MEDIUM_CD)
-		retval = brasero_caps_disc_new_attribute (retval,
-							  BRASERO_MEDIUM_CD,
-							  type);
-
-	if (type & BRASERO_MEDIUM_DVD)
-		retval = brasero_caps_disc_new_subtype (retval,
-							BRASERO_MEDIUM_DVD,
-							type);
-
-	if (type & BRASERO_MEDIUM_DVD_DL)
-		retval = brasero_caps_disc_new_subtype (retval,
-							BRASERO_MEDIUM_DVD_DL,
-							type);
-
-	if (type & BRASERO_MEDIUM_RAM)
-		retval = brasero_caps_disc_new_attribute (retval,
-							  BRASERO_MEDIUM_RAM,
-							  type);
-
-	if (type & BRASERO_MEDIUM_BD)
-		retval = brasero_caps_disc_new_subtype (retval,
-							BRASERO_MEDIUM_BD,
-							type);
+		medium = GPOINTER_TO_INT (iter->data);
+		retval = brasero_caps_disc_lookup_or_create (retval, medium);
+	}
+	g_slist_free (list);
 
 	return retval;
 }

Modified: trunk/src/burn-medium.c
==============================================================================
--- trunk/src/burn-medium.c	(original)
+++ trunk/src/burn-medium.c	Wed Oct  8 16:24:31 2008
@@ -114,6 +114,8 @@
 	BraseroMedia info;
 	BraseroDrive *drive;
 
+	gchar *CD_TEXT_title;
+
 	/* Do we really need both? */
 	guint dummy_sao:2;
 	guint dummy_tao:2;
@@ -2608,6 +2610,121 @@
 	return BRASERO_BURN_OK;
 }
 
+static gboolean
+brasero_medium_get_CD_TEXT (BraseroMedium *medium,
+			    int type,
+			    int track_num,
+			    const char *string)
+{
+	char *utf8_string;
+	const char *charset = NULL;
+	BraseroMediumPrivate *priv;
+
+	priv = BRASERO_MEDIUM_PRIVATE (medium);
+
+	/* For the moment we're only interested in medium title but that could
+	 * be extented to all tracks information. */
+	switch (type) {
+	case BRASERO_SCSI_CD_TEXT_ALBUM_TITLE:
+		BRASERO_BURN_LOG ("Title %s", string);
+		if (track_num)
+			return FALSE;
+
+		break;
+
+	case BRASERO_SCSI_CD_TEXT_PERFORMER_NAME:
+	case BRASERO_SCSI_CD_TEXT_SONGWRITER_NAME:
+	case BRASERO_SCSI_CD_TEXT_COMPOSER_NAME:
+	case BRASERO_SCSI_CD_TEXT_ARRANGER_NAME:
+	case BRASERO_SCSI_CD_TEXT_ARTIST_NAME:
+	case BRASERO_SCSI_CD_TEXT_DISC_ID_INFO:
+	case BRASERO_SCSI_CD_TEXT_GENRE_ID_INFO:
+	case BRASERO_SCSI_CD_TEXT_UPC_EAN_ISRC:
+	case BRASERO_SCSI_CD_TEXT_BLOCK_SIZE:
+	default:
+		return FALSE;
+	}
+
+	g_get_charset (&charset);
+
+	/* it's ASCII so convert to locale */
+	utf8_string = g_convert_with_fallback (string,
+					       -1,
+					       charset,
+					       "ASCII",
+					       NULL,
+					       NULL,
+					       NULL,
+					       NULL);
+
+	if (priv->CD_TEXT_title)
+		g_free (priv->CD_TEXT_title);
+
+	priv->CD_TEXT_title = utf8_string;
+	return TRUE;
+}
+
+static void
+brasero_medium_read_CD_TEXT (BraseroMedium *self,
+			     BraseroDeviceHandle *handle,
+			     BraseroScsiErrCode *code)
+{
+	int off;
+	int track_num;
+	int num, size, i;
+	char buffer [256]; /* mmc specs advise no more than 160 */
+	BraseroMediumPrivate *priv;
+	BraseroScsiCDTextData *cd_text;
+
+	BRASERO_BURN_LOG ("Getting CD-TEXT");
+	if (brasero_mmc3_read_cd_text (handle, &cd_text, &size, code) != BRASERO_SCSI_OK) {
+		BRASERO_BURN_LOG ("GET CD-TEXT failed");
+		return;
+	}
+
+	num = (BRASERO_GET_16 (cd_text->hdr->len) -
+	      (sizeof (BraseroScsiTocPmaAtipHdr) - sizeof (cd_text->hdr->len)))  /
+	       sizeof (BraseroScsiCDTextPackData);
+
+	track_num = 0;
+	off = 0;
+
+	priv = BRASERO_MEDIUM_PRIVATE (self);
+
+	for (i = 0; i < num; i ++) {
+		int j;
+
+		track_num = cd_text->pack [i].track_num;
+
+		for (j = 0; j < sizeof (cd_text->pack [i].text); j++) {
+			if (!off && cd_text->pack [i].text [j] == '\t') {
+				/* Specs say that tab character means that's the
+				 * same string as before */
+				if (buffer [0] != '\0')
+					brasero_medium_get_CD_TEXT (self,
+								    cd_text->pack [i].type,
+								    track_num,
+								    buffer);
+				track_num ++;
+				continue;
+			}
+
+			buffer [off] = cd_text->pack [i].text [j];
+			off++;
+
+			if (cd_text->pack [i].text [j] == '\0') {
+				if (buffer [0] != '\0')
+					brasero_medium_get_CD_TEXT (self,
+								    cd_text->pack [i].type,
+								    track_num,
+								    buffer);
+				track_num ++;
+				off = 0;
+			}
+		}
+	}
+}
+
 static void
 brasero_medium_init_real (BraseroMedium *object,
 			  BraseroDeviceHandle *handle)
@@ -2641,6 +2758,10 @@
 
 	brasero_medium_init_caps (object, handle, &code);
 
+	/* read CD-TEXT title */
+	if (priv->info & BRASERO_MEDIUM_HAS_AUDIO)
+		brasero_medium_read_CD_TEXT (object, handle, &code);
+
 	BRASERO_BURN_LOG_DISC_TYPE (priv->info, "media is ");
 
 	if (!priv->wr_speeds)
@@ -2766,6 +2887,11 @@
 		priv->id = NULL;
 	}
 
+	if (priv->CD_TEXT_title) {
+		g_free (priv->CD_TEXT_title);
+		priv->CD_TEXT_title = NULL;
+	}
+
 	g_free (priv->rd_speeds);
 	priv->rd_speeds = NULL;
 
@@ -2824,6 +2950,11 @@
 		priv->id = NULL;
 	}
 
+	if (priv->CD_TEXT_title) {
+		g_free (priv->CD_TEXT_title);
+		priv->CD_TEXT_title = NULL;
+	}
+
 	g_free (priv->rd_speeds);
 	priv->rd_speeds = NULL;
 
@@ -3030,6 +3161,16 @@
 	return priv->id;
 }
 
+const gchar *
+brasero_medium_get_CD_TEXT_title (BraseroMedium *self)
+{
+	BraseroMediumPrivate *priv;
+
+	priv = BRASERO_MEDIUM_PRIVATE (self);
+	return priv->CD_TEXT_title;;
+
+}
+
 GType
 brasero_medium_get_type (void)
 {

Modified: trunk/src/burn-medium.h
==============================================================================
--- trunk/src/burn-medium.h	(original)
+++ trunk/src/burn-medium.h	Wed Oct  8 16:24:31 2008
@@ -23,6 +23,7 @@
 #include <glib-object.h>
 
 #include "burn-basics.h"
+#include "burn-media.h"
 
 #ifndef _BURN_MEDIUM_H_
 #define _BURN_MEDIUM_H_
@@ -71,120 +72,6 @@
 const gchar *
 brasero_medium_get_udi (BraseroMedium *medium);
 
-typedef enum {
-	BRASERO_MEDIUM_UNSUPPORTED		= -2,
-	BRASERO_MEDIUM_BUSY			= -1,
-	BRASERO_MEDIUM_NONE			= 0,
-
-	/* types */
-	BRASERO_MEDIUM_FILE			= 1,
-
-	BRASERO_MEDIUM_CD			= 1 << 1,
-
-	BRASERO_MEDIUM_DVD			= 1 << 2,
-
-	BRASERO_MEDIUM_DVD_DL			= 1 << 3,
-
-	BRASERO_MEDIUM_RAM			= 1 << 4,
-
-	BRASERO_MEDIUM_BD			= 1 << 5,
-
-	/* DVD and DVD DL subtypes */
-	BRASERO_MEDIUM_PLUS			= 1 << 6,
-	BRASERO_MEDIUM_SEQUENTIAL		= 1 << 7,
-	BRASERO_MEDIUM_RESTRICTED		= 1 << 8,	/* DVD only */
-
-	/* DVD dual layer only subtype */
-	BRASERO_MEDIUM_JUMP			= 1 << 9,
-
-	/* BD subtypes */
-	BRASERO_MEDIUM_RANDOM			= 1 << 10,
-	BRASERO_MEDIUM_SRM			= 1 << 11,
-	BRASERO_MEDIUM_POW			= 1 << 12,
-
-	/* discs attributes */
-	BRASERO_MEDIUM_REWRITABLE		= 1 << 14,
-	BRASERO_MEDIUM_WRITABLE			= 1 << 15,
-	BRASERO_MEDIUM_ROM			= 1 << 16,
-
-	/* status of the disc */
-	BRASERO_MEDIUM_BLANK			= 1 << 17,
-	BRASERO_MEDIUM_CLOSED			= 1 << 18,
-	BRASERO_MEDIUM_APPENDABLE		= 1 << 19,
-
-	/* Only used for DVD+RW, DVD-RW restricted */
-	BRASERO_MEDIUM_UNFORMATTED		= 1 << 20,
-
-	BRASERO_MEDIUM_PROTECTED		= 1 << 21,
-	BRASERO_MEDIUM_HAS_DATA			= 1 << 22,
-	BRASERO_MEDIUM_HAS_AUDIO		= 1 << 23,
-} BraseroMedia;
-
-#define BRASERO_MEDIUM_CDROM		(BRASERO_MEDIUM_CD|		\
-					 BRASERO_MEDIUM_ROM)
-#define BRASERO_MEDIUM_CDR		(BRASERO_MEDIUM_CD|		\
-					 BRASERO_MEDIUM_WRITABLE)
-#define BRASERO_MEDIUM_CDRW		(BRASERO_MEDIUM_CD|		\
-					 BRASERO_MEDIUM_REWRITABLE)
-#define BRASERO_MEDIUM_DVD_RAM		(BRASERO_MEDIUM_DVD|		\
-					 BRASERO_MEDIUM_RAM)
-#define BRASERO_MEDIUM_DVD_ROM		(BRASERO_MEDIUM_DVD|		\
-					 BRASERO_MEDIUM_ROM)
-#define BRASERO_MEDIUM_DVDR		(BRASERO_MEDIUM_DVD|		\
-					 BRASERO_MEDIUM_SEQUENTIAL|	\
-					 BRASERO_MEDIUM_WRITABLE)
-#define BRASERO_MEDIUM_DVDRW		(BRASERO_MEDIUM_DVD|		\
-					 BRASERO_MEDIUM_SEQUENTIAL|	\
-					 BRASERO_MEDIUM_REWRITABLE)
-#define BRASERO_MEDIUM_DVDRW_RESTRICTED	(BRASERO_MEDIUM_DVD|		\
-					 BRASERO_MEDIUM_REWRITABLE|	\
-					 BRASERO_MEDIUM_RESTRICTED)
-#define BRASERO_MEDIUM_DVDR_DL		(BRASERO_MEDIUM_DVD_DL|		\
-					 BRASERO_MEDIUM_WRITABLE|	\
-					 BRASERO_MEDIUM_SEQUENTIAL)
-#define BRASERO_MEDIUM_DVDR_JUMP_DL	(BRASERO_MEDIUM_DVD_DL|		\
-					 BRASERO_MEDIUM_WRITABLE|	\
-					 BRASERO_MEDIUM_JUMP)
-#define BRASERO_MEDIUM_DVDR_PLUS	(BRASERO_MEDIUM_DVD|		\
-					 BRASERO_MEDIUM_WRITABLE|	\
-					 BRASERO_MEDIUM_PLUS)
-#define BRASERO_MEDIUM_DVDRW_PLUS	(BRASERO_MEDIUM_DVD|		\
-					 BRASERO_MEDIUM_REWRITABLE|	\
-					 BRASERO_MEDIUM_PLUS)
-#define BRASERO_MEDIUM_DVDR_PLUS_DL	(BRASERO_MEDIUM_DVD_DL|		\
-					 BRASERO_MEDIUM_WRITABLE|	\
-					 BRASERO_MEDIUM_PLUS)
-#define BRASERO_MEDIUM_DVDRW_PLUS_DL	(BRASERO_MEDIUM_DVD_DL|		\
-					 BRASERO_MEDIUM_REWRITABLE|	\
-					 BRASERO_MEDIUM_PLUS)
-
-/* Not recognized yet */
-#define BRASERO_MEDIUM_BD_ROM		(BRASERO_MEDIUM_BD|		\
-					 BRASERO_MEDIUM_ROM)
-#define BRASERO_MEDIUM_BDR_SRM		(BRASERO_MEDIUM_BD|		\
-					 BRASERO_MEDIUM_POW|		\
-					 BRASERO_MEDIUM_SRM|		\
-					 BRASERO_MEDIUM_WRITABLE)
-#define BRASERO_MEDIUM_BDR_RANDOM	(BRASERO_MEDIUM_BD|		\
-					 BRASERO_MEDIUM_WRITABLE|	\
-					 BRASERO_MEDIUM_RANDOM)
-#define BRASERO_MEDIUM_BDRW		(BRASERO_MEDIUM_BD|		\
-					 BRASERO_MEDIUM_REWRITABLE)
-
-
-
-#define BRASERO_MEDIUM_VALID(media)	((media) != BRASERO_MEDIUM_NONE		\
-					&& (media) != BRASERO_MEDIUM_BUSY	\
-					&& (media) != BRASERO_MEDIUM_UNSUPPORTED)
-
-
-#define BRASERO_MEDIUM_TYPE(media)	((media) & 0x003F)
-#define BRASERO_MEDIUM_ATTR(media)	((media) & 0x1C000)
-#define BRASERO_MEDIUM_STATUS(media)	((media) & 0xE0000)
-#define BRASERO_MEDIUM_SUBTYPE(media)	((media) & 0x1FC0)
-#define BRASERO_MEDIUM_INFO(media)	((media) & 0xFE0000)
-
-#define BRASERO_MEDIUM_IS(media, type)	(((media)&(type))==(type))
 
 typedef enum {
 	BRASERO_MEDIUM_TRACK_NONE		= 0,
@@ -273,6 +160,9 @@
 gboolean
 brasero_medium_can_be_rewritten (BraseroMedium *medium);
 
+const gchar *
+brasero_medium_get_CD_TEXT_title (BraseroMedium *medium);
+
 gboolean
 brasero_medium_can_be_written (BraseroMedium *medium);
 

Modified: trunk/src/burn-plugin.c
==============================================================================
--- trunk/src/burn-plugin.c	(original)
+++ trunk/src/burn-plugin.c	Wed Oct  8 16:24:31 2008
@@ -36,6 +36,7 @@
 #include "burn-plugin.h"
 #include "burn-plugin-private.h"
 #include "burn-caps.h"
+#include "burn-media.h"
 
 #define BRASERO_PLUGIN_PRIORITY_KEY			"/apps/brasero/config/priority"
 
@@ -510,12 +511,22 @@
 			  BraseroBurnFlag compulsory)
 {
 	BraseroPluginPrivate *priv;
+	GSList *list;
+	GSList *iter;
 
 	priv = BRASERO_PLUGIN_PRIVATE (self);
-	priv->flags = brasero_plugin_set_flags_real (priv->flags,
-						     media,
-						     supported,
-						     compulsory);
+
+	list = brasero_media_get_all_list (media);
+	for (iter = list; iter; iter = iter->next) {
+		BraseroMedia medium;
+
+		medium = GPOINTER_TO_INT (iter->data);
+		priv->flags = brasero_plugin_set_flags_real (priv->flags,
+							     medium,
+							     supported,
+							     compulsory);
+	}
+	g_slist_free (list);
 }
 
 static gboolean
@@ -535,6 +546,7 @@
 
 	flags = brasero_plugin_get_flags (flags_list, media);
 	if (!flags) {
+
 		if (supported_retval)
 			*supported_retval = BRASERO_BURN_FLAG_NONE;
 		if (compulsory_retval)

Modified: trunk/src/burn-plugin.h
==============================================================================
--- trunk/src/burn-plugin.h	(original)
+++ trunk/src/burn-plugin.h	Wed Oct  8 16:24:31 2008
@@ -280,7 +280,7 @@
 				  BRASERO_BURN_FLAG_APPEND);
 
 #define BRASERO_PLUGIN_ADD_STANDARD_CDRW_FLAGS(plugin_MACRO)			\
-	/* Use DAO for first session since AUDIO need it to write CD-TEXT */	\
+	/* Use DAO for first session since AUDIO needs it to write CD-TEXT */	\
 	brasero_plugin_set_flags (plugin_MACRO,					\
 				  BRASERO_MEDIUM_CD|				\
 				  BRASERO_MEDIUM_REWRITABLE|			\

Modified: trunk/src/burn-volume-obj.c
==============================================================================
--- trunk/src/burn-volume-obj.c	(original)
+++ trunk/src/burn-volume-obj.c	Wed Oct  8 16:24:31 2008
@@ -699,6 +699,14 @@
 		return g_strdup (_("Image File"));
 	}
 
+	if (media & BRASERO_MEDIUM_HAS_AUDIO) {
+		const gchar *audio_name;
+
+		audio_name = brasero_medium_get_CD_TEXT_title (BRASERO_MEDIUM (self));
+		if (audio_name)
+			return g_strdup (audio_name);
+	}
+
 	volume = brasero_volume_get_gvolume (self);
 	if (!volume)
 		goto last_chance;



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