}
ghb_adjust_audio_rate_combos(ud);
ghb_grey_combo_options (ud->builder);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
prev_acodec = acodec_code;
asettings = get_selected_asettings(ud);
if (asettings != NULL)
g_debug("audio_track_changed_cb ()");
ghb_adjust_audio_rate_combos(ud);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_grey_combo_options(ud->builder);
asettings = get_selected_asettings(ud);
if (asettings != NULL)
g_debug("audio_mix_changed_cb ()");
ghb_adjust_audio_rate_combos(ud);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
asettings = get_selected_asettings(ud);
if (asettings != NULL)
{
GValue *asettings;
g_debug("audio_widget_changed_cb ()");
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
asettings = get_selected_asettings(ud);
if (asettings != NULL)
{
drc = g_strdup_printf("%.1f", val);
gtk_label_set_text(label, drc);
g_free(drc);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
asettings = get_selected_asettings(ud);
if (asettings != NULL)
{
const gchar *name = gtk_widget_get_name(widget);
g_debug("subtitle_changed_cb () %s", name);
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_live_reset(ud);
}
widget_name = ghb_value_string(ghb_array_get_nth(data, 0));
widget = GHB_WIDGET(ud->builder, widget_name);
dep_object = gtk_builder_get_object(ud->builder, name);
- g_free(widget_name);
- if (!GTK_WIDGET_SENSITIVE(widget))
+ if (widget != NULL && !GTK_WIDGET_SENSITIVE(widget))
continue;
if (dep_object == NULL)
{
if (widget)
value = ghb_widget_string(widget);
else
- value = ghb_settings_get_string(ud->settings, name);
+ value = ghb_settings_get_string(ud->settings, widget_name);
while (values && values[jj])
{
if (values[jj][0] == '>')
g_strfreev (values);
g_free(value);
}
+ g_free(widget_name);
}
return result;
}
void
-ghb_check_dependency(signal_user_data_t *ud, GtkWidget *widget)
+ghb_check_dependency(
+ signal_user_data_t *ud,
+ GtkWidget *widget,
+ const char *alt_name)
{
GObject *dep_object;
const gchar *name;
gchar *dep_name;
GType type;
- type = GTK_WIDGET_TYPE(widget);
- if (type == GTK_TYPE_COMBO_BOX || type == GTK_TYPE_COMBO_BOX_ENTRY)
- if (gtk_combo_box_get_active(GTK_COMBO_BOX(widget)) < 0) return;
+ if (widget != NULL)
+ {
+ type = GTK_WIDGET_TYPE(widget);
+ if (type == GTK_TYPE_COMBO_BOX || type == GTK_TYPE_COMBO_BOX_ENTRY)
+ if (gtk_combo_box_get_active(GTK_COMBO_BOX(widget)) < 0) return;
+ name = gtk_widget_get_name(widget);
+ }
+ else
+ name = alt_name;
- name = gtk_widget_get_name(widget);
g_debug("ghb_check_dependency () %s", name);
if (dep_map == NULL) return;
{
g_debug("container_changed_cb ()");
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
update_acodec_combo(ud);
ghb_update_destination_extension(ud);
ghb_clear_presets_selection(ud);
g_debug("title_changed_cb ()");
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
titleindex = ghb_settings_combo_int(ud->settings, "title");
ghb_update_ui_combo_box (ud, "AudioTrack", titleindex, FALSE);
setting_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
}
chapter_markers_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
ghb_update_destination_extension(ud);
vquality_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
http_opt_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
// AC3 is not allowed when Web optimized
gint digits;
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
ghb_vquality_range(ud, &vqmin, &vqmax, &step, &page, &digits, &inverted);
const gchar *name = gtk_widget_get_name(widget);
g_debug("target_size_changed_cb () %s", name);
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
if (ghb_settings_get_boolean(ud->settings, "vquality_type_target"))
end = ghb_settings_get_int(ud->settings, "end_chapter");
if (start > end)
ghb_ui_update(ud, "end_chapter", ghb_int_value(start));
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
if (ghb_settings_get_boolean(ud->settings, "chapters_in_destination"))
{
set_destination(ud);
end = ghb_settings_get_int(ud->settings, "end_chapter");
if (start > end)
ghb_ui_update(ud, "start_chapter", ghb_int_value(end));
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
if (ghb_settings_get_boolean(ud->settings, "chapters_in_destination"))
{
set_destination(ud);
{
g_debug("scale_width_changed_cb ()");
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
if (GTK_WIDGET_SENSITIVE(widget))
ghb_set_scale (ud, GHB_PIC_KEEP_WIDTH);
{
g_debug("scale_height_changed_cb ()");
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
if (GTK_WIDGET_SENSITIVE(widget))
ghb_set_scale (ud, GHB_PIC_KEEP_HEIGHT);
g_debug("crop_changed_cb ()");
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
if (GTK_WIDGET_SENSITIVE(widget))
ghb_set_scale (ud, 0);
{
g_debug("display_width_changed_cb ()");
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
if (GTK_WIDGET_SENSITIVE(widget))
{
g_debug("display_height_changed_cb ()");
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
if (GTK_WIDGET_SENSITIVE(widget))
{
g_debug("par_changed_cb ()");
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
if (GTK_WIDGET_SENSITIVE(widget))
{
g_debug("scale_changed_cb ()");
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
if (GTK_WIDGET_SENSITIVE(widget))
{
g_debug("show_crop_changed_cb ()");
ghb_widget_to_setting(ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_live_reset(ud);
if (GTK_WIDGET_SENSITIVE(widget))
ghb_set_scale (ud, 0);
{
g_debug("pref_changed_cb");
ghb_widget_to_setting (ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
const gchar *name = gtk_widget_get_name(widget);
ghb_pref_save(ud->settings, name);
}
{
g_debug("use_m4v_changed_cb");
ghb_widget_to_setting (ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
const gchar *name = gtk_widget_get_name(widget);
ghb_pref_save(ud->settings, name);
ghb_update_destination_extension(ud);
{
g_debug("show_status_cb");
ghb_widget_to_setting (ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
const gchar *name = gtk_widget_get_name(widget);
ghb_pref_save(ud->settings, name);
{
g_debug("vqual_granularity_changed_cb");
ghb_widget_to_setting (ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
const gchar *name = gtk_widget_get_name(widget);
ghb_pref_save(ud->settings, name);
void ghb_cancel_encode(signal_user_data_t *ud, const gchar *extra_msg);
gboolean ghb_cancel_encode2(signal_user_data_t *ud, const gchar *extra_msg);
GValue* ghb_start_next_job(signal_user_data_t *ud, gboolean find_first);
-void ghb_check_dependency(signal_user_data_t *ud, GtkWidget *widget);
+void ghb_check_dependency(
+ signal_user_data_t *ud, GtkWidget *widget, const gchar *alt_name);
void ghb_do_scan( signal_user_data_t *ud, const gchar *filename,
gint titlenum, gboolean force);
void ghb_log(gchar *log, ...);
GTK_TOGGLE_BUTTON(xwidget)));
}
ghb_widget_to_setting (ud->settings, xwidget);
- ghb_check_dependency(ud, xwidget);
+ ghb_check_dependency(ud, xwidget, NULL);
const gchar *name = gtk_widget_get_name(xwidget);
ghb_pref_save(ud->settings, name);
}
g_debug("fullscreen_clicked_cb()");
ghb_widget_to_setting (ud->settings, toggle);
- ghb_check_dependency(ud, toggle);
+ ghb_check_dependency(ud, toggle, NULL);
const gchar *name = gtk_widget_get_name(toggle);
ghb_pref_save(ud->settings, name);
g_debug("preview_duration_changed_cb ()");
ghb_live_reset(ud);
ghb_widget_to_setting (ud->settings, widget);
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
const gchar *name = gtk_widget_get_name(widget);
ghb_pref_save(ud->settings, name);
}
GValue *settings;
g_debug("subtitle_track_changed_cb ()");
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_widget_to_setting(ud->settings, widget);
settings = ghb_selected_subtitle_settings(ud);
if (settings != NULL)
GValue *settings;
g_debug("srt_changed_cb ()");
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_widget_to_setting(ud->settings, widget);
settings = ghb_selected_subtitle_settings(ud);
if (settings != NULL)
GValue *settings;
g_debug("srt_changed_cb ()");
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_widget_to_setting(ud->settings, widget);
settings = ghb_selected_subtitle_settings(ud);
if (settings != NULL)
GValue *settings;
g_debug("srt_lang_changed_cb ()");
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_widget_to_setting(ud->settings, widget);
settings = ghb_selected_subtitle_settings(ud);
if (settings != NULL)
{"x264_subme", "x264_psy_trell", "<6", TRUE, FALSE},
{"x264_cabac", "x264_psy_trell", "TRUE", FALSE, FALSE},
{"x264_trellis", "x264_psy_trell", "0", TRUE, FALSE},
+ {"x264_mbtree", "x264_bpyramid", "TRUE", TRUE, FALSE},
{"ChapterMarkers", "chapters_list", "TRUE", FALSE, FALSE},
{"use_source_name", "chapters_in_destination", "TRUE", FALSE, FALSE},
{"use_source_name", "title_no_in_destination", "TRUE", FALSE, FALSE},
x264_opt_update(ud, widget);
ignore_options_update = FALSE;
}
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
}
x264_opt_update(ud, widget);
ignore_options_update = FALSE;
}
- ghb_check_dependency(ud, widget);
+ ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
widget = GHB_WIDGET(ud->builder, "x264_merange");
me = ghb_settings_combo_int(ud->settings, "x264_me");
enum
{
X264_OPT_NONE,
+ X264_OPT_BOOL_NONE,
+ X264_OPT_INT_NONE,
X264_OPT_DEBLOCK,
X264_OPT_PSY,
X264_OPT_INT,
{x264_me_syns, "x264_me", "hex", X264_OPT_COMBO},
{x264_merange_syns, "x264_merange", "16", X264_OPT_INT},
{x264_subme_syns, "x264_subme", "7", X264_OPT_COMBO},
- {x264_aqmode_syns, "x264_aqmode", "1", X264_OPT_NONE},
+ {x264_aqmode_syns, "x264_aqmode", "1", X264_OPT_INT_NONE},
{x264_analyse_syns, "x264_analyse", "some", X264_OPT_COMBO},
{x264_8x8dct_syns, "x264_8x8dct", "1", X264_OPT_BOOL},
{x264_deblock_syns, "x264_deblock_alpha", "0,0", X264_OPT_DEBLOCK},
{x264_cabac_syns, "x264_cabac", "1", X264_OPT_BOOL},
{x264_psy_syns, "x264_psy_rd", "1,0", X264_OPT_PSY},
{x264_psy_syns, "x264_psy_trell", "1,0", X264_OPT_PSY},
- {x264_mbtree_syns, "x264_mbtree", "1", X264_OPT_NONE},
+ {x264_mbtree_syns, "x264_mbtree", "1", X264_OPT_BOOL_NONE},
};
#define X264_OPT_MAP_SIZE (sizeof(x264_opt_map)/sizeof(struct x264_opt_map_s))
ghb_ui_update(ud, name, ghb_int64_value(ival));
}
+static void
+x264_update_int_setting(signal_user_data_t *ud, const gchar *name, const gchar *val)
+{
+ gint ival;
+
+ if (val == NULL) return;
+ ival = g_strtod (val, NULL);
+ ghb_settings_set_value(ud->settings, name, ghb_int64_value(ival));
+ ghb_check_dependency(ud, NULL, name);
+}
+
static gchar *true_str[] =
{
"true",
ghb_ui_update(ud, name, ghb_boolean_value(str_is_true(val)));
}
+static void
+x264_update_bool_setting(signal_user_data_t *ud, const gchar *name, const gchar *val)
+{
+ if (val == NULL)
+ ghb_settings_set_value(ud->settings, name, ghb_boolean_value(1));
+ else
+ ghb_settings_set_value(ud->settings, name, ghb_boolean_value(str_is_true(val)));
+
+ ghb_check_dependency(ud, NULL, name);
+}
+
static void
x264_update_combo(signal_user_data_t *ud, const gchar *name, const gchar *val)
{
x264_opt_map[jj+1].found = TRUE;
x264_update_psy(ud, val);
break;
+ case X264_OPT_BOOL_NONE:
+ x264_update_bool_setting(ud, x264_opt_map[jj].name, val);
+ break;
+ case X264_OPT_INT_NONE:
+ x264_update_int_setting(ud, x264_opt_map[jj].name, val);
+ break;
}
break;
}
case X264_OPT_PSY:
x264_update_psy(ud, val);
break;
+ case X264_OPT_BOOL_NONE:
+ x264_update_bool_setting(ud, x264_opt_map[jj].name, val);
+ break;
+ case X264_OPT_INT_NONE:
+ x264_update_int_setting(ud, x264_opt_map[jj].name, val);
+ break;
}
x264_opt_map[jj].found = TRUE;
g_free(val);