[brasero] Add a new tag to be used internally by all cdrtools apps (particularly cdrecord and cdda2wav)



commit dc1254662a6119beadc48c39f08911d0cf29ab42
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Sat Oct 10 15:49:05 2009 +0200

    Add a new tag to be used internally by all cdrtools apps (particularly cdrecord and cdda2wav)

 plugins/cdrtools/burn-cdrecord.c |   34 +++++++++++++++++++++++-----------
 plugins/cdrtools/burn-cdrtools.h |    7 +++++++
 2 files changed, 30 insertions(+), 11 deletions(-)
---
diff --git a/plugins/cdrtools/burn-cdrecord.c b/plugins/cdrtools/burn-cdrecord.c
index 4876443..2aa79fa 100644
--- a/plugins/cdrtools/burn-cdrecord.c
+++ b/plugins/cdrtools/burn-cdrecord.c
@@ -717,19 +717,31 @@ brasero_cdrecord_write_infs (BraseroCDRecord *cdrecord,
 	for (iter = tracks; iter; iter = iter->next) {
 		goffset sectors;
 		BraseroTrack *track;
+		const gchar *track_inf;
 
 		track = iter->data;
-		result = brasero_cdrecord_write_inf (cdrecord,
-						     argv,
-						     track,
-						     tmpdir,
-						     album,
-						     index,
-						     start,
-						     (iter->next == NULL),
-						     error);
-		if (result != BRASERO_BURN_OK)
-			return result;
+
+		track_inf = brasero_track_tag_lookup_string (track, BRASERO_CDRTOOLS_TRACK_INF_FILE);
+		if (track_inf) {
+			BRASERO_JOB_LOG (cdrecord, "Already existing .inf file");
+
+			/* There is already an .inf file associated with this track */
+			if (argv)
+				g_ptr_array_add (argv, g_strdup (track_inf));
+		}
+		else {
+			result = brasero_cdrecord_write_inf (cdrecord,
+							     argv,
+							     track,
+							     tmpdir,
+							     album,
+							     index,
+							     start,
+							     (iter->next == NULL),
+							     error);
+			if (result != BRASERO_BURN_OK)
+				return result;
+		}
 
 		index ++;
 		sectors = 0;
diff --git a/plugins/cdrtools/burn-cdrtools.h b/plugins/cdrtools/burn-cdrtools.h
index c28f48b..ca375fd 100644
--- a/plugins/cdrtools/burn-cdrtools.h
+++ b/plugins/cdrtools/burn-cdrtools.h
@@ -37,6 +37,13 @@ G_BEGIN_DECLS
 
 #define CDRTOOLS_DESCRIPTION		N_("cdrtools burning suite")
 
+/**
+ * This is a tag to be used to communicate additional information
+ * between cdda2wav and cdrecord. It's a string and should be
+ * used to tag tracks.
+ */
+#define BRASERO_CDRTOOLS_TRACK_INF_FILE	"track::audio::cdrecord::inf_file"
+
 G_END_DECLS
 
 #endif /* _BURN_CDRTOOLS_H */



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