brasero r1770 - in trunk: . data src/plugins/cdrdao



Author: philippr
Date: Sat Jan 17 13:07:56 2009
New Revision: 1770
URL: http://svn.gnome.org/viewvc/brasero?rev=1770&view=rev

Log:
2009-01-17  Philippe Rouquier  <bonfire-app wanadoo fr>

	Work around for some drives/setups with cdrdao
	Fix #561451 â Cannot burn CDs with brasero

	Patch by Luis Medinas

	* data/brasero.schemas.in:
	* src/plugins/cdrdao/Makefile.am:
	* src/plugins/cdrdao/burn-cdrdao.c
	(brasero_cdrdao_set_argv_record), (brasero_cdrdao_class_init),
	(brasero_cdrdao_init), (brasero_cdrdao_export_caps):


Modified:
   trunk/ChangeLog
   trunk/data/brasero.schemas.in
   trunk/src/plugins/cdrdao/Makefile.am
   trunk/src/plugins/cdrdao/burn-cdrdao.c

Modified: trunk/data/brasero.schemas.in
==============================================================================
--- trunk/data/brasero.schemas.in	(original)
+++ trunk/data/brasero.schemas.in	Sat Jan 17 13:07:56 2009
@@ -54,6 +54,19 @@
 	</locale>
        </schema>
 
+     <schema>
+	<key>/schemas/apps/brasero/config/raw_flag</key>
+	<applyto>/apps/brasero/config/raw_flag</applyto>
+	<owner>brasero</owner>
+	<type>bool</type>
+	<default>false</default>
+	<locale name="C">
+	<short>Whether to use "--driver generic-mmc-raw" flag with cdrdao</short>
+	<long>Whether to use "--driver generic-mmc-raw" flag with
+	cdrdao. Set to True, brasero won't use it; it may be a workaround for some drives/setups.</long>
+	</locale>
+      </schema> 
+
       <schema>
         <key>/schemas/apps/brasero/display/sidepane</key>
 	<applyto>/apps/brasero/display/sidepane</applyto>

Modified: trunk/src/plugins/cdrdao/Makefile.am
==============================================================================
--- trunk/src/plugins/cdrdao/Makefile.am	(original)
+++ trunk/src/plugins/cdrdao/Makefile.am	Sat Jan 17 13:07:56 2009
@@ -10,14 +10,15 @@
 	-DBRASERO_DATADIR=\"$(datadir)/brasero\"     	    	\
 	-DBRASERO_LIBDIR=\"$(libdir)\"  	         	\
 	$(DISABLE_DEPRECATED)				\
-	$(BRASERO_GLIB_CFLAGS)
+	$(BRASERO_GLIB_CFLAGS)				\
+	$(BRASERO_GCONF_CFLAGS)
 
 #cdrdao
 cdrdaodir = $(libdir)/brasero/plugins
 cdrdao_LTLIBRARIES = libbrasero-cdrdao.la
 libbrasero_cdrdao_la_SOURCES = burn-cdrdao.c burn-cdrdao.h \
 	burn-cdrdao-common.h 
-libbrasero_cdrdao_la_LIBADD = $(BRASERO_GLIB_LIBS)
+libbrasero_cdrdao_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GCONF_CFLAGS)
 libbrasero_cdrdao_la_LDFLAGS = -module -avoid-version
 
 #toc2cue

Modified: trunk/src/plugins/cdrdao/burn-cdrdao.c
==============================================================================
--- trunk/src/plugins/cdrdao/burn-cdrdao.c	(original)
+++ trunk/src/plugins/cdrdao/burn-cdrdao.c	Sat Jan 17 13:07:56 2009
@@ -39,6 +39,8 @@
 #include <glib/gstdio.h>
 #include <gmodule.h>
 
+#include <gconf/gconf-client.h>
+
 #include "burn-cdrdao-common.h"
 #include "burn-cdrdao.h"
 #include "burn-basics.h"
@@ -50,8 +52,16 @@
 
 BRASERO_PLUGIN_BOILERPLATE (BraseroCdrdao, brasero_cdrdao, BRASERO_TYPE_PROCESS, BraseroProcess);
 
+struct _BraseroCdrdaoPrivate {
+  	guint use_raw:1;
+};
+typedef struct _BraseroCdrdaoPrivate BraseroCdrdaoPrivate;
+#define BRASERO_CDRDAO_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_CDRDAO, BraseroCdrdaoPrivate)) 
+
 static GObjectClass *parent_class = NULL;
 
+#define GCONF_KEY_RAW_FLAG "/apps/brasero/config/raw_flag" 
+
 static gboolean
 brasero_cdrdao_read_stderr_image (BraseroCdrdao *cdrdao, const gchar *line)
 {
@@ -299,6 +309,9 @@
 				GPtrArray *argv)
 {
 	BraseroTrackType type;
+	BraseroCdrdaoPrivate *priv;
+
+	priv = BRASERO_CDRDAO_PRIVATE (cdrdao); 
 
 	g_ptr_array_add (argv, g_strdup ("cdrdao"));
 
@@ -317,6 +330,9 @@
 		if (flags & BRASERO_BURN_FLAG_NO_TMP_FILES)
 			g_ptr_array_add (argv, g_strdup ("--on-the-fly"));
 
+		if (priv->use_raw)
+		  	g_ptr_array_add (argv, g_strdup ("--driver generic-mmc-raw")); 
+
 		g_ptr_array_add (argv, g_strdup ("--source-device"));
 
 		brasero_job_get_current_track (BRASERO_JOB (cdrdao), &track);
@@ -527,6 +543,8 @@
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
 	BraseroProcessClass *process_class = BRASERO_PROCESS_CLASS (klass);
 
+	g_type_class_add_private (klass, sizeof(BraseroCdrdaoPrivate));
+
 	parent_class = g_type_class_peek_parent(klass);
 	object_class->finalize = brasero_cdrdao_finalize;
 
@@ -537,7 +555,20 @@
 
 static void
 brasero_cdrdao_init (BraseroCdrdao *obj)
-{  }
+{  
+	GConfClient *client;
+ 	BraseroCdrdaoPrivate *priv;
+ 	
+	/* load our "configuration" */
+ 	priv = BRASERO_CDRDAO_PRIVATE (obj);
+ 	
+ 	client = gconf_client_get_default ();
+ 	priv->use_raw = gconf_client_get_bool (client,
+					       GCONF_KEY_RAW_FLAG,
+					       NULL);
+
+ 	g_object_unref (client); 
+}
 
 static void
 brasero_cdrdao_finalize (GObject *object)
@@ -551,6 +582,7 @@
 	GSList *input;
 	GSList *output;
 	BraseroBurnResult result;
+	BraseroPluginConfOption *use_raw; 
 	const BraseroMedia media_w = BRASERO_MEDIUM_CD|
 				     BRASERO_MEDIUM_WRITABLE|
 				     BRASERO_MEDIUM_REWRITABLE|
@@ -630,6 +662,12 @@
 					BRASERO_BURN_FLAG_FAST_BLANK,
 					BRASERO_BURN_FLAG_NONE);
 
+	use_raw = brasero_plugin_conf_option_new (GCONF_KEY_RAW_FLAG,
+						  _("Enable \"--driver generic-mmc-raw\" flag (see cdrdao manual)"),
+						  BRASERO_PLUGIN_OPTION_BOOL);
+
+	brasero_plugin_add_conf_option (plugin, use_raw);
+
 	brasero_plugin_register_group (plugin, _(CDRDAO_DESCRIPTION));
 	return BRASERO_BURN_OK;
 }



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