[brasero/gnome-2-30] Introduces a function to check flags according to input for a recording link



commit efc2d3b5f40c727f4eef433d4125a232201cac2a
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Sat May 15 18:04:07 2010 +0200

    Introduces a function to check flags according to input for a recording link

 libbrasero-burn/burn-caps.c |   23 +++++++++++++++++++++++
 libbrasero-burn/burn-caps.h |    4 ++++
 2 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/libbrasero-burn/burn-caps.c b/libbrasero-burn/burn-caps.c
index 5f619e3..50e5f3f 100644
--- a/libbrasero-burn/burn-caps.c
+++ b/libbrasero-burn/burn-caps.c
@@ -67,6 +67,29 @@ brasero_caps_link_free (BraseroCapsLink *link)
 	g_free (link);
 }
 
+BraseroBurnResult
+brasero_caps_link_check_recorder_flags_for_input (BraseroCapsLink *link,
+                                                  BraseroBurnFlag session_flags)
+{
+	if (brasero_track_type_get_has_image (&link->caps->type)) {
+		BraseroImageFormat format;
+
+		format = brasero_track_type_get_image_format (&link->caps->type);
+		if (format == BRASERO_IMAGE_FORMAT_CUE
+		||  format == BRASERO_IMAGE_FORMAT_CDRDAO) {
+			if ((session_flags & BRASERO_BURN_FLAG_DAO) == 0)
+				return BRASERO_BURN_NOT_SUPPORTED;
+		}
+		else if (format == BRASERO_IMAGE_FORMAT_CLONE) {
+			/* RAW write mode should (must) only be used in this case */
+			if ((session_flags & BRASERO_BURN_FLAG_RAW) == 0)
+				return BRASERO_BURN_NOT_SUPPORTED;
+		}
+	}
+
+	return BRASERO_BURN_OK;
+}
+
 gboolean
 brasero_caps_link_active (BraseroCapsLink *link,
                           gboolean ignore_plugin_errors)
diff --git a/libbrasero-burn/burn-caps.h b/libbrasero-burn/burn-caps.h
index d2737e1..d51f72d 100644
--- a/libbrasero-burn/burn-caps.h
+++ b/libbrasero-burn/burn-caps.h
@@ -113,6 +113,10 @@ gboolean
 brasero_caps_is_compatible_type (const BraseroCaps *caps,
 				 const BraseroTrackType *type);
 
+BraseroBurnResult
+brasero_caps_link_check_recorder_flags_for_input (BraseroCapsLink *link,
+                                                  BraseroBurnFlag session_flags);
+
 G_END_DECLS
 
 #endif /* BURN_CAPS_H */



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