OSDN Git Service

LinGui: fix me_method/me_range dependency
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 6 Dec 2008 17:23:52 +0000 (17:23 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 6 Dec 2008 17:23:52 +0000 (17:23 +0000)
umh, esa, tesa -- me_range 4 - 64
dia, hex -- me_range 4 - 16

git-svn-id: svn://localhost/HandBrake/trunk@2015 b64f7644-9d1e-0410-96f1-a4d463321fa5

15 files changed:
gtk/src/audiohandler.c
gtk/src/callbacks.c
gtk/src/ghb.ui
gtk/src/hb-backend.c
gtk/src/makedeps.c
gtk/src/queuehandler.c
gtk/src/resource_data.h
gtk/src/resources.plist
gtk/src/settings.c
gtk/src/settings.h
gtk/src/values.c
gtk/src/values.h
gtk/src/widget_deps
gtk/src/widget_reverse_deps
gtk/src/x264handler.c

index 53c9691..3c36956 100644 (file)
@@ -93,8 +93,8 @@ ghb_set_pref_audio(gint titleindex, signal_user_data_t *ud)
        GHashTable *track_indicies;
        gint *iptr;
 
-       GValue *pref_audio;
-       GValue *audio, *acodec, *bitrate, *rate, *mix, *drc;
+       const GValue *pref_audio;
+       const GValue *audio, *acodec, *bitrate, *rate, *mix, *drc;
        gint count, ii, list_count;
        
        g_debug("set_pref_audio");
index b48e156..d69992f 100644 (file)
@@ -1368,7 +1368,7 @@ submit_job(GValue *settings)
 {
        static gint unique_id = 1;
        gchar *type, *modified, *preset;
-       GValue *path;
+       const GValue *path;
        gboolean preset_modified;
 
        g_debug("submit_job");
@@ -2184,7 +2184,7 @@ chapter_edited_cb(
                -1);
        gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, 0, &index, -1);
 
-       GValue *chapters;
+       const GValue *chapters;
        GValue *chapter;
 
        chapters = ghb_settings_get_value(ud->settings, "chapter_list");
index e5f59ac..978f2a0 100644 (file)
@@ -2480,7 +2480,7 @@ no-fast-pskip=0:no-dct-decimate=0:cabac=1</property>
                                                 <property name="visible">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="tooltip-text" translatable="yes">This sets the shape of the area x264 searches when estimating motion. Your choices are a diamond, a hexagon, a more complex hexagonal shape, or searching the entire frame. You are best off using Uneven Multi-Hexagonal searching.</property>
-                                                <signal handler="x264_widget_changed_cb" name="changed"/>
+                                                <signal handler="x264_me_changed_cb" name="changed"/>
                                               </object>
                                             </child>
                                           </object>
index 8579872..5318882 100644 (file)
@@ -157,10 +157,11 @@ combo_opts_t direct_opts =
 
 static options_map_t d_me_opts[] =
 {
-       {"Diamond",              "dia", 0, "dia"},
-       {"Hexagon",              "hex", 1, "hex"},
-       {"Uneven Multi-Hexagon", "umh", 2, "umh"},
-       {"Exhaustive",           "esa", 3, "esa"},
+       {"Diamond",              "dia",  0, "dia"},
+       {"Hexagon",              "hex",  1, "hex"},
+       {"Uneven Multi-Hexagon", "umh",  2, "umh"},
+       {"Exhaustive",           "esa",  3, "esa"},
+       {"Hadamard Exhaustive",  "tesa", 4, "tesa"},
 };
 combo_opts_t me_opts =
 {
index b094054..1cb5f24 100644 (file)
@@ -61,7 +61,6 @@ static dependency_t dep_map[] =
        {"x264_bframes", "x264_direct", "0", TRUE},
        {"x264_refs", "x264_mixed_refs", "<2", TRUE},
        {"x264_cabac", "x264_trellis", "TRUE", FALSE},
-       {"x264_me", "x264_merange", "umh|esa", FALSE},
        {"ChapterMarkers", "chapters_list", "TRUE", FALSE},
        {"use_source_name", "chapters_in_destination", "TRUE", FALSE},
 };
index f8687b7..adf409e 100644 (file)
@@ -392,7 +392,7 @@ audio_list_refresh(signal_user_data_t *ud)
        GtkListStore *store;
        gboolean done;
        gint row = 0;
-       GValue *audio_list;
+       const GValue *audio_list;
 
        g_debug("ghb_audio_list_refresh ()");
        treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "audio_list"));
index 3b20169..010d4f0 100644 (file)
 "ire frame. You are best off using Uneven Multi-Hexagonal searching.&lt;"
 "/property&gt;\n"
 "                                                &lt;signal handler=&quo"
-"t;x264_widget_changed_cb&quot; name=&quot;changed&quot;/&gt;\n"
+"t;x264_me_changed_cb&quot; name=&quot;changed&quot;/&gt;\n"
 "                                              &lt;/object&gt;\n"
 "                                            &lt;/child&gt;\n"
 "                                          &lt;/object&gt;\n"
 "              <array>\n"
 "                      <string>x264_trellis</string>\n"
 "              </array>\n"
-"              <key>x264_me</key>\n"
-"              <array>\n"
-"                      <string>x264_merange</string>\n"
-"              </array>\n"
 "              <key>x264_refs</key>\n"
 "              <array>\n"
 "                      <string>x264_mixed_refs</string>\n"
 "                              <true />\n"
 "                      </array>\n"
 "              </array>\n"
-"              <key>x264_merange</key>\n"
-"              <array>\n"
-"                      <array>\n"
-"                              <string>x264_me</string>\n"
-"                              <string>umh|esa</string>\n"
-"                              <false />\n"
-"                      </array>\n"
-"              </array>\n"
 "              <key>x264_mixed_refs</key>\n"
 "              <array>\n"
 "                      <array>\n"
index ffb3461..7948a3a 100644 (file)
@@ -2485,7 +2485,7 @@ no-fast-pskip=0:no-dct-decimate=0:cabac=1&lt;/property&gt;
                                                 &lt;property name=&quot;visible&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;tooltip-text&quot; translatable=&quot;yes&quot;&gt;This sets the shape of the area x264 searches when estimating motion. Your choices are a diamond, a hexagon, a more complex hexagonal shape, or searching the entire frame. You are best off using Uneven Multi-Hexagonal searching.&lt;/property&gt;
-                                                &lt;signal handler=&quot;x264_widget_changed_cb&quot; name=&quot;changed&quot;/&gt;
+                                                &lt;signal handler=&quot;x264_me_changed_cb&quot; name=&quot;changed&quot;/&gt;
                                               &lt;/object&gt;
                                             &lt;/child&gt;
                                           &lt;/object&gt;
@@ -7159,10 +7159,6 @@ R2RrUAAABBgBAQACAAAAQAAAABAAAAAQ////AP///wD///8A////AP///wD///8A////AP///wD///8A
                <array>
                        <string>x264_trellis</string>
                </array>
-               <key>x264_me</key>
-               <array>
-                       <string>x264_merange</string>
-               </array>
                <key>x264_refs</key>
                <array>
                        <string>x264_mixed_refs</string>
@@ -7502,14 +7498,6 @@ R2RrUAAABBgBAQACAAAAQAAAABAAAAAQ////AP///wD///8A////AP///wD///8A////AP///wD///8A
                                <true />
                        </array>
                </array>
-               <key>x264_merange</key>
-               <array>
-                       <array>
-                               <string>x264_me</string>
-                               <string>umh|esa</string>
-                               <false />
-                       </array>
-               </array>
                <key>x264_mixed_refs</key>
                <array>
                        <array>
index 03d65c7..20c1416 100644 (file)
@@ -98,7 +98,7 @@ ghb_settings_set_boolean(GValue *settings, const gchar *key, gboolean bval)
 }
 
 GValue*
-ghb_settings_get_value(GValue *settings, const gchar *key)
+ghb_settings_get_value(const GValue *settings, const gchar *key)
 {
        GValue *value;
        value = ghb_dict_lookup(settings, key);
@@ -108,7 +108,7 @@ ghb_settings_get_value(GValue *settings, const gchar *key)
 }
 
 gboolean
-ghb_settings_get_boolean(GValue *settings, const gchar *key)
+ghb_settings_get_boolean(const GValue *settings, const gchar *key)
 {
        const GValue* value;
        value = ghb_settings_get_value(settings, key);
@@ -117,7 +117,7 @@ ghb_settings_get_boolean(GValue *settings, const gchar *key)
 }
 
 gint64
-ghb_settings_get_int64(GValue *settings, const gchar *key)
+ghb_settings_get_int64(const GValue *settings, const gchar *key)
 {
        const GValue* value;
        value = ghb_settings_get_value(settings, key);
@@ -126,7 +126,7 @@ ghb_settings_get_int64(GValue *settings, const gchar *key)
 }
 
 gint
-ghb_settings_get_int(GValue *settings, const gchar *key)
+ghb_settings_get_int(const GValue *settings, const gchar *key)
 {
        const GValue* value;
        value = ghb_settings_get_value(settings, key);
@@ -135,7 +135,7 @@ ghb_settings_get_int(GValue *settings, const gchar *key)
 }
 
 gdouble
-ghb_settings_get_double(GValue *settings, const gchar *key)
+ghb_settings_get_double(const GValue *settings, const gchar *key)
 {
        const GValue* value;
        value = ghb_settings_get_value(settings, key);
@@ -144,7 +144,7 @@ ghb_settings_get_double(GValue *settings, const gchar *key)
 }
 
 gchar*
-ghb_settings_get_string(GValue *settings, const gchar *key)
+ghb_settings_get_string(const GValue *settings, const gchar *key)
 {
        const GValue* value;
        value = ghb_settings_get_value(settings, key);
@@ -153,13 +153,13 @@ ghb_settings_get_string(GValue *settings, const gchar *key)
 }
 
 gint
-ghb_settings_combo_int(GValue *settings, const gchar *key)
+ghb_settings_combo_int(const GValue *settings, const gchar *key)
 {
        return ghb_lookup_combo_int(key, ghb_settings_get_value(settings, key));
 }
 
 const gchar*
-ghb_settings_combo_option(GValue *settings, const gchar *key)
+ghb_settings_combo_option(const GValue *settings, const gchar *key)
 {
        return ghb_lookup_combo_option(key, ghb_settings_get_value(settings, key));
 }
index 4d6eb22..55584ca 100644 (file)
@@ -77,14 +77,14 @@ void ghb_settings_set_boolean(
        GValue *settings, const gchar *key, gboolean bval);
 void ghb_settings_copy(
        GValue *settings, const gchar *key, const GValue *value);
-GValue* ghb_settings_get_value(GValue *settings, const gchar *key);
-gboolean ghb_settings_get_boolean(GValue *settings, const gchar *key);
-gint64 ghb_settings_get_int64(GValue *settings, const gchar *key);
-gint ghb_settings_get_int(GValue *settings, const gchar *key);
-gdouble ghb_settings_get_double(GValue *settings, const gchar *key);
-gchar* ghb_settings_get_string(GValue *settings, const gchar *key);
-gint ghb_settings_combo_int(GValue *settings, const gchar *key);
-const gchar* ghb_settings_combo_option(GValue *settings, const gchar *key);
+GValue* ghb_settings_get_value(const GValue *settings, const gchar *key);
+gboolean ghb_settings_get_boolean(const GValue *settings, const gchar *key);
+gint64 ghb_settings_get_int64(const GValue *settings, const gchar *key);
+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);
+const gchar* ghb_settings_combo_option(const GValue *settings, const gchar *key);
 
 GValue* ghb_widget_value(GtkWidget *widget);
 gchar* ghb_widget_string(GtkWidget *widget);
index 94b417f..ad723ee 100644 (file)
@@ -533,7 +533,7 @@ ghb_dict_iter_init(GHashTableIter *iter, GValue *gval)
 }
 
 GValue*
-ghb_dict_lookup(GValue *gval, const gchar *key)
+ghb_dict_lookup(const GValue *gval, const gchar *key)
 {
        GHashTable *dict = g_value_get_boxed(gval);
        return g_hash_table_lookup(dict, key);
index 4000ad6..ecf676c 100644 (file)
@@ -67,7 +67,7 @@ GValue* ghb_rawdata_value_new(ghb_rawdata_t *data);
 
 void ghb_dict_insert(GValue *gval, gchar *key, GValue *val);
 void ghb_dict_iter_init(GHashTableIter *iter, GValue *gval);
-GValue* ghb_dict_lookup(GValue *gval, const gchar *key);
+GValue* ghb_dict_lookup(const GValue *gval, const gchar *key);
 gboolean ghb_dict_remove(GValue *gval, const gchar *key);
 void ghb_register_transforms(void);
 
index eb9ef27..092a46a 100644 (file)
        <array>
                <string>x264_trellis</string>
        </array>
-       <key>x264_me</key>
-       <array>
-               <string>x264_merange</string>
-       </array>
        <key>x264_refs</key>
        <array>
                <string>x264_mixed_refs</string>
index fa9c804..ff2da38 100644 (file)
                        <true />
                </array>
        </array>
-       <key>x264_merange</key>
-       <array>
-               <array>
-                       <string>x264_me</string>
-                       <string>umh|esa</string>
-                       <false />
-               </array>
-       </array>
        <key>x264_mixed_refs</key>
        <array>
                <array>
index 3fbcf49..36bed77 100644 (file)
@@ -17,6 +17,7 @@
 #include "values.h"
 #include "callbacks.h"
 #include "presets.h"
+#include "hb-backend.h"
 #include "x264handler.h"
 
 static void x264_opt_update(signal_user_data_t *ud, GtkWidget *widget);
@@ -40,6 +41,36 @@ x264_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
 }
 
 void
+x264_me_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
+{
+       const GValue *gval;
+       gint me;
+
+       ghb_widget_to_setting(ud->settings, widget);
+       if (!ignore_options_update)
+       {
+               ignore_options_update = TRUE;
+               x264_opt_update(ud, widget);
+               ignore_options_update = FALSE;
+       }
+       ghb_check_dependency(ud, widget);
+       ghb_clear_presets_selection(ud);
+       widget = GHB_WIDGET(ud->builder, "x264_merange");
+       gval = ghb_settings_get_value(ud->settings, "x264_me");
+       me = ghb_lookup_combo_int("x264_me", gval);
+       if (me < 2)
+       {       // me < umh
+               // me_range 4 - 16
+               gtk_spin_button_set_range(GTK_SPIN_BUTTON(widget), 4, 16);
+       }
+       else
+       {
+               // me_range 4 - 64
+               gtk_spin_button_set_range(GTK_SPIN_BUTTON(widget), 4, 64);
+       }
+}
+
+void
 x264_entry_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
 {
        g_debug("x264_entry_changed_cb ()");
@@ -581,12 +612,6 @@ sanitize_x264opts(signal_user_data_t *ud, const gchar *options)
        {
                x264_remove_opt(split, x264_bpyramid_syns);
        }
-       gchar *me = ghb_settings_get_string(ud->settings, "x264_me");
-       if (!(strcmp(me, "umh") == 0 || strcmp(me, "esa") == 0))
-       {
-               x264_remove_opt(split, x264_merange_syns);
-       }
-       g_free(me);
        if (!ghb_settings_get_boolean(ud->settings, "x264_cabac"))
        {
                x264_remove_opt(split, x264_trellis_syns);