brasero r1745 - in trunk: . docs/reference libbrasero-media



Author: philippr
Date: Mon Jan 12 21:37:53 2009
New Revision: 1745
URL: http://svn.gnome.org/viewvc/brasero?rev=1745&view=rev

Log:
2009-01-12  Philippe Rouquier  <ykw localhost localdomain>

	A few fixes and some more documentation

	* docs/reference/brasero-docs.sgml:
	* libbrasero-media/brasero-drive-selection.c
	(brasero_drive_selection_class_init):
	* libbrasero-media/brasero-media.c:
	* libbrasero-media/brasero-medium.c
	(brasero_medium_supported_flags), (brasero_medium_support_flags),
	(brasero_medium_class_init):

Modified:
   trunk/ChangeLog
   trunk/docs/reference/brasero-docs.sgml
   trunk/libbrasero-media/brasero-drive-selection.c
   trunk/libbrasero-media/brasero-media.c
   trunk/libbrasero-media/brasero-medium.c

Modified: trunk/docs/reference/brasero-docs.sgml
==============================================================================
--- trunk/docs/reference/brasero-docs.sgml	(original)
+++ trunk/docs/reference/brasero-docs.sgml	Mon Jan 12 21:37:53 2009
@@ -16,6 +16,7 @@
     <title>API Reference</title>
     <xi:include href="xml/brasero-drive-selection.xml"/>
     <xi:include href="xml/brasero-drive.xml"/>
+    <xi:include href="xml/brasero-medium.xml"/>
     <xi:include href="xml/brasero-media.xml"/>
     <xi:include href="xml/brasero-medium-monitor.xml"/>
     <xi:include href="xml/brasero-medium-selection.xml"/>

Modified: trunk/libbrasero-media/brasero-drive-selection.c
==============================================================================
--- trunk/libbrasero-media/brasero-drive-selection.c	(original)
+++ trunk/libbrasero-media/brasero-drive-selection.c	Mon Jan 12 21:37:53 2009
@@ -103,21 +103,30 @@
         g_type_class_add_private (klass, sizeof (BraseroDriveSelectionPrivate));
 
         /* Properties */
-        g_object_class_install_property (object_class,
-                                         PROP_DRIVE,
+        g_object_class_install_property (object_class, PROP_DRIVE,
                                          g_param_spec_object ("drive",
                                                               _("Drive"),
-                                                              NULL,
+                                                              "The drive currently selected",
                                                               BRASERO_TYPE_DRIVE,
                                                               G_PARAM_READWRITE));
+        
         g_object_class_install_property (object_class, PROP_DRIVE_TYPE,
-                                         g_param_spec_uint ("drive-type", NULL, NULL,
+                                         g_param_spec_uint ("drive-type",
+                                                            "Drive type",
+                                                            "The drive types used to filter",
                                                             0, 255, BRASERO_DRIVE_TYPE_ALL_BUT_FILE,
                                                             G_PARAM_READWRITE));
 
-        /* Signals */
+	/**
+ 	* BraseroDriveSelection::drive_changed:
+ 	* @selection: the object which received the signal
+  	* @drive: the new drive which is selected
+	*
+ 	* This signal gets emitted when the selected drive has changed
+ 	*
+ 	*/
         brasero_drive_selection_table_signals [DRIVE_CHANGED] =
-                g_signal_new ("drive-changed",
+                g_signal_new ("drive_changed",
                               G_TYPE_FROM_CLASS (object_class),
                               G_SIGNAL_RUN_LAST,
                               G_STRUCT_OFFSET (BraseroDriveSelectionClass,
@@ -363,6 +372,7 @@
  * Create a new drive selector.
  *
  * Return value: Newly allocated #BraseroDriveSelection widget
+ *
  **/
 GtkWidget *
 brasero_drive_selection_new (void)
@@ -467,8 +477,6 @@
  * Set the current selected drive to that which corresponds to the
  * specified drive.
  *
- * Since: 2.14
- *
  **/
 void
 brasero_drive_selection_set_active (BraseroDriveSelection *selection,
@@ -497,8 +505,6 @@
  * Return value: currently selected #BraseroDrive.  The drive must be
  * unreffed using nautilus_burn_drive_unref after use.
  *
- * Since: 2.14
- *
  **/
 BraseroDrive *
 brasero_drive_selection_get_active (BraseroDriveSelection *selection)

Modified: trunk/libbrasero-media/brasero-media.c
==============================================================================
--- trunk/libbrasero-media/brasero-media.c	(original)
+++ trunk/libbrasero-media/brasero-media.c	Mon Jan 12 21:37:53 2009
@@ -452,6 +452,7 @@
  * You should add this to your GOptionContext if your are using g_option_context_parse ()
  * to parse your commandline arguments.
  *
+ * Return value: a #GOptionGroup *
  **/
 GOptionGroup *
 brasero_media_get_option_group (void)
@@ -503,6 +504,8 @@
  *
  * Initialize the library.
  *
+ * You should call this function before using any other from the library.
+ *
  **/
 void
 brasero_media_library_start (void)
@@ -526,7 +529,7 @@
 /**
  * brasero_media_stop:
  *
- * De-initialize the library.
+ * De-initialize the library once you do not need the library anymore.
  *
  **/
 void

Modified: trunk/libbrasero-media/brasero-medium.c
==============================================================================
--- trunk/libbrasero-media/brasero-medium.c	(original)
+++ trunk/libbrasero-media/brasero-medium.c	Mon Jan 12 21:37:53 2009
@@ -162,6 +162,77 @@
 
 static GObjectClass* parent_class = NULL;
 
+/**
+ * This one is not supposed to be public API. It's declared in burn-caps.c
+ */
+
+BraseroBurnFlag
+brasero_medium_supported_flags (BraseroMedium *self,
+				BraseroBurnFlag flags)
+{
+	BraseroMediumPrivate *priv;
+
+	priv = BRASERO_MEDIUM_PRIVATE (self);
+
+	/* This is always FALSE */
+	if (priv->info & BRASERO_MEDIUM_PLUS)
+		flags &= ~BRASERO_BURN_FLAG_DUMMY;
+	/* Simulation is only possible according to write modes. This mode is
+	 * mostly used by cdrecord/wodim for CLONE images. */
+	else if (priv->info & BRASERO_MEDIUM_DVD) {
+		if (priv->dummy_sao != BRASERO_MEDIUM_CAP_TRUE)
+			flags &= ~BRASERO_BURN_FLAG_DUMMY;
+	}
+	else if (flags & BRASERO_BURN_FLAG_DAO) {
+		if (priv->dummy_sao != BRASERO_MEDIUM_CAP_TRUE)
+			flags &= ~BRASERO_BURN_FLAG_DUMMY;
+	}
+	else if (priv->dummy_tao != BRASERO_MEDIUM_CAP_TRUE)
+		flags &= ~BRASERO_BURN_FLAG_DUMMY;
+
+	if (!priv->burnfree)
+		flags &= ~BRASERO_BURN_FLAG_BURNPROOF;
+
+	return flags;
+}
+
+/**
+ * This one is not supposed to be public API. It's declared in burn-caps.c
+ */
+
+gboolean
+brasero_medium_support_flags (BraseroMedium *self,
+			      BraseroBurnFlag flags)
+{
+	BraseroMediumPrivate *priv;
+
+	priv = BRASERO_MEDIUM_PRIVATE (self);
+
+	if (flags & BRASERO_BURN_FLAG_DUMMY) {
+		/* This is always FALSE */
+		if (priv->info & BRASERO_MEDIUM_PLUS)
+			return FALSE;
+
+		if (priv->info & BRASERO_MEDIUM_DVD) {
+			if (priv->dummy_sao != BRASERO_MEDIUM_CAP_TRUE)
+				return FALSE;
+		}
+		else if (flags & BRASERO_BURN_FLAG_DAO) {
+			if (priv->dummy_sao != BRASERO_MEDIUM_CAP_TRUE)
+				return FALSE;
+		}
+		else if (priv->dummy_tao != BRASERO_MEDIUM_CAP_TRUE)
+			return FALSE;
+	}
+
+	if (flags & BRASERO_BURN_FLAG_BURNPROOF) {
+		if (!priv->burnfree)
+			return FALSE;
+	}
+
+	return TRUE;
+}
+
 gchar *
 brasero_medium_get_tooltip (BraseroMedium *self)
 {
@@ -226,6 +297,15 @@
 	return label;
 }
 
+/**
+ * brasero_medium_get_type_string:
+ * @medium: #BraseroMedium
+ *
+ * Returns the medium type as a string to be displayed in a UI.
+ *
+ * Return value: a #gchar *.
+ *
+ **/
 const gchar *
 brasero_medium_get_type_string (BraseroMedium *medium)
 {
@@ -235,6 +315,15 @@
 	return priv->type;
 }
 
+/**
+ * brasero_medium_get_status:
+ * @medium: #BraseroMedium
+ *
+ * Gets the medium type and state.
+ *
+ * Return value: a #BraseroMedia.
+ *
+ **/
 BraseroMedia
 brasero_medium_get_status (BraseroMedium *medium)
 {
@@ -248,76 +337,16 @@
 }
 
 /**
- * This one is not supposed to be public API. It's declared in burn-caps.c
- */
-
-BraseroBurnFlag
-brasero_medium_supported_flags (BraseroMedium *self,
-				BraseroBurnFlag flags)
-{
-	BraseroMediumPrivate *priv;
-
-	priv = BRASERO_MEDIUM_PRIVATE (self);
-
-	/* This is always FALSE */
-	if (priv->info & BRASERO_MEDIUM_PLUS)
-		flags &= ~BRASERO_BURN_FLAG_DUMMY;
-	/* Simulation is only possible according to write modes. This mode is
-	 * mostly used by cdrecord/wodim for CLONE images. */
-	else if (priv->info & BRASERO_MEDIUM_DVD) {
-		if (priv->dummy_sao != BRASERO_MEDIUM_CAP_TRUE)
-			flags &= ~BRASERO_BURN_FLAG_DUMMY;
-	}
-	else if (flags & BRASERO_BURN_FLAG_DAO) {
-		if (priv->dummy_sao != BRASERO_MEDIUM_CAP_TRUE)
-			flags &= ~BRASERO_BURN_FLAG_DUMMY;
-	}
-	else if (priv->dummy_tao != BRASERO_MEDIUM_CAP_TRUE)
-		flags &= ~BRASERO_BURN_FLAG_DUMMY;
-
-	if (!priv->burnfree)
-		flags &= ~BRASERO_BURN_FLAG_BURNPROOF;
-
-	return flags;
-}
-
-/**
- * This one is not supposed to be public API. It's declared in burn-caps.c
- */
-
-gboolean
-brasero_medium_support_flags (BraseroMedium *self,
-			      BraseroBurnFlag flags)
-{
-	BraseroMediumPrivate *priv;
-
-	priv = BRASERO_MEDIUM_PRIVATE (self);
-
-	if (flags & BRASERO_BURN_FLAG_DUMMY) {
-		/* This is always FALSE */
-		if (priv->info & BRASERO_MEDIUM_PLUS)
-			return FALSE;
-
-		if (priv->info & BRASERO_MEDIUM_DVD) {
-			if (priv->dummy_sao != BRASERO_MEDIUM_CAP_TRUE)
-				return FALSE;
-		}
-		else if (flags & BRASERO_BURN_FLAG_DAO) {
-			if (priv->dummy_sao != BRASERO_MEDIUM_CAP_TRUE)
-				return FALSE;
-		}
-		else if (priv->dummy_tao != BRASERO_MEDIUM_CAP_TRUE)
-			return FALSE;
-	}
-
-	if (flags & BRASERO_BURN_FLAG_BURNPROOF) {
-		if (!priv->burnfree)
-			return FALSE;
-	}
-
-	return TRUE;
-}
-
+ * brasero_medium_get_last_data_track_address:
+ * @medium: #BraseroMedium
+ * @byte: a #gint64 * or NULL
+ * @sector: a #gint64 * or NULL
+ *
+ * Stores in either @byte (in bytes) or in @sector (in blocks) the address where
+ * the last session starts. This is useful when creating a multisession image or
+ * when reading the contents of this last track.
+ *
+ **/
 gboolean
 brasero_medium_get_last_data_track_address (BraseroMedium *medium,
 					    gint64 *byte,
@@ -354,6 +383,16 @@
 	return TRUE;
 }
 
+/**
+ * brasero_medium_get_last_data_track_space:
+ * @medium: #BraseroMedium
+ * @size: a #gint64 * or NULL
+ * @blocks: a #gint64 * or NULL
+ *
+ * Stores in either @size (in bytes) or in @blocks (in blocks) the space used by
+ * the last track on the medium.
+ *
+ **/
 gboolean
 brasero_medium_get_last_data_track_space (BraseroMedium *medium,
 					  gint64 *size,
@@ -389,6 +428,15 @@
 	return TRUE;
 }
 
+/**
+ * brasero_medium_get_track_num:
+ * @medium: #BraseroMedium
+ *
+ * Gets the number of tracks on the medium.
+ *
+ * Return value: a #guint.
+ *
+ **/
 guint
 brasero_medium_get_track_num (BraseroMedium *medium)
 {
@@ -436,6 +484,20 @@
 	return NULL;
 }
 
+/**
+ * brasero_medium_get_track_space:
+ * @medium: a #BraseroMedium
+ * @num: a #guint
+ * @size: a #gint64 * or NULL
+ * @blocks: a #gint64 * or NULL
+ *
+ * Stores in either @size (in bytes) or in @blocks (in blocks) the space used
+ * by session @num on the disc.
+ *
+ * Return value: a #gboolean. Returns TRUE if information could be retrieved;
+ * FALSE otherwise (usually when track @num doesn't exist).
+ *
+ **/
 gboolean
 brasero_medium_get_track_space (BraseroMedium *medium,
 				guint num,
@@ -464,6 +526,20 @@
 	return TRUE;
 }
 
+/**
+ * brasero_medium_get_track_address:
+ * @medium: a #BraseroMedium
+ * @num: a #guint
+ * @byte: a #gint64 * or NULL
+ * @sector: a #gint64 * or NULL
+ *
+ * Stores in either @byte (in bytes) or in @sector (in blocks) the address at
+ * which the session identified by @num starts.
+ *
+ * Return value: a #gboolean. Returns TRUE if information could be retrieved;
+ * FALSE otherwise (usually when track @num doesn't exist).
+ *
+ **/
 gboolean
 brasero_medium_get_track_address (BraseroMedium *medium,
 				  guint num,
@@ -492,6 +568,15 @@
 	return TRUE;	
 }
 
+/**
+ * brasero_medium_get_next_writable_address:
+ * @medium: #BraseroMedium
+ *
+ * Gets the address (block number) that can be used to write a new session on @medium
+ *
+ * Return value: a #gint64.
+ *
+ **/
 gint64
 brasero_medium_get_next_writable_address (BraseroMedium *medium)
 {
@@ -519,6 +604,16 @@
 	return priv->next_wr_add;
 }
 
+/**
+ * brasero_medium_get_max_write_speed:
+ * @medium: #BraseroMedium
+ *
+ * Gets the maximum speed that can be used to write to @medium.
+ * Note: the speed are in B/sec.
+ *
+ * Return value: a #gint64.
+ *
+ **/
 gint64
 brasero_medium_get_max_write_speed (BraseroMedium *medium)
 {
@@ -528,6 +623,16 @@
 	return priv->max_wrt * 1000;
 }
 
+/**
+ * brasero_medium_get_write_speeds:
+ * @medium: #BraseroMedium
+ *
+ * Gets an array holding all possible speeds to write to @medium.
+ * Note: the speed are in B/sec.
+ *
+ * Return value: a #gint64 *.
+ *
+ **/
 gint64 *
 brasero_medium_get_write_speeds (BraseroMedium *medium)
 {
@@ -576,6 +681,16 @@
  * session is always equal to the size of the disc. 
  */
 
+/**
+ * brasero_medium_get_data_size:
+ * @medium: #BraseroMedium
+ * @size: a #gint64 * or NULL
+ * @blocks: a #gint64 * or NULL
+ *
+ * Stores in either @size (in bytes) or @blocks (the number of blocks) the size
+ * used to store data (including audio on CDs) on the disc.
+ *
+ **/
 void
 brasero_medium_get_data_size (BraseroMedium *medium,
 			      gint64 *size,
@@ -615,6 +730,16 @@
 		*blocks = track ? track->start + track->blocks_num: 0;
 }
 
+/**
+ * brasero_medium_get_free_space:
+ * @medium: #BraseroMedium
+ * @size: a #gint64 * or NULL
+ * @blocks: a #gint64 * or NULL
+ *
+ * Stores in either @size (in bytes) or @blocks (the number of blocks) the space
+ * on the disc that can be used for writing.
+ *
+ **/
 void
 brasero_medium_get_free_space (BraseroMedium *medium,
 			       gint64 *size,
@@ -683,6 +808,18 @@
 	}
 }
 
+/**
+ * brasero_medium_get_capacity:
+ * @medium: #BraseroMedium
+ * @size: a #gint64 * or NULL
+ * @blocks: a #gint64 * or NULL
+ *
+ * Stores in either @size (in bytes) or @blocks (the number of blocks) the total
+ * disc space.
+ * Note that when the disc is closed this space is the one occupied by data. 
+ * Otherwise it is the sum of free and used space.
+ *
+ **/
 void
 brasero_medium_get_capacity (BraseroMedium *medium,
 			     gint64 *size,
@@ -3334,6 +3471,14 @@
 	object_class->set_property = brasero_medium_set_property;
 	object_class->get_property = brasero_medium_get_property;
 
+	/**
+ 	* BraseroMedium::probed:
+ 	* @medium: the object which received the signal
+	*
+ 	* This signal gets emitted when the medium inside the drive has been
+	* fully probed. This is mostly for internal use.
+ 	*
+ 	*/
 	medium_signals[PROBED] =
 		g_signal_new ("probed",
 		              G_OBJECT_CLASS_TYPE (klass),
@@ -3347,12 +3492,22 @@
 	g_object_class_install_property (object_class,
 	                                 PROP_DRIVE,
 	                                 g_param_spec_object ("drive",
-	                                                      "drive",
-	                                                      "drive in which medium is inserted",
+	                                                      "Drive",
+	                                                      "Drive in which medium is inserted",
 	                                                      BRASERO_TYPE_DRIVE,
 	                                                      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 }
 
+/**
+ * brasero_medium_can_be_written:
+ * @medium: #BraseroMedium
+ *
+ * Gets whether the medium can be written. It also checks that the medium can
+ * write the medium.
+ *
+ * Return value: a #gboolean. TRUE if the medium can be rewritten, FALSE otherwise.
+ *
+ **/
 gboolean
 brasero_medium_can_be_written (BraseroMedium *self)
 {
@@ -3399,6 +3554,16 @@
 	return FALSE;
 }
 
+/**
+ * brasero_medium_can_be_rewritten:
+ * @medium: #BraseroMedium
+ *
+ * Gets whether the medium can be rewritten. Note: it also checks that the drive
+ * can rewrite the medium type.
+ *
+ * Return value: a #gboolean. TRUE if the medium can be rewritten, FALSE otherwise.
+ *
+ **/
 gboolean
 brasero_medium_can_be_rewritten (BraseroMedium *self)
 {
@@ -3430,6 +3595,15 @@
 	return FALSE;
 }
 
+/**
+ * brasero_medium_get_drive:
+ * @medium: #BraseroMedium
+ *
+ * Gets the #BraseroDrive in which the medium is inserted.
+ *
+ * Return value: a #BraseroDrive.
+ *
+ **/
 BraseroDrive *
 brasero_medium_get_drive (BraseroMedium *self)
 {
@@ -3442,15 +3616,15 @@
 	return priv->drive;
 }
 
-const gchar *
-brasero_medium_get_id (BraseroMedium *self)
-{
-	BraseroMediumPrivate *priv;
-
-	priv = BRASERO_MEDIUM_PRIVATE (self);
-	return priv->id;
-}
-
+/**
+ * brasero_medium_get_CD_TEXT_title:
+ * @medium: #BraseroMedium
+ *
+ * Gets the CD-TEXT title for @Medium.
+ *
+ * Return value: a #gchar *.
+ *
+ **/
 const gchar *
 brasero_medium_get_CD_TEXT_title (BraseroMedium *self)
 {



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