[Goodies-commits] r4972 - xfburn/trunk/xfburn

David Mohr squisher at xfce.org
Fri Jun 20 06:01:33 CEST 2008


Author: squisher
Date: 2008-06-20 04:01:33 +0000 (Fri, 20 Jun 2008)
New Revision: 4972

Modified:
   xfburn/trunk/xfburn/xfburn-burn-data-composition-base-dialog.c
   xfburn/trunk/xfburn/xfburn-device-box.c
   xfburn/trunk/xfburn/xfburn-device-list.c
Log:
Implementing setting of burn speed.

WARNING: my dvd test burn failed if a speed was set!! CD was ok though.

Use "Max" as speed if that is the case for you to get the old behavior,
and _please_ report this as a bug! Please include the console output if
debug is enabled, or otherwise some info on the burner that was used.


Modified: xfburn/trunk/xfburn/xfburn-burn-data-composition-base-dialog.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-burn-data-composition-base-dialog.c	2008-06-20 01:01:22 UTC (rev 4971)
+++ xfburn/trunk/xfburn/xfburn-burn-data-composition-base-dialog.c	2008-06-20 04:01:33 UTC (rev 4972)
@@ -470,8 +470,8 @@
   }
 
   burn_write_opts_set_simulate(burn_options, params->dummy ? 1 : 0);
-  DBG ("TODO set speed");
-  burn_drive_set_speed (drive, 0, 0);
+  DBG ("Set speed to %d kb/s", params->speed);
+  burn_drive_set_speed (drive, 0, params->speed);
   burn_write_opts_set_underrun_proof (burn_options, params->burnfree ? 1 : 0);
 
   xfburn_perform_burn_write (dialog_progress, drive, params->write_mode, burn_options, disc);

Modified: xfburn/trunk/xfburn/xfburn-device-box.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-device-box.c	2008-06-20 01:01:22 UTC (rev 4971)
+++ xfburn/trunk/xfburn/xfburn-device-box.c	2008-06-20 04:01:33 UTC (rev 4972)
@@ -477,6 +477,9 @@
   XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (box);
   GtkTreeModel *model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->combo_speed));
   GSList *el = device->supported_cdr_speeds;
+  int profile_no = xfburn_device_list_get_profile_no ();
+  int factor;
+  GtkTreeIter iter_max;
 
   gtk_list_store_clear (GTK_LIST_STORE (model));
 
@@ -495,20 +498,38 @@
     gtk_list_store_set (GTK_LIST_STORE (model), &iter, SPEED_TEXT_COLUMN, str, SPEED_VALUE_COLUMN, -1, -1);
   }
 
+  /* check profile, so we can convert from 'kb/s' into 'x' rating */
+  if (profile_no != 0) {
+    /* this will fail if newer disk types get supported */
+    if (profile_no <= 0x0a)
+      factor = CDR_1X_SPEED;
+    else
+      /* assume DVD for now */
+      factor = DVD_1X_SPEED;
+  } else {
+    factor = 1;
+  }
+
   while (el) {
-    gint speed = GPOINTER_TO_INT (el->data);
+    gint write_speed = GPOINTER_TO_INT (el->data);
     GtkTreeIter iter;
     gchar *str = NULL;
+    gint speed;
 
+    speed = write_speed / factor;
     str = g_strdup_printf ("%d", speed);
+    //DBG ("added speed: %d kb/s => %d x", el->write_speed, speed);
 
     gtk_list_store_append (GTK_LIST_STORE (model), &iter);
-    gtk_list_store_set (GTK_LIST_STORE (model), &iter, SPEED_TEXT_COLUMN, str, SPEED_VALUE_COLUMN, speed, -1);
+    gtk_list_store_set (GTK_LIST_STORE (model), &iter, SPEED_TEXT_COLUMN, str, SPEED_VALUE_COLUMN, write_speed, -1);
     g_free (str);
 
     el = g_slist_next (el);
   }
   gtk_combo_box_set_active (GTK_COMBO_BOX (priv->combo_speed), gtk_tree_model_iter_n_children (model, NULL) - 1);
+
+  gtk_list_store_append (GTK_LIST_STORE (model), &iter_max);
+  gtk_list_store_set (GTK_LIST_STORE (model), &iter_max, SPEED_TEXT_COLUMN, _("Max"), SPEED_VALUE_COLUMN, 0, -1);
 }
 
 static void

Modified: xfburn/trunk/xfburn/xfburn-device-list.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-device-list.c	2008-06-20 01:01:22 UTC (rev 4971)
+++ xfburn/trunk/xfburn/xfburn-device-list.c	2008-06-20 04:01:33 UTC (rev 4972)
@@ -86,7 +86,6 @@
 refresh_supported_speeds (XfburnDevice * device, struct burn_drive_info *drive_info)
 {
   struct burn_speed_descriptor *speed_list = NULL;
-  int factor;
   gint ret;
   /*
   int status, num_formats;
@@ -148,26 +147,13 @@
 
   if (ret > 0 && speed_list != NULL) {
     struct burn_speed_descriptor *el = speed_list;
-    /* check profile, so we can convert from 'kb/s' into 'x' rating */
-    if (profile_no != 0) {
-      /* this will fail if newer disk types get supported */
-      if (profile_no <= 0x0a)
-        factor = CDR_1X_SPEED;
-      else
-        /* assume DVD for now */
-        factor = DVD_1X_SPEED;
-    } else {
-      factor = 1;
-    }
 
     while (el) {
-      gint speed = -1;
+      gint speed = el->write_speed;
       
-      speed = el->write_speed / factor;
       /* FIXME: why do we need no_speed_duplicate? */
       if (speed > 0 && no_speed_duplicate (device->supported_cdr_speeds, speed)) {
           device->supported_cdr_speeds = g_slist_prepend (device->supported_cdr_speeds, GINT_TO_POINTER (speed));
-        DBG ("added speed: %d kb/s => %d x", el->write_speed, speed);
       } 
 
       el = el->next;




More information about the Goodies-commits mailing list