From 60fae20f233b2c8c4a0576fe46f5527e9c66552a Mon Sep 17 00:00:00 2001 From: jstebbins Date: Wed, 26 Aug 2009 16:29:05 +0000 Subject: [PATCH] LinGui: picture filter changes - change "None" to "Off" for detelecine, decomb, deinterlace, and denoise - add decomb/deinterlace switch, hide controls that are not active - update builtin presets to reflect change in order of "Custom" option git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2777 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- gtk/src/ghb.ui | 61 ++++++++++++++++++++++++++--------- gtk/src/hb-backend.c | 32 +++++++++++------- gtk/src/internal_defaults.xml | 10 +++--- gtk/src/presets.c | 8 ++--- gtk/src/queuehandler.c | 6 ++-- gtk/src/standard_presets.xml | 10 +++--- gtk/src/widgetdeps.c | 8 +++-- 7 files changed, 93 insertions(+), 42 deletions(-) diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui index f20fa4254..00d004ceb 100644 --- a/gtk/src/ghb.ui +++ b/gtk/src/ghb.ui @@ -5630,7 +5630,7 @@ the required multiple. True - 6 + 7 2 5 @@ -5674,14 +5674,45 @@ the required multiple. - + + Decomb True - 0 - Decomb: + True + False + True + True + + + + 2 + 3 + + + + + Deinterlace + True + True + False + True + PictureDecombDeinterlace 2 3 + 1 + 2 + + + + + True + 0 + Decomb: + + + 3 + 4 @@ -5692,8 +5723,8 @@ the required multiple. - 2 - 3 + 3 + 4 1 2 @@ -5709,22 +5740,22 @@ the required multiple. - 3 - 4 + 4 + 5 1 2 - + True 0 Deinterlace: - 4 - 5 + 5 + 6 @@ -5735,8 +5766,8 @@ the required multiple. - 4 - 5 + 5 + 6 1 2 @@ -5752,8 +5783,8 @@ the required multiple. - 5 - 6 + 6 + 7 1 2 diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 65f553f47..231903d01 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -173,7 +173,7 @@ combo_opts_t container_opts = static options_map_t d_detel_opts[] = { - {"None", "none", 0, ""}, + {"Off", "off", 0, ""}, {"Custom", "custom", 1, ""}, {"Default","default",2, NULL}, }; @@ -185,7 +185,7 @@ combo_opts_t detel_opts = static options_map_t d_decomb_opts[] = { - {"None", "none", 0, ""}, + {"Off", "off", 0, ""}, {"Custom", "custom", 1, ""}, {"Default","default",2, NULL}, }; @@ -197,7 +197,7 @@ combo_opts_t decomb_opts = static options_map_t d_deint_opts[] = { - {"None", "none", 0, ""}, + {"Off", "off", 0, ""}, {"Custom", "custom", 1, ""}, {"Fast", "fast", 2, "-1:-1:-1:0:1"}, {"Slow", "slow", 3, "2:-1:-1:0:1"}, @@ -211,7 +211,7 @@ combo_opts_t deint_opts = static options_map_t d_denoise_opts[] = { - {"None", "none", 0, ""}, + {"Off", "off", 0, ""}, {"Custom", "custom", 1, ""}, {"Weak", "weak", 2, "2:1:2:3"}, {"Medium", "medium", 3, "3:2:2:3"}, @@ -3382,9 +3382,17 @@ set_preview_job_settings(hb_job_t *job, GValue *settings) job->anamorphic.modulus = 2; } - gint deint = ghb_settings_combo_int(settings, "PictureDeinterlace"); - gint decomb = ghb_settings_combo_int(settings, "PictureDecomb"); - job->deinterlace = (!decomb && deint == 0) ? 0 : 1; + gboolean decomb_deint = ghb_settings_get_boolean(settings, "PictureDecombDeinterlace"); + if (decomb_deint) + { + gint decomb = ghb_settings_combo_int(settings, "PictureDecomb"); + job->deinterlace = (decomb == 0) ? 0 : 1; + } + else + { + gint deint = ghb_settings_combo_int(settings, "PictureDeinterlace"); + job->deinterlace = (deint == 0) ? 0 : 1; + } gboolean keep_aspect; keep_aspect = ghb_settings_get_boolean(settings, "PictureKeepRatio"); @@ -3463,9 +3471,10 @@ ghb_validate_filters(signal_user_data_t *ud) gint index; gchar *message; + gboolean decomb_deint = ghb_settings_get_boolean(ud->settings, "PictureDecombDeinterlace"); // deinte index = ghb_settings_combo_int(ud->settings, "PictureDeinterlace"); - if (index == 1) + if (!decomb_deint && index == 1) { str = ghb_settings_get_string(ud->settings, "PictureDeinterlaceCustom"); if (!ghb_validate_filter_string(str, 4)) @@ -3499,7 +3508,7 @@ ghb_validate_filters(signal_user_data_t *ud) } // decomb index = ghb_settings_combo_int(ud->settings, "PictureDecomb"); - if (index == 1) + if (decomb_deint && index == 1) { str = ghb_settings_get_string(ud->settings, "PictureDecombCustom"); if (!ghb_validate_filter_string(str, 15)) @@ -4016,9 +4025,10 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex) job->crop[3] = ghb_settings_get_int(js, "PictureRightCrop"); + gboolean decomb_deint = ghb_settings_get_boolean(js, "PictureDecombDeinterlace"); gint decomb = ghb_settings_combo_int(js, "PictureDecomb"); gint deint = ghb_settings_combo_int(js, "PictureDeinterlace"); - if (!decomb) + if (!decomb_deint) job->deinterlace = (deint != 0) ? 1 : 0; else job->deinterlace = 0; @@ -4064,7 +4074,7 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex) hb_filter_detelecine.settings = detel_str; hb_list_add( job->filters, &hb_filter_detelecine ); } - if ( decomb ) + if ( decomb_deint && decomb ) { if (decomb != 1) { diff --git a/gtk/src/internal_defaults.xml b/gtk/src/internal_defaults.xml index fe8d9e098..c103b99e3 100644 --- a/gtk/src/internal_defaults.xml +++ b/gtk/src/internal_defaults.xml @@ -219,8 +219,10 @@ 16 PictureDeblock 0 + PictureDecombDeinterlace + PictureDecomb - none + off PictureDecombCustom Default @@ -234,15 +236,15 @@ PictureTopCrop 0 PictureDeinterlace - none + off PictureDeinterlaceCustom PictureDenoise - none + off PictureDenoiseCustom PictureDetelecine - none + off PictureDetelecineCustom PicturePAR diff --git a/gtk/src/presets.c b/gtk/src/presets.c index 43babd138..7d3151906 100644 --- a/gtk/src/presets.c +++ b/gtk/src/presets.c @@ -1855,7 +1855,7 @@ value_map_t mix_xlat[] = value_map_t deint_xlat[] = { - {"0", "none"}, + {"0", "off"}, {"1", "custom"}, {"2", "fast"}, {"3", "slow"}, @@ -1865,7 +1865,7 @@ value_map_t deint_xlat[] = value_map_t denoise_xlat[] = { - {"0", "none"}, + {"0", "off"}, {"1", "custom"}, {"2", "weak"}, {"3", "medium"}, @@ -1875,7 +1875,7 @@ value_map_t denoise_xlat[] = value_map_t detel_xlat[] = { - {"0", "none"}, + {"0", "off"}, {"1", "custom"}, {"2", "default"}, {NULL, NULL} @@ -1883,7 +1883,7 @@ value_map_t detel_xlat[] = value_map_t decomb_xlat[] = { - {"0", "none"}, + {"0", "off"}, {"1", "custom"}, {"2", "default"}, {NULL, NULL} diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c index 8aca1f626..8456d2754 100644 --- a/gtk/src/queuehandler.c +++ b/gtk/src/queuehandler.c @@ -283,8 +283,10 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) source_width, source_height, width, height, aspect_desc); gint decomb, detel; + gboolean decomb_deint; gboolean filters = FALSE; + decomb_deint = ghb_settings_get_boolean(settings, "PictureDecombDeinterlace"); decomb = ghb_settings_combo_int(settings, "PictureDecomb"); g_string_append_printf(str, "Filters:"); detel = ghb_settings_combo_int(settings, "PictureDetelecine"); @@ -300,7 +302,7 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) } filters = TRUE; } - if (decomb) + if (decomb_deint && decomb) { g_string_append_printf(str, " - Decomb"); if (decomb == 1) @@ -312,7 +314,7 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) } filters = TRUE; } - else + else if (!decomb_deint) { gint deint = ghb_settings_combo_int(settings, "PictureDeinterlace"); if (deint) diff --git a/gtk/src/standard_presets.xml b/gtk/src/standard_presets.xml index 1f8e8c980..76b5eda0b 100644 --- a/gtk/src/standard_presets.xml +++ b/gtk/src/standard_presets.xml @@ -387,7 +387,7 @@ Folder PresetBuildNumber - 2009073001 + 2009082501 PresetName Apple Type @@ -528,13 +528,15 @@ PictureDeblock 0 PictureDecomb + 2 + PictureDecombDeinterlace 1 PictureDeinterlace 0 PictureDenoise 0 PictureDetelecine - 1 + 2 PictureHeight 0 PictureKeepRatio @@ -590,7 +592,7 @@ Folder PresetBuildNumber - 2009073001 + 2009082501 PresetName Regular Type @@ -965,7 +967,7 @@ Folder PresetBuildNumber - 2009073001 + 2009082501 PresetName Legacy Type diff --git a/gtk/src/widgetdeps.c b/gtk/src/widgetdeps.c index 598b86b4e..4747f69de 100644 --- a/gtk/src/widgetdeps.c +++ b/gtk/src/widgetdeps.c @@ -40,8 +40,12 @@ static dependency_t dep_map[] = {"FileFormat", "Mp4LargeFile", "mp4", FALSE, TRUE}, {"FileFormat", "Mp4HttpOptimize", "mp4", FALSE, TRUE}, {"FileFormat", "Mp4iPodCompatible", "mp4", FALSE, TRUE}, - {"PictureDecomb", "PictureDeinterlace", "none", FALSE, FALSE}, - {"PictureDecomb", "PictureDeinterlaceCustom", "none", FALSE, TRUE}, + {"PictureDecombDeinterlace", "PictureDeinterlace", "TRUE", TRUE, TRUE}, + {"PictureDecombDeinterlace", "PictureDeinterlaceCustom", "TRUE", TRUE, TRUE}, + {"PictureDecombDeinterlace", "PictureDeinterlaceLabel", "TRUE", TRUE, TRUE}, + {"PictureDecombDeinterlace", "PictureDecomb", "FALSE", TRUE, TRUE}, + {"PictureDecombDeinterlace", "PictureDecombCustom", "FALSE", TRUE, TRUE}, + {"PictureDecombDeinterlace", "PictureDecombLabel", "FALSE", TRUE, TRUE}, {"PictureDeinterlace", "PictureDeinterlaceCustom", "custom", FALSE, TRUE}, {"PictureDenoise", "PictureDenoiseCustom", "custom", FALSE, TRUE}, {"PictureDecomb", "PictureDecombCustom", "custom", FALSE, TRUE}, -- 2.40.0