]> granicus.if.org Git - handbrake/commitdiff
LinGui: add video quality slider granularity preference.
authorjstebbins <jstebbins.hb@gmail.com>
Thu, 12 Feb 2009 22:15:31 +0000 (22:15 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Thu, 12 Feb 2009 22:15:31 +0000 (22:15 +0000)
I didn't have an easy way to stash doubles in a combo box,
so this was more invasive that planned. But now I have
some additional flexibitlity.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2154 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/src/callbacks.c
gtk/src/ghb.ui
gtk/src/hb-backend.c
gtk/src/hb-backend.h
gtk/src/internal_defaults.xml
gtk/src/resource_data.h
gtk/src/resources.plist
gtk/src/settings.c
gtk/src/settings.h
gtk/src/x264handler.c

index c68bb49e11d32ce3a4dc05e9cee9185a49dd95b1..1898271af3ccdcff07b926fe05725153891d10fe 100644 (file)
@@ -1105,6 +1105,30 @@ setting_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
        ghb_live_reset(ud);
 }
 
+void
+vquality_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
+{
+       ghb_widget_to_setting(ud->settings, widget);
+       ghb_check_dependency(ud, widget);
+       ghb_clear_presets_selection(ud);
+       ghb_live_reset(ud);
+
+       gint vcodec = ghb_settings_combo_int(ud->settings, "VideoEncoder");
+       gdouble step;
+       if (vcodec == HB_VCODEC_X264)
+       {
+               step = ghb_settings_combo_double(ud->settings, 
+                                                                                       "VideoQualityGranularity");
+       }
+       else
+       {
+               step = 1;
+       }
+       gdouble val = gtk_range_get_value(GTK_RANGE(widget));
+       val = ((int)((val + step / 2) / step)) * step;
+       gtk_range_set_value(GTK_RANGE(widget), val);
+}
+
 void
 http_opt_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
 {
@@ -1122,7 +1146,6 @@ vcodec_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
        gdouble vqmin, vqmax, step, page;
        gboolean inverted;
        gint digits;
-       gint vcodec;
 
        ghb_widget_to_setting(ud->settings, widget);
        ghb_check_dependency(ud, widget);
@@ -1134,14 +1157,13 @@ vcodec_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
        gtk_range_set_increments (GTK_RANGE(qp), step, page);
        gtk_scale_set_digits(GTK_SCALE(qp), digits);
        gtk_range_set_inverted (GTK_RANGE(qp), inverted);
-       vcodec = ghb_settings_combo_int(ud->settings, "VideoEncoder");
 }
 
 void
 target_size_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
 {
        const gchar *name = gtk_widget_get_name(widget);
-       g_debug("setting_widget_changed_cb () %s", name);
+       g_debug("target_size_changed_cb () %s", name);
        ghb_widget_to_setting(ud->settings, widget);
        ghb_check_dependency(ud, widget);
        ghb_clear_presets_selection(ud);
@@ -2363,6 +2385,25 @@ pref_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
        ghb_pref_save(ud->settings, name);
 }
 
+void
+vqual_granularity_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
+{
+       g_debug("vqual_granularity_changed_cb");
+       ghb_widget_to_setting (ud->settings, widget);
+       ghb_check_dependency(ud, widget);
+
+       const gchar *name = gtk_widget_get_name(widget);
+       ghb_pref_save(ud->settings, name);
+
+       gdouble vqmin, vqmax, step, page;
+       gboolean inverted;
+       gint digits;
+
+       ghb_vquality_range(ud, &vqmin, &vqmax, &step, &page, &digits, &inverted);
+       GtkWidget *qp = GHB_WIDGET(ud->builder, "VideoQualitySlider");
+       gtk_range_set_increments (GTK_RANGE(qp), step, page);
+}
+
 void
 tweaks_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
 {
@@ -2817,22 +2858,22 @@ format_vquality_cb(GtkScale *scale, gdouble val, signal_user_data_t *ud)
                        crf = ghb_settings_get_boolean(ud->settings, "constant_rate_factor");
                        percent = 100. * (51 - val) / 51.;
                        if (crf)
-                               return g_strdup_printf("RF: %.1f / %.1f%%", val, percent);
+                               return g_strdup_printf("RF: %.4g (%.0f%%)", val, percent);
                        else
-                               return g_strdup_printf("QP: %.1f / %.1f%%", val, percent);
+                               return g_strdup_printf("QP: %.4g (%.0f%%)", val, percent);
                } break;
 
                case HB_VCODEC_XVID:
                case HB_VCODEC_FFMPEG:
                {
                        percent = 100. * (30 - (val - 1)) / 30.;
-                       return g_strdup_printf("QP: %d / %.1f%%", (int)val, percent);
+                       return g_strdup_printf("QP: %d (%.0f%%)", (int)val, percent);
                } break;
 
                case HB_VCODEC_THEORA:
                {
                        percent = 100. * val / 63.;
-                       return g_strdup_printf("QP: %d / %.1f%%", (int)val, percent);
+                       return g_strdup_printf("QP: %d (%.0f%%)", (int)val, percent);
                } break;
 
                default:
index 01a55902b341f139e5e7894a78f537fc3623f9bd..ea7ff7634154ac9453b13c4c649b19e1dd4c6baf 100644 (file)
     <property name="value">0</property>
   </object>
   <object class="GtkAdjustment" id="adjustment5">
-    <property name="upper">1</property>
+    <property name="upper">51</property>
     <property name="lower">0</property>
-    <property name="page_increment">1</property>
-    <property name="step_increment">0.1</property>
+    <property name="page_increment">5</property>
+    <property name="step_increment">0.25</property>
     <property name="page_size">0</property>
-    <property name="value">0.63</property>
+    <property name="value">20.25</property>
   </object>
   <object class="GtkAdjustment" id="adjustment6">
     <property name="upper">4</property>
                                         </child>
                                         <child>
                                           <object class="GtkHScale" id="VideoQualitySlider">
-                                            <property name="width_request">200</property>
                                             <property name="visible">True</property>
                                             <property name="can_focus">True</property>
                                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                             <property name="adjustment">adjustment5</property>
                                             <property name="digits">3</property>
-                                            <property name="value_pos">GTK_POS_RIGHT</property>
-                                            <signal handler="setting_widget_changed_cb" name="value_changed"/>
+                                            <property name="value_pos">GTK_POS_BOTTOM</property>
+                                            <signal handler="vquality_changed_cb" name="value_changed"/>
                                             <signal handler="format_vquality_cb" name="format-value"/>
                                           </object>
                                           <packing>
@@ -3386,24 +3385,6 @@ the required multiple.</property>
                             <property name="position">3</property>
                           </packing>
                         </child>
-                        <child>
-                          <object class="GtkCheckButton" id="EncodeLogLocation">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="tooltip_text"> HandBrake produces 2 activity logs.  
-One for the session and one for each encoding.
-Store the individual encode logs in the same
-location as the movie.</property>
-                            <property name="label" translatable="yes">Store logs in destination video directory</property>
-                            <property name="draw_indicator">True</property>
-                            <signal name="toggled" handler="pref_changed_cb"/>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="position">4</property>
-                          </packing>
-                        </child>
-
                         <child>
                           <object class="GtkAlignment" id="alignment50">
                             <property name="visible">True</property>
@@ -3441,11 +3422,66 @@ location as the movie.</property>
                               </object>
                             </child>
                           </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">4</property>
+                          </packing>
+                        </child>
+
+                        <child>
+                          <object class="GtkAlignment" id="alignment59">
+                            <property name="visible">True</property>
+                            <property name="left_padding">4</property>
+                            <child>
+                              <object class="GtkHBox" id="hbox6">
+                                <property name="visible">True</property>
+                                <property name="spacing">4</property>
+                                <child>
+                                  <object class="GtkComboBox" id="VideoQualityGranularity">
+                                    <property name="visible">True</property>
+                                    <property name="width_request">55</property>
+                                    <signal name="changed" handler="vqual_granularity_changed_cb"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label85">
+                                    <property name="visible">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Video Qaulity Granularity</property>
+                                  </object>
+                                  <packing>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </object>
+                            </child>
+                          </object>
                           <packing>
                             <property name="expand">False</property>
                             <property name="position">5</property>
                           </packing>
                         </child>
+                        <child>
+                          <object class="GtkCheckButton" id="EncodeLogLocation">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="tooltip_text"> HandBrake produces 2 activity logs.  
+One for the session and one for each encoding.
+Store the individual encode logs in the same
+location as the movie.</property>
+                            <property name="label" translatable="yes">Store logs in destination video directory</property>
+                            <property name="draw_indicator">True</property>
+                            <signal name="toggled" handler="pref_changed_cb"/>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">6</property>
+                          </packing>
+                        </child>
 
                         <child>
                           <object class="GtkAlignment" id="alignment51">
@@ -3481,7 +3517,7 @@ location as the movie.</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
-                            <property name="position">6</property>
+                            <property name="position">7</property>
                           </packing>
                         </child>
 
@@ -3494,7 +3530,7 @@ location as the movie.</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
-                            <property name="position">7</property>
+                            <property name="position">8</property>
                           </packing>
                         </child>
                         <child>
@@ -3506,7 +3542,7 @@ location as the movie.</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
-                            <property name="position">8</property>
+                            <property name="position">9</property>
                           </packing>
                         </child>
                       </object>
index 4f807f85330839c1f4485918e3f05db57d03aceb..9f889ad79eb88b56060dd736013c1ff55eb00b02 100644 (file)
@@ -39,7 +39,7 @@ typedef struct
 {
        const gchar *option;
        const gchar *shortOpt;
-       gint ivalue;
+       gdouble ivalue;
        const gchar *svalue;
 } options_map_t;
 
@@ -76,6 +76,19 @@ combo_opts_t logging_opts =
        d_logging_opts
 };
 
+static options_map_t d_vqual_granularity_opts[] =
+{
+       {"0.2",  "0.2",  0.2,  "0.2"},
+       {"0.25", "0.25", 0.25, "0.25"},
+       {"0.5",  "0.5",  0.5,  "0.5"},
+       {"1",    "1",    1,    "1"},
+};
+combo_opts_t vqual_granularity_opts =
+{
+       sizeof(d_vqual_granularity_opts)/sizeof(options_map_t),
+       d_vqual_granularity_opts
+};
+
 static options_map_t d_container_opts[] =
 {
        {"MKV", "mkv", HB_MUX_MKV, "mkv"},
@@ -278,6 +291,7 @@ typedef struct
 combo_name_map_t combo_name_map[] =
 {
        {"LoggingLevel", &logging_opts},
+       {"VideoQualityGranularity", &vqual_granularity_opts},
        {"FileFormat", &container_opts},
        {"PictureDeinterlace", &deint_opts},
        {"PictureDecomb", &decomb_opts},
@@ -546,7 +560,6 @@ ghb_vquality_range(
        gboolean *inverted)
 {
        gint vcodec = ghb_settings_combo_int(ud->settings, "VideoEncoder");
-       *step = 1;
        *page = 10;
        *digits = 0;
        switch (vcodec)
@@ -555,8 +568,12 @@ ghb_vquality_range(
                {
                        *min = 0;
                        *max = 51;
-                       *step = 0.1;
-                       *digits = 3;
+                       *step = ghb_settings_combo_double(ud->settings, 
+                                                                                       "VideoQualityGranularity");
+                       if (*step == 0.2 || *step == 0.5)
+                               *digits = 1;
+                       else if (*step == 0.25)
+                               *digits = 2;
                        *inverted = TRUE;
                } break;
 
@@ -565,6 +582,7 @@ ghb_vquality_range(
                {
                        *min = 1;
                        *max = 31;
+                       *step = 1;
                        *inverted = TRUE;
                } break;
 
@@ -572,6 +590,7 @@ ghb_vquality_range(
                {
                        *min = 0;
                        *max = 63;
+                       *step = 1;
                        *inverted = FALSE;
                } break;
 
@@ -579,7 +598,7 @@ ghb_vquality_range(
                {
                        *min = 0;
                        *max = 100;
-                       *digits = 3;
+                       *step = 1;
                        *inverted = FALSE;
                } break;
        }
@@ -605,6 +624,26 @@ lookup_generic_int(combo_opts_t *opts, const GValue *gval)
        return result;
 }
 
+static gdouble
+lookup_generic_double(combo_opts_t *opts, const GValue *gval)
+{
+       gint ii;
+       gchar *str;
+       gdouble result = -1;
+
+       str = ghb_value_string(gval);
+       for (ii = 0; ii < opts->count; ii++)
+       {
+               if (strcmp(opts->map[ii].shortOpt, str) == 0)
+               {
+                       result = opts->map[ii].ivalue;
+                       break;
+               }
+       }
+       g_free(str);
+       return result;
+}
+
 static const gchar*
 lookup_generic_option(combo_opts_t *opts, const GValue *gval)
 {
@@ -849,7 +888,7 @@ get_acodec_value(gint val)
 
        for (ii = 0; ii < acodec_opts.count; ii++)
        {
-               if (acodec_opts.map[ii].ivalue == val)
+               if ((int)acodec_opts.map[ii].ivalue == val)
                {
                        value = ghb_string_value_new(acodec_opts.map[ii].shortOpt);
                        break;
@@ -1199,7 +1238,7 @@ init_combo_box(GtkBuilder *builder, const gchar *name)
        // 4 - Int value determined by backend
        // 5 - String value determined by backend
        store = gtk_list_store_new(5, G_TYPE_STRING, G_TYPE_BOOLEAN, 
-                                                          G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING);
+                                                          G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_STRING);
        gtk_combo_box_set_model(combo, GTK_TREE_MODEL(store));
 
        if (GTK_WIDGET_TYPE(combo) == GTK_TYPE_COMBO_BOX)
@@ -1232,7 +1271,7 @@ audio_samplerate_opts_set(GtkBuilder *builder, const gchar *name, hb_rate_t *rat
                                           0, "Same as source", 
                                           1, TRUE, 
                                           2, "source", 
-                                          3, 0, 
+                                          3, 0.0
                                           4, "source", 
                                           -1);
        for (ii = 0; ii < count; ii++)
@@ -1242,7 +1281,7 @@ audio_samplerate_opts_set(GtkBuilder *builder, const gchar *name, hb_rate_t *rat
                                                   0, rates[ii].string, 
                                                   1, TRUE, 
                                                   2, rates[ii].string, 
-                                                  3, rates[ii].rate, 
+                                                  3, (gdouble)rates[ii].rate, 
                                                   4, rates[ii].string, 
                                                   -1);
        }
@@ -1264,7 +1303,7 @@ video_rate_opts_set(GtkBuilder *builder, const gchar *name, hb_rate_t *rates, gi
                                           0, "Same as source", 
                                           1, TRUE, 
                                           2, "source", 
-                                          3, 0, 
+                                          3, 0.0
                                           4, "source", 
                                           -1);
        for (ii = 0; ii < count; ii++)
@@ -1289,7 +1328,7 @@ video_rate_opts_set(GtkBuilder *builder, const gchar *name, hb_rate_t *rates, gi
                                                   0, option, 
                                                   1, TRUE, 
                                                   2, rates[ii].string, 
-                                                  3, rates[ii].rate, 
+                                                  3, (gdouble)rates[ii].rate, 
                                                   4, rates[ii].string, 
                                                   -1);
                g_free(option);
@@ -1311,7 +1350,7 @@ mix_opts_set(GtkBuilder *builder, const gchar *name)
                                           0, "None", 
                                           1, TRUE, 
                                           2, "none", 
-                                          3, 0, 
+                                          3, 0.0
                                           4, "none", 
                                           -1);
        for (ii = 0; ii < hb_audio_mixdowns_count; ii++)
@@ -1321,7 +1360,7 @@ mix_opts_set(GtkBuilder *builder, const gchar *name)
                                                   0, hb_audio_mixdowns[ii].human_readable_name, 
                                                   1, TRUE, 
                                                   2, hb_audio_mixdowns[ii].short_name, 
-                                                  3, hb_audio_mixdowns[ii].amixdown, 
+                                                  3, (gdouble)hb_audio_mixdowns[ii].amixdown, 
                                                   4, hb_audio_mixdowns[ii].internal_name, 
                                                   -1);
        }
@@ -1344,7 +1383,7 @@ language_opts_set(GtkBuilder *builder, const gchar *name)
                                                   0, ghb_language_table[ii].eng_name, 
                                                   1, TRUE, 
                                                   2, ghb_language_table[ii].iso639_2, 
-                                                  3, ii, 
+                                                  3, (gdouble)ii, 
                                                   4, ghb_language_table[ii].iso639_1, 
                                                   -1);
        }
@@ -1393,7 +1432,7 @@ title_opts_set(GtkBuilder *builder, const gchar *name)
                                                   0, "No Titles", 
                                                   1, TRUE, 
                                                   2, "none", 
-                                                  3, -1, 
+                                                  3, -1.0
                                                   4, "none", 
                                                   -1);
                title_opts.map[0].option = "No Titles";
@@ -1419,7 +1458,7 @@ title_opts_set(GtkBuilder *builder, const gchar *name)
                                                   0, titles[ii], 
                                                   1, TRUE, 
                                                   2, titles[ii], 
-                                                  3, ii, 
+                                                  3, (gdouble)ii, 
                                                   4, titles[ii], 
                                                   -1);
                title_opts.map[ii].option = titles[ii];
@@ -1433,7 +1472,7 @@ title_opts_set(GtkBuilder *builder, const gchar *name)
 static gboolean
 find_combo_item_by_int(GtkTreeModel *store, gint value, GtkTreeIter *iter)
 {
-       gint ivalue;
+       gdouble ivalue;
        gboolean foundit = FALSE;
        
        if (gtk_tree_model_get_iter_first (store, iter))
@@ -1441,7 +1480,7 @@ find_combo_item_by_int(GtkTreeModel *store, gint value, GtkTreeIter *iter)
                do
                {
                        gtk_tree_model_get(store, iter, 3, &ivalue, -1);
-                       if (value == ivalue)
+                       if (value == (int)ivalue)
                        {
                                foundit = TRUE;
                                break;
@@ -1494,7 +1533,7 @@ audio_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
                                                   0, "No Audio", 
                                                   1, TRUE, 
                                                   2, "none", 
-                                                  3, -1, 
+                                                  3, -1.0
                                                   4, "none", 
                                                   -1);
                audio_track_opts.map[0].option = "No Audio";
@@ -1511,7 +1550,7 @@ audio_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
                                                   0, audio->lang.description, 
                                                   1, TRUE, 
                                                   2, index_str[ii], 
-                                                  3, ii, 
+                                                  3, (gdouble)ii, 
                                                   4, index_str[ii], 
                                                   -1);
                audio_track_opts.map[ii].option = audio->lang.description,
@@ -1563,7 +1602,7 @@ subtitle_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
                                           0, "None", 
                                           1, TRUE, 
                                           2, "none", 
-                                          3, -2, 
+                                          3, -2.0
                                           4, "none", 
                                           -1);
        subtitle_opts.map[0].option = "None";
@@ -1575,7 +1614,7 @@ subtitle_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
                                           0, "Autoselect", 
                                           1, TRUE, 
                                           2, "auto", 
-                                          3, -1, 
+                                          3, -1.0
                                           4, "auto", 
                                           -1);
        subtitle_opts.map[0].option = "Same as audio";
@@ -1592,7 +1631,7 @@ subtitle_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
                                                0, subtitle->lang, 
                                                1, TRUE, 
                                                2, subtitle->iso639_2, 
-                                               3, ii, 
+                                               3, (gdouble)ii, 
                                                4, subtitle->iso639_2, 
                                                -1);
                        subtitle_opts.map[ii+2].option = subtitle->lang;
@@ -1610,7 +1649,7 @@ subtitle_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
                                0, ghb_language_table[ii].eng_name, 
                                1, TRUE, 
                                2, ghb_language_table[ii].iso639_2, 
-                               3, ii, 
+                               3, (gdouble)ii, 
                                4, ghb_language_table[ii].iso639_2, 
                                -1);
                        subtitle_opts.map[ii+2].option = ghb_language_table[ii].eng_name;
@@ -1865,6 +1904,27 @@ ghb_lookup_combo_int(const gchar *name, const GValue *gval)
        return 0;
 }
 
+gdouble
+ghb_lookup_combo_double(const gchar *name, const GValue *gval)
+{
+       if (strcmp(name, "AudioBitrate") == 0)
+               return lookup_audio_bitrate_int(gval);
+       else if (strcmp(name, "AudioSamplerate") == 0)
+               return lookup_audio_rate_int(gval);
+       else if (strcmp(name, "VideoFramerate") == 0)
+               return lookup_video_rate_int(gval);
+       else if (strcmp(name, "AudioMixdown") == 0)
+               return lookup_mix_int(gval);
+       else if (strcmp(name, "SourceAudioLang") == 0)
+               return lookup_audio_lang_int(gval);
+       else
+       {
+               return lookup_generic_double(find_combo_table(name), gval);
+       }
+       g_warning("ghb_lookup_combo_double() couldn't find %s", name);
+       return 0;
+}
+
 const gchar*
 ghb_lookup_combo_option(const gchar *name, const GValue *gval)
 {
@@ -1923,6 +1983,7 @@ ghb_update_ui_combo_box(GtkBuilder *builder, const gchar *name, gint user_data,
                subtitle_opts_set(builder, "Subtitles", user_data);
                title_opts_set(builder, "title");
                audio_track_opts_set(builder, "AudioTrack", user_data);
+               generic_opts_set(builder, "VideoQualityGranularity", &vqual_granularity_opts);
                generic_opts_set(builder, "LoggingLevel", &logging_opts);
                generic_opts_set(builder, "FileFormat", &container_opts);
                generic_opts_set(builder, "PictureDeinterlace", &deint_opts);
@@ -2077,7 +2138,7 @@ audio_bitrate_opts_add(GtkBuilder *builder, const gchar *name, gint rate)
                                                   0, str, 
                                                   1, TRUE, 
                                                   2, str, 
-                                                  3, rate, 
+                                                  3, (gdouble)rate, 
                                                   4, str, 
                                                   -1);
                g_free(str);
@@ -2089,7 +2150,7 @@ audio_bitrate_opts_clean(GtkBuilder *builder, const gchar *name, gint last_rate)
 {
        GtkTreeIter iter;
        GtkListStore *store;
-       gint ivalue;
+       gdouble ivalue;
        gboolean done = FALSE;
        gint ii = 0;
        guint last = (guint)last_rate;
@@ -2139,7 +2200,7 @@ audio_bitrate_opts_set(GtkBuilder *builder, const gchar *name)
                                                   0, hb_audio_bitrates[ii].string, 
                                                   1, TRUE, 
                                                   2, hb_audio_bitrates[ii].string, 
-                                                  3, hb_audio_bitrates[ii].rate, 
+                                                  3, (gdouble)hb_audio_bitrates[ii].rate, 
                                                   4, hb_audio_bitrates[ii].string, 
                                                   -1);
        }
@@ -3384,7 +3445,6 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
                        }
                        else
                        {
-printf("switching to faac\n");
                                audio.out.codec = HB_ACODEC_FAAC;
                        }
                }
index dc37d990f69683cefdc99c7dd6980eec04b7c4e7..bad1b2ac648e30bfffecb18cb837273420901af4 100644 (file)
@@ -150,6 +150,7 @@ gboolean ghb_validate_filters(signal_user_data_t *ud);
 gboolean ghb_validate_filter_string(const gchar *str, gint max_fields);
 void ghb_hb_cleanup(gboolean partial);
 gint ghb_lookup_combo_int(const gchar *name, const GValue *acodec);
+gdouble ghb_lookup_combo_double(const gchar *name, const GValue *acodec);
 const gchar* ghb_lookup_combo_option(const gchar *name, const GValue *acodec);
 gchar* ghb_get_tmp_dir();
 
index b1e9a3f07ffbf80eb0f3818bb856ae02f0bfb0ea..1bc553f2d03a42baf9a98ede9d09a897440566f6 100644 (file)
                <true />
                <key>update_skip_version</key>
                <integer>0</integer>
+               <key>VideoQualityGranularity</key>
+               <string>0.2</string>
                <key>version</key>
                <string>0.1</string>
        </dict>
index 60dc6c42a125fc297b8bb1d3ef9662d7f99a4414..4c480cf71cd7fcd60854ca11faf40442ebad958b 100644 (file)
 "  &lt;/object&gt;\n"
 "  &lt;object class=&quot;GtkAdjustment&quot; id=&quot;adjustment5&quot;"
 "&gt;\n"
-"    &lt;property name=&quot;upper&quot;&gt;1&lt;/property&gt;\n"
+"    &lt;property name=&quot;upper&quot;&gt;51&lt;/property&gt;\n"
 "    &lt;property name=&quot;lower&quot;&gt;0&lt;/property&gt;\n"
-"    &lt;property name=&quot;page_increment&quot;&gt;1&lt;/property&gt;\n"
-"    &lt;property name=&quot;step_increment&quot;&gt;0.1&lt;/property&gt"
-";\n"
+"    &lt;property name=&quot;page_increment&quot;&gt;5&lt;/property&gt;\n"
+"    &lt;property name=&quot;step_increment&quot;&gt;0.25&lt;/property&g"
+"t;\n"
 "    &lt;property name=&quot;page_size&quot;&gt;0&lt;/property&gt;\n"
-"    &lt;property name=&quot;value&quot;&gt;0.63&lt;/property&gt;\n"
+"    &lt;property name=&quot;value&quot;&gt;20.25&lt;/property&gt;\n"
 "  &lt;/object&gt;\n"
 "  &lt;object class=&quot;GtkAdjustment&quot; id=&quot;adjustment6&quot;"
 "&gt;\n"
 "                                        &lt;child&gt;\n"
 "                                          &lt;object class=&quot;GtkHSc"
 "ale&quot; id=&quot;VideoQualitySlider&quot;&gt;\n"
-"                                            &lt;property name=&quot;wid"
-"th_request&quot;&gt;200&lt;/property&gt;\n"
 "                                            &lt;property name=&quot;vis"
 "ible&quot;&gt;True&lt;/property&gt;\n"
 "                                            &lt;property name=&quot;can"
 "                                            &lt;property name=&quot;dig"
 "its&quot;&gt;3&lt;/property&gt;\n"
 "                                            &lt;property name=&quot;val"
-"ue_pos&quot;&gt;GTK_POS_RIGHT&lt;/property&gt;\n"
-"                                            &lt;signal handler=&quot;se"
-"tting_widget_changed_cb&quot; name=&quot;value_changed&quot;/&gt;\n"
+"ue_pos&quot;&gt;GTK_POS_BOTTOM&lt;/property&gt;\n"
+"                                            &lt;signal handler=&quot;vq"
+"uality_changed_cb&quot; name=&quot;value_changed&quot;/&gt;\n"
 "                                            &lt;signal handler=&quot;fo"
 "rmat_vquality_cb&quot; name=&quot;format-value&quot;/&gt;\n"
 "                                          &lt;/object&gt;\n"
 "                          &lt;/packing&gt;\n"
 "                        &lt;/child&gt;\n"
 "                        &lt;child&gt;\n"
-"                          &lt;object class=&quot;GtkCheckButton&quot; i"
-"d=&quot;EncodeLogLocation&quot;&gt;\n"
-"                            &lt;property name=&quot;visible&quot;&gt;Tr"
-"ue&lt;/property&gt;\n"
-"                            &lt;property name=&quot;can_focus&quot;&gt;"
-"True&lt;/property&gt;\n"
-"                            &lt;property name=&quot;tooltip_text&quot;&"
-"gt; HandBrake produces 2 activity logs.  \n"
-"One for the session and one for each encoding.\n"
-"Store the individual encode logs in the same\n"
-"location as the movie.&lt;/property&gt;\n"
-"                            &lt;property name=&quot;label&quot; transla"
-"table=&quot;yes&quot;&gt;Store logs in destination video directory&lt;/"
-"property&gt;\n"
-"                            &lt;property name=&quot;draw_indicator&quot"
-";&gt;True&lt;/property&gt;\n"
-"                            &lt;signal name=&quot;toggled&quot; handler"
-"=&quot;pref_changed_cb&quot;/&gt;\n"
-"                          &lt;/object&gt;\n"
-"                          &lt;packing&gt;\n"
-"                            &lt;property name=&quot;expand&quot;&gt;Fal"
-"se&lt;/property&gt;\n"
-"                            &lt;property name=&quot;position&quot;&gt;4"
-"&lt;/property&gt;\n"
-"                          &lt;/packing&gt;\n"
-"                        &lt;/child&gt;\n"
-"\n"
-"                        &lt;child&gt;\n"
 "                          &lt;object class=&quot;GtkAlignment&quot; id="
 "&quot;alignment50&quot;&gt;\n"
 "                            &lt;property name=&quot;visible&quot;&gt;Tr"
 "                          &lt;packing&gt;\n"
 "                            &lt;property name=&quot;expand&quot;&gt;Fal"
 "se&lt;/property&gt;\n"
+"                            &lt;property name=&quot;position&quot;&gt;4"
+"&lt;/property&gt;\n"
+"                          &lt;/packing&gt;\n"
+"                        &lt;/child&gt;\n"
+"\n"
+"                        &lt;child&gt;\n"
+"                          &lt;object class=&quot;GtkAlignment&quot; id="
+"&quot;alignment59&quot;&gt;\n"
+"                            &lt;property name=&quot;visible&quot;&gt;Tr"
+"ue&lt;/property&gt;\n"
+"                            &lt;property name=&quot;left_padding&quot;&"
+"gt;4&lt;/property&gt;\n"
+"                            &lt;child&gt;\n"
+"                              &lt;object class=&quot;GtkHBox&quot; id=&"
+"quot;hbox6&quot;&gt;\n"
+"                                &lt;property name=&quot;visible&quot;&g"
+"t;True&lt;/property&gt;\n"
+"                                &lt;property name=&quot;spacing&quot;&g"
+"t;4&lt;/property&gt;\n"
+"                                &lt;child&gt;\n"
+"                                  &lt;object class=&quot;GtkComboBox&qu"
+"ot; id=&quot;VideoQualityGranularity&quot;&gt;\n"
+"                                    &lt;property name=&quot;visible&quo"
+"t;&gt;True&lt;/property&gt;\n"
+"                                    &lt;property name=&quot;width_reque"
+"st&quot;&gt;55&lt;/property&gt;\n"
+"                                    &lt;signal name=&quot;changed&quot;"
+" handler=&quot;vqual_granularity_changed_cb&quot;/&gt;\n"
+"                                  &lt;/object&gt;\n"
+"                                  &lt;packing&gt;\n"
+"                                    &lt;property name=&quot;expand&quot"
+";&gt;False&lt;/property&gt;\n"
+"                                    &lt;property name=&quot;position&qu"
+"ot;&gt;0&lt;/property&gt;\n"
+"                                  &lt;/packing&gt;\n"
+"                                &lt;/child&gt;\n"
+"                                &lt;child&gt;\n"
+"                                  &lt;object class=&quot;GtkLabel&quot;"
+" id=&quot;label85&quot;&gt;\n"
+"                                    &lt;property name=&quot;visible&quo"
+"t;&gt;True&lt;/property&gt;\n"
+"                                    &lt;property name=&quot;xalign&quot"
+";&gt;0&lt;/property&gt;\n"
+"                                    &lt;property name=&quot;label&quot;"
+" translatable=&quot;yes&quot;&gt;Video Qaulity Granularity&lt;/property"
+"&gt;\n"
+"                                  &lt;/object&gt;\n"
+"                                  &lt;packing&gt;\n"
+"                                    &lt;property name=&quot;position&qu"
+"ot;&gt;1&lt;/property&gt;\n"
+"                                  &lt;/packing&gt;\n"
+"                                &lt;/child&gt;\n"
+"                              &lt;/object&gt;\n"
+"                            &lt;/child&gt;\n"
+"                          &lt;/object&gt;\n"
+"                          &lt;packing&gt;\n"
+"                            &lt;property name=&quot;expand&quot;&gt;Fal"
+"se&lt;/property&gt;\n"
 "                            &lt;property name=&quot;position&quot;&gt;5"
 "&lt;/property&gt;\n"
 "                          &lt;/packing&gt;\n"
 "                        &lt;/child&gt;\n"
+"                        &lt;child&gt;\n"
+"                          &lt;object class=&quot;GtkCheckButton&quot; i"
+"d=&quot;EncodeLogLocation&quot;&gt;\n"
+"                            &lt;property name=&quot;visible&quot;&gt;Tr"
+"ue&lt;/property&gt;\n"
+"                            &lt;property name=&quot;can_focus&quot;&gt;"
+"True&lt;/property&gt;\n"
+"                            &lt;property name=&quot;tooltip_text&quot;&"
+"gt; HandBrake produces 2 activity logs.  \n"
+"One for the session and one for each encoding.\n"
+"Store the individual encode logs in the same\n"
+"location as the movie.&lt;/property&gt;\n"
+"                            &lt;property name=&quot;label&quot; transla"
+"table=&quot;yes&quot;&gt;Store logs in destination video directory&lt;/"
+"property&gt;\n"
+"                            &lt;property name=&quot;draw_indicator&quot"
+";&gt;True&lt;/property&gt;\n"
+"                            &lt;signal name=&quot;toggled&quot; handler"
+"=&quot;pref_changed_cb&quot;/&gt;\n"
+"                          &lt;/object&gt;\n"
+"                          &lt;packing&gt;\n"
+"                            &lt;property name=&quot;expand&quot;&gt;Fal"
+"se&lt;/property&gt;\n"
+"                            &lt;property name=&quot;position&quot;&gt;6"
+"&lt;/property&gt;\n"
+"                          &lt;/packing&gt;\n"
+"                        &lt;/child&gt;\n"
 "\n"
 "                        &lt;child&gt;\n"
 "                          &lt;object class=&quot;GtkAlignment&quot; id="
 "                          &lt;packing&gt;\n"
 "                            &lt;property name=&quot;expand&quot;&gt;Fal"
 "se&lt;/property&gt;\n"
-"                            &lt;property name=&quot;position&quot;&gt;6"
+"                            &lt;property name=&quot;position&quot;&gt;7"
 "&lt;/property&gt;\n"
 "                          &lt;/packing&gt;\n"
 "                        &lt;/child&gt;\n"
 "                          &lt;packing&gt;\n"
 "                            &lt;property name=&quot;expand&quot;&gt;Fal"
 "se&lt;/property&gt;\n"
-"                            &lt;property name=&quot;position&quot;&gt;7"
+"                            &lt;property name=&quot;position&quot;&gt;8"
 "&lt;/property&gt;\n"
 "                          &lt;/packing&gt;\n"
 "                        &lt;/child&gt;\n"
 "                          &lt;packing&gt;\n"
 "                            &lt;property name=&quot;expand&quot;&gt;Fal"
 "se&lt;/property&gt;\n"
-"                            &lt;property name=&quot;position&quot;&gt;8"
+"                            &lt;property name=&quot;position&quot;&gt;9"
 "&lt;/property&gt;\n"
 "                          &lt;/packing&gt;\n"
 "                        &lt;/child&gt;\n"
 "                      <false />\n"
 "                      <key>LoggingLevel</key>\n"
 "                      <string>1</string>\n"
+"                      <key>VideoQualityGranularity</key>\n"
+"                      <string>0.2</string>\n"
 "                      <key>allow_tweaks</key>\n"
 "                      <false />\n"
 "                      <key>chapters_in_destination</key>\n"
index 126d000ef559b5537b210dac2bd8e602944c5602..11fa87c5b8142df374d5c0eb3368d8cc43146a34 100644 (file)
     &lt;property name=&quot;value&quot;&gt;0&lt;/property&gt;
   &lt;/object&gt;
   &lt;object class=&quot;GtkAdjustment&quot; id=&quot;adjustment5&quot;&gt;
-    &lt;property name=&quot;upper&quot;&gt;1&lt;/property&gt;
+    &lt;property name=&quot;upper&quot;&gt;51&lt;/property&gt;
     &lt;property name=&quot;lower&quot;&gt;0&lt;/property&gt;
-    &lt;property name=&quot;page_increment&quot;&gt;1&lt;/property&gt;
-    &lt;property name=&quot;step_increment&quot;&gt;0.1&lt;/property&gt;
+    &lt;property name=&quot;page_increment&quot;&gt;5&lt;/property&gt;
+    &lt;property name=&quot;step_increment&quot;&gt;0.25&lt;/property&gt;
     &lt;property name=&quot;page_size&quot;&gt;0&lt;/property&gt;
-    &lt;property name=&quot;value&quot;&gt;0.63&lt;/property&gt;
+    &lt;property name=&quot;value&quot;&gt;20.25&lt;/property&gt;
   &lt;/object&gt;
   &lt;object class=&quot;GtkAdjustment&quot; id=&quot;adjustment6&quot;&gt;
     &lt;property name=&quot;upper&quot;&gt;4&lt;/property&gt;
                                         &lt;/child&gt;
                                         &lt;child&gt;
                                           &lt;object class=&quot;GtkHScale&quot; id=&quot;VideoQualitySlider&quot;&gt;
-                                            &lt;property name=&quot;width_request&quot;&gt;200&lt;/property&gt;
                                             &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
                                             &lt;property name=&quot;can_focus&quot;&gt;True&lt;/property&gt;
                                             &lt;property name=&quot;events&quot;&gt;GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK&lt;/property&gt;
                                             &lt;property name=&quot;adjustment&quot;&gt;adjustment5&lt;/property&gt;
                                             &lt;property name=&quot;digits&quot;&gt;3&lt;/property&gt;
-                                            &lt;property name=&quot;value_pos&quot;&gt;GTK_POS_RIGHT&lt;/property&gt;
-                                            &lt;signal handler=&quot;setting_widget_changed_cb&quot; name=&quot;value_changed&quot;/&gt;
+                                            &lt;property name=&quot;value_pos&quot;&gt;GTK_POS_BOTTOM&lt;/property&gt;
+                                            &lt;signal handler=&quot;vquality_changed_cb&quot; name=&quot;value_changed&quot;/&gt;
                                             &lt;signal handler=&quot;format_vquality_cb&quot; name=&quot;format-value&quot;/&gt;
                                           &lt;/object&gt;
                                           &lt;packing&gt;
@@ -3391,24 +3390,6 @@ the required multiple.&lt;/property&gt;
                             &lt;property name=&quot;position&quot;&gt;3&lt;/property&gt;
                           &lt;/packing&gt;
                         &lt;/child&gt;
-                        &lt;child&gt;
-                          &lt;object class=&quot;GtkCheckButton&quot; id=&quot;EncodeLogLocation&quot;&gt;
-                            &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
-                            &lt;property name=&quot;can_focus&quot;&gt;True&lt;/property&gt;
-                            &lt;property name=&quot;tooltip_text&quot;&gt; HandBrake produces 2 activity logs.  
-One for the session and one for each encoding.
-Store the individual encode logs in the same
-location as the movie.&lt;/property&gt;
-                            &lt;property name=&quot;label&quot; translatable=&quot;yes&quot;&gt;Store logs in destination video directory&lt;/property&gt;
-                            &lt;property name=&quot;draw_indicator&quot;&gt;True&lt;/property&gt;
-                            &lt;signal name=&quot;toggled&quot; handler=&quot;pref_changed_cb&quot;/&gt;
-                          &lt;/object&gt;
-                          &lt;packing&gt;
-                            &lt;property name=&quot;expand&quot;&gt;False&lt;/property&gt;
-                            &lt;property name=&quot;position&quot;&gt;4&lt;/property&gt;
-                          &lt;/packing&gt;
-                        &lt;/child&gt;
-
                         &lt;child&gt;
                           &lt;object class=&quot;GtkAlignment&quot; id=&quot;alignment50&quot;&gt;
                             &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
@@ -3446,11 +3427,66 @@ location as the movie.&lt;/property&gt;
                               &lt;/object&gt;
                             &lt;/child&gt;
                           &lt;/object&gt;
+                          &lt;packing&gt;
+                            &lt;property name=&quot;expand&quot;&gt;False&lt;/property&gt;
+                            &lt;property name=&quot;position&quot;&gt;4&lt;/property&gt;
+                          &lt;/packing&gt;
+                        &lt;/child&gt;
+
+                        &lt;child&gt;
+                          &lt;object class=&quot;GtkAlignment&quot; id=&quot;alignment59&quot;&gt;
+                            &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                            &lt;property name=&quot;left_padding&quot;&gt;4&lt;/property&gt;
+                            &lt;child&gt;
+                              &lt;object class=&quot;GtkHBox&quot; id=&quot;hbox6&quot;&gt;
+                                &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                                &lt;property name=&quot;spacing&quot;&gt;4&lt;/property&gt;
+                                &lt;child&gt;
+                                  &lt;object class=&quot;GtkComboBox&quot; id=&quot;VideoQualityGranularity&quot;&gt;
+                                    &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                                    &lt;property name=&quot;width_request&quot;&gt;55&lt;/property&gt;
+                                    &lt;signal name=&quot;changed&quot; handler=&quot;vqual_granularity_changed_cb&quot;/&gt;
+                                  &lt;/object&gt;
+                                  &lt;packing&gt;
+                                    &lt;property name=&quot;expand&quot;&gt;False&lt;/property&gt;
+                                    &lt;property name=&quot;position&quot;&gt;0&lt;/property&gt;
+                                  &lt;/packing&gt;
+                                &lt;/child&gt;
+                                &lt;child&gt;
+                                  &lt;object class=&quot;GtkLabel&quot; id=&quot;label85&quot;&gt;
+                                    &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                                    &lt;property name=&quot;xalign&quot;&gt;0&lt;/property&gt;
+                                    &lt;property name=&quot;label&quot; translatable=&quot;yes&quot;&gt;Video Qaulity Granularity&lt;/property&gt;
+                                  &lt;/object&gt;
+                                  &lt;packing&gt;
+                                    &lt;property name=&quot;position&quot;&gt;1&lt;/property&gt;
+                                  &lt;/packing&gt;
+                                &lt;/child&gt;
+                              &lt;/object&gt;
+                            &lt;/child&gt;
+                          &lt;/object&gt;
                           &lt;packing&gt;
                             &lt;property name=&quot;expand&quot;&gt;False&lt;/property&gt;
                             &lt;property name=&quot;position&quot;&gt;5&lt;/property&gt;
                           &lt;/packing&gt;
                         &lt;/child&gt;
+                        &lt;child&gt;
+                          &lt;object class=&quot;GtkCheckButton&quot; id=&quot;EncodeLogLocation&quot;&gt;
+                            &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+                            &lt;property name=&quot;can_focus&quot;&gt;True&lt;/property&gt;
+                            &lt;property name=&quot;tooltip_text&quot;&gt; HandBrake produces 2 activity logs.  
+One for the session and one for each encoding.
+Store the individual encode logs in the same
+location as the movie.&lt;/property&gt;
+                            &lt;property name=&quot;label&quot; translatable=&quot;yes&quot;&gt;Store logs in destination video directory&lt;/property&gt;
+                            &lt;property name=&quot;draw_indicator&quot;&gt;True&lt;/property&gt;
+                            &lt;signal name=&quot;toggled&quot; handler=&quot;pref_changed_cb&quot;/&gt;
+                          &lt;/object&gt;
+                          &lt;packing&gt;
+                            &lt;property name=&quot;expand&quot;&gt;False&lt;/property&gt;
+                            &lt;property name=&quot;position&quot;&gt;6&lt;/property&gt;
+                          &lt;/packing&gt;
+                        &lt;/child&gt;
 
                         &lt;child&gt;
                           &lt;object class=&quot;GtkAlignment&quot; id=&quot;alignment51&quot;&gt;
@@ -3486,7 +3522,7 @@ location as the movie.&lt;/property&gt;
                           &lt;/object&gt;
                           &lt;packing&gt;
                             &lt;property name=&quot;expand&quot;&gt;False&lt;/property&gt;
-                            &lt;property name=&quot;position&quot;&gt;6&lt;/property&gt;
+                            &lt;property name=&quot;position&quot;&gt;7&lt;/property&gt;
                           &lt;/packing&gt;
                         &lt;/child&gt;
 
@@ -3499,7 +3535,7 @@ location as the movie.&lt;/property&gt;
                           &lt;/object&gt;
                           &lt;packing&gt;
                             &lt;property name=&quot;expand&quot;&gt;False&lt;/property&gt;
-                            &lt;property name=&quot;position&quot;&gt;7&lt;/property&gt;
+                            &lt;property name=&quot;position&quot;&gt;8&lt;/property&gt;
                           &lt;/packing&gt;
                         &lt;/child&gt;
                         &lt;child&gt;
@@ -3511,7 +3547,7 @@ location as the movie.&lt;/property&gt;
                           &lt;/object&gt;
                           &lt;packing&gt;
                             &lt;property name=&quot;expand&quot;&gt;False&lt;/property&gt;
-                            &lt;property name=&quot;position&quot;&gt;8&lt;/property&gt;
+                            &lt;property name=&quot;position&quot;&gt;9&lt;/property&gt;
                           &lt;/packing&gt;
                         &lt;/child&gt;
                       &lt;/object&gt;
@@ -5555,6 +5591,8 @@ R2RrUAAABBgBAQACAAAAQAAAABAAAAAQ////AP///wD///8A////AP///wD///8A////AP///wD///8A
                        <false />
                        <key>LoggingLevel</key>
                        <string>1</string>
+                       <key>VideoQualityGranularity</key>
+                       <string>0.2</string>
                        <key>allow_tweaks</key>
                        <false />
                        <key>chapters_in_destination</key>
index 20c1416a6d24284e09f960efe577f1471af14c3c..5912fba5298c9cc8e1e478404e53a09724f3afee 100644 (file)
@@ -158,6 +158,12 @@ ghb_settings_combo_int(const GValue *settings, const gchar *key)
        return ghb_lookup_combo_int(key, ghb_settings_get_value(settings, key));
 }
 
+gdouble
+ghb_settings_combo_double(const GValue *settings, const gchar *key)
+{
+       return ghb_lookup_combo_double(key, ghb_settings_get_value(settings, key));
+}
+
 const gchar*
 ghb_settings_combo_option(const GValue *settings, const gchar *key)
 {
@@ -465,7 +471,7 @@ update_widget(GtkWidget *widget, const GValue *value)
                GtkTreeModel *store;
                GtkTreeIter iter;
                gchar *shortOpt;
-               gint ivalue;
+               gdouble ivalue;
                gboolean foundit = FALSE;
 
                g_debug("combo (%s)", str);
@@ -491,7 +497,7 @@ update_widget(GtkWidget *widget, const GValue *value)
                        do
                        {
                                gtk_tree_model_get(store, &iter, 3, &ivalue, -1);
-                               if (ivalue == ival)
+                               if ((gint)ivalue == ival || ivalue == dval)
                                {
                                        gtk_combo_box_set_active_iter (
                                                GTK_COMBO_BOX(widget), &iter);
@@ -510,7 +516,7 @@ update_widget(GtkWidget *widget, const GValue *value)
                GtkTreeModel *store;
                GtkTreeIter iter;
                gchar *shortOpt;
-               gint ivalue;
+               gdouble ivalue;
                gboolean foundit = FALSE;
 
                g_debug("GTK_COMBO_BOX_ENTRY");
@@ -536,7 +542,7 @@ update_widget(GtkWidget *widget, const GValue *value)
                        do
                        {
                                gtk_tree_model_get(store, &iter, 3, &ivalue, -1);
-                               if (ivalue == ival)
+                               if ((gint)ivalue == ival || ivalue == dval)
                                {
                                        gtk_combo_box_set_active_iter (
                                                GTK_COMBO_BOX(widget), &iter);
index 55584ca703cd5523254a8e8e232c04518e247508..8c2cac821c5bb3a232be99abae74f65b9e905b15 100644 (file)
@@ -84,6 +84,7 @@ gint ghb_settings_get_int(const GValue *settings, const gchar *key);
 gdouble ghb_settings_get_double(const GValue *settings, const gchar *key);
 gchar* ghb_settings_get_string(const GValue *settings, const gchar *key);
 gint ghb_settings_combo_int(const GValue *settings, const gchar *key);
+gdouble ghb_settings_combo_double(const GValue *settings, const gchar *key);
 const gchar* ghb_settings_combo_option(const GValue *settings, const gchar *key);
 
 GValue* ghb_widget_value(GtkWidget *widget);
index cad6049996f31fb4794b18ec5c6f38b05a25159d..5bff6b04035fc73d3add02c5bab5949d3868b394 100644 (file)
@@ -254,7 +254,7 @@ x264_update_combo(signal_user_data_t *ud, const gchar *name, const gchar *val)
        GtkTreeModel *store;
        GtkTreeIter iter;
        gchar *shortOpt;
-       gint ivalue;
+       gdouble ivalue;
        gboolean foundit = FALSE;
        GtkWidget *widget;