diff options
author | jstebbins <[email protected]> | 2008-07-23 22:30:36 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2008-07-23 22:30:36 +0000 |
commit | 3e608441864f35baa2d5138b6c55b9870ac7ed78 (patch) | |
tree | bc9ee05444269860f6bbe68dbedd0b02e375765c /gtk/src | |
parent | 127de2ab5779a0aabb51b511a5814ccf7c480b70 (diff) |
LinGui: disable 2-pass if constant quality is selected
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1575 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src')
-rw-r--r-- | gtk/src/callbacks.c | 16 | ||||
-rw-r--r-- | gtk/src/hb-backend.c | 3 | ||||
-rw-r--r-- | gtk/src/settings.c | 14 | ||||
-rw-r--r-- | gtk/src/settings.h | 1 |
4 files changed, 27 insertions, 7 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index a071674b3..4f1c7e984 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -71,6 +71,9 @@ static dependency_t dep_map[] = {"vquality_type_target", "video_target_size", "enable", FALSE}, {"vquality_type_constant", "video_quality", "enable", FALSE}, {"vquality_type_constant", "constant_rate_factor", "enable", FALSE}, + {"vquality_type_constant", "x264_trellis", "enable", TRUE}, + {"vquality_type_constant", "two_pass", "enable", TRUE}, + {"vquality_type_constant", "turbo", "enable", TRUE}, {"two_pass", "turbo", "enable", FALSE}, {"container", "large_mp4", "mp4|m4v", FALSE}, {"container", "http_optimize_mp4", "mp4|m4v", FALSE}, @@ -651,7 +654,7 @@ source_button_clicked_cb(GtkButton *button, signal_user_data_t *ud) if (strcmp(sourcename, filename) != 0) { ghb_settings_set_string (ud->settings, "default_source", filename); - ghb_prefs_save (ud->settings); + ghb_pref_save (ud->settings, "default_source"); ghb_dvd_set_current (filename, ud); } g_free(filename); @@ -672,7 +675,7 @@ dvd_source_activate_cb(GtkAction *action, signal_user_data_t *ud) if (strcmp(sourcename, filename) != 0) { ghb_settings_set_string (ud->settings, "default_source", filename); - ghb_prefs_save (ud->settings); + ghb_pref_save (ud->settings, "default_source"); ghb_dvd_set_current (filename, ud); } } @@ -2748,7 +2751,7 @@ ghb_timer_cb(gpointer data) if (strcmp(dest_dir, def_dest) != 0) { ghb_settings_set_string (ud->settings, "destination_dir", dest_dir); - ghb_prefs_save (ud->settings); + ghb_pref_save (ud->settings, "destination_dir"); } update_default_destination = FALSE; } @@ -2911,7 +2914,7 @@ show_presets_toggled_cb(GtkToggleButton *button, signal_user_data_t *ud) gtk_window_resize(hb_window, 16, 16); } ghb_widget_to_setting(ud->settings, GTK_WIDGET(button)); - ghb_prefs_save(ud->settings); + ghb_pref_save(ud->settings, "show_presets"); } void @@ -3198,7 +3201,7 @@ hbfd_toggled_cb(GtkWidget *widget, signal_user_data_t *ud) ghb_widget_to_setting (ud->settings, widget); gboolean hbfd = ghb_settings_get_bool(ud->settings, "hbfd"); ghb_hbfd(ud, hbfd); - ghb_prefs_save(ud->settings); + ghb_pref_save(ud->settings, "hbfd"); } void @@ -3206,7 +3209,8 @@ pref_changed_cb(GtkWidget *widget, signal_user_data_t *ud) { g_debug("pref_changed_cb\n"); ghb_widget_to_setting (ud->settings, widget); - ghb_prefs_save(ud->settings); + const gchar *name = gtk_widget_get_name(widget); + ghb_pref_save(ud->settings, name); } void diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index fda240049..f877b984f 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -2738,7 +2738,8 @@ ghb_add_job(job_settings_t *js, gint unique_id) { job->select_subtitle = NULL; } - if( ghb_settings_get_bool(settings, "two_pass") ) + if( ghb_settings_get_bool(settings, "two_pass") && + !ghb_settings_get_bool(settings, "vquality_type_constant")) { /* * If subtitle_scan is enabled then only turn it on diff --git a/gtk/src/settings.c b/gtk/src/settings.c index 7d6c6bbba..31678de7c 100644 --- a/gtk/src/settings.c +++ b/gtk/src/settings.c @@ -1210,6 +1210,20 @@ ghb_prefs_save(GHashTable *settings) } } +void +ghb_pref_save(GHashTable *settings, const gchar *key) +{ + const gchar *value; + + if (prefs_initializing) return; + value = ghb_settings_get_string(settings, key); + if (value != NULL) + { + g_key_file_set_value(prefsKeyFile, "Preferences", key, value); + store_key_file(prefsKeyFile, "preferences"); + } +} + #if 0 static void dump_key_file(GKeyFile *keyFile, const gchar *section) diff --git a/gtk/src/settings.h b/gtk/src/settings.h index c831c0fa8..3ffc42f27 100644 --- a/gtk/src/settings.h +++ b/gtk/src/settings.h @@ -121,6 +121,7 @@ gint ghb_preset_flags(const gchar *name, gint *index); void ghb_prefs_load(signal_user_data_t *ud); void ghb_prefs_to_ui(signal_user_data_t *ud); void ghb_prefs_save(GHashTable *settings); +void ghb_pref_save(GHashTable *settings, const gchar *key); void ghb_set_preset_default(GHashTable *settings); #endif // _SETTINGS_H_ |