[goobox] Flac quality level 9 does not work



commit 4b2e7ea69fa6530fdc734ac0b321bc09c6f69f55
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Mon Jul 12 20:13:06 2010 +0200

    Flac quality level 9 does not work
    
    [bug #624188]

 data/ui/format-options.ui |    4 ++--
 src/dlg-preferences.c     |   14 +++++++++-----
 2 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/data/ui/format-options.ui b/data/ui/format-options.ui
index 9732e71..abef4f7 100644
--- a/data/ui/format-options.ui
+++ b/data/ui/format-options.ui
@@ -2,7 +2,7 @@
 <interface>
   <requires lib="gtk+" version="2.16"/>
   <!-- interface-naming-policy toplevel-contextual -->
-  <object class="GtkAdjustment" id="adjustment1">
+  <object class="GtkAdjustment" id="quality_adjustment">
     <property name="upper">10</property>
     <property name="step_increment">1</property>
     <property name="page_increment">1</property>
@@ -75,7 +75,7 @@
                                     <property name="width_request">250</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="adjustment">adjustment1</property>
+                                    <property name="adjustment">quality_adjustment</property>
                                     <property name="digits">0</property>
                                   </object>
                                   <packing>
diff --git a/src/dlg-preferences.c b/src/dlg-preferences.c
index 0952310..7615abb 100644
--- a/src/dlg-preferences.c
+++ b/src/dlg-preferences.c
@@ -44,7 +44,7 @@ enum {
 };
 
 
-static int flac_compression[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+static int flac_compression[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
 
 
 typedef struct {
@@ -443,10 +443,9 @@ dlg_format (DialogData    *preferences_data,
 	
 	/* Set widgets data. */		
 
-	data->value = get_current_value (format);
-	gtk_range_set_value (GTK_RANGE (GET_WIDGET ("quality_scale")), scale_value (data->value));
+	if (format == GOO_FILE_FORMAT_FLAC) {
+		gtk_adjustment_set_upper (GTK_ADJUSTMENT (GET_WIDGET ("quality_adjustment")), 9.0);
 
-	if (format == GOO_FILE_FORMAT_FLAC) {	
 		text = g_strdup_printf ("<small><i>%s</i></small>", _("Faster compression"));
 		gtk_label_set_markup (GTK_LABEL (GET_WIDGET ("smaller_value_label")), text);
 		g_free (text);
@@ -455,7 +454,9 @@ dlg_format (DialogData    *preferences_data,
 		gtk_label_set_markup (GTK_LABEL (GET_WIDGET ("bigger_value_label")), text);
 		g_free (text);
 	}
-	else {
+	else if (format == GOO_FILE_FORMAT_OGG) {
+		gtk_adjustment_set_upper (GTK_ADJUSTMENT (GET_WIDGET ("quality_adjustment")), 10.0);
+
 		text = g_strdup_printf ("<small><i>%s</i></small>", _("Smaller size"));
 		gtk_label_set_markup (GTK_LABEL (GET_WIDGET ("smaller_value_label")), text);
 		g_free (text);
@@ -465,6 +466,9 @@ dlg_format (DialogData    *preferences_data,
 		g_free (text);
 	}
 
+	data->value = get_current_value (format);
+	gtk_range_set_value (GTK_RANGE (GET_WIDGET ("quality_scale")), scale_value (data->value));
+
 	switch (format) {
 	case GOO_FILE_FORMAT_OGG:
 		text = g_strdup_printf ("<big><b>%s</b></big>", _("Ogg Vorbis"));



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