From 00eeae7591023ed47a5cd6b90bf7b11ac1bfae41 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Mon, 31 Oct 2016 09:35:27 -0700 Subject: Add new anamorphic mode "Automatic", delete "Strict" (#367) * Add new anamorphic mode "Automatic", delete "Strict" Anamorphic mode automatic is added to support Bradley's new presets that are designed to pick a PAR that maximizes storage resolution. Strict is converted to Loose + mod == 2 + UsesPictureSettings == 2 when importing presets --- gtk/src/callbacks.c | 16 +++++++++++----- gtk/src/ghb.m4 | 14 ++++++++------ gtk/src/hb-backend.c | 14 +++++++------- gtk/src/presets.c | 9 +-------- gtk/src/queuehandler.c | 2 +- 5 files changed, 28 insertions(+), 27 deletions(-) (limited to 'gtk/src') diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index 372d20280..83b7da46c 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -1698,18 +1698,21 @@ update_aspect_info(signal_user_data_t *ud) gtk_label_set_text(GTK_LABEL(widget), text); switch (ghb_settings_combo_int(ud->settings, "PicturePAR")) { - case 0: + case HB_ANAMORPHIC_NONE: text = _("Off"); break; - case 1: + case HB_ANAMORPHIC_STRICT: text = _("Strict"); break; - case 2: + case HB_ANAMORPHIC_LOOSE: text = _("Loose"); break; - case 3: + case HB_ANAMORPHIC_CUSTOM: text = _("Custom"); break; + case HB_ANAMORPHIC_AUTO: + text = _("Automatic"); + break; default: text = _("Unknown"); break; @@ -1877,7 +1880,10 @@ set_title_settings(signal_user_data_t *ud, GhbValue *settings) gint pic_par; keep_aspect = ghb_dict_get_bool(settings, "PictureKeepRatio"); pic_par = ghb_settings_combo_int(settings, "PicturePAR"); - if (!(keep_aspect || pic_par) || pic_par == 3) + if (!keep_aspect || + pic_par == HB_ANAMORPHIC_NONE || + pic_par == HB_ANAMORPHIC_AUTO || + pic_par == HB_ANAMORPHIC_CUSTOM) { ghb_dict_set_int(settings, "scale_height", title->geometry.height - title->crop[0] - title->crop[1]); diff --git a/gtk/src/ghb.m4 b/gtk/src/ghb.m4 index 3d0f2f642..0c2a8ff42 100644 --- a/gtk/src/ghb.m4 +++ b/gtk/src/ghb.m4 @@ -2509,12 +2509,14 @@ The actual display dimensions will differ if the pixel aspect ratio is not 1:1.< GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Anamorphic Modes:</b> <small><tt> -None - Force pixel aspect ratio to 1:1. -Loose - Align dimensions to chosen 'Alignment' value - and pick pixel aspect ratio that preserves the - original display aspect ratio -Strict - Keep original source dimensions and pixel - aspect ratio</tt></small> +None - Force pixel aspect ratio to 1:1. +Loose - Use a pixel aspect ratio that is as + close as possible to the source video pixel + aspect ratio while preserving the original + display aspect ratio +Automatic - Use a pixel aspect ratio that maximizes + storage resolution while preserving the original + display aspect ratio</tt></small> diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index a88afec50..5f5076a49 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -120,10 +120,10 @@ combo_opts_t when_complete_opts = static options_map_t d_par_opts[] = { - {N_("Off"), "off", 0}, - {N_("Strict"), "strict", 1}, - {N_("Loose"), "loose", 2}, - {N_("Custom"), "custom", 3}, + {N_("Off"), "off", HB_ANAMORPHIC_NONE}, + {N_("Automatic"), "auto", HB_ANAMORPHIC_AUTO}, + {N_("Loose"), "loose", HB_ANAMORPHIC_LOOSE}, + {N_("Custom"), "custom", HB_ANAMORPHIC_CUSTOM}, }; combo_opts_t par_opts = { @@ -3404,8 +3404,6 @@ ghb_set_scale_settings(GhbValue *settings, gint mode) gint max_width = 0; gint max_height = 0; - g_debug("ghb_set_scale ()\n"); - pic_par = ghb_settings_combo_int(settings, "PicturePAR"); if (pic_par == HB_ANAMORPHIC_STRICT) { @@ -3413,7 +3411,9 @@ ghb_set_scale_settings(GhbValue *settings, gint mode) ghb_dict_set_int(settings, "PictureModulus", 2); ghb_dict_set_bool(settings, "PictureLooseCrop", TRUE); } - if (pic_par == HB_ANAMORPHIC_STRICT || pic_par == HB_ANAMORPHIC_LOOSE) + if (pic_par == HB_ANAMORPHIC_STRICT || + pic_par == HB_ANAMORPHIC_AUTO || + pic_par == HB_ANAMORPHIC_LOOSE) { ghb_dict_set_bool(settings, "PictureKeepRatio", TRUE); } diff --git a/gtk/src/presets.c b/gtk/src/presets.c index 76e09855e..256c7ef12 100644 --- a/gtk/src/presets.c +++ b/gtk/src/presets.c @@ -292,21 +292,14 @@ ghb_preset_to_settings(GhbValue *settings, GhbValue *preset) ghb_dict_get_value(settings, "PictureWidth"))); int width, height, uses_pic, autoscale; - const char * pic_par; width = ghb_dict_get_int(settings, "PictureWidth"); height = ghb_dict_get_int(settings, "PictureHeight"); uses_pic = ghb_dict_get_int(settings, "UsesPictureSettings"); - pic_par = ghb_dict_get_string(settings, "PicturePAR"); - autoscale = uses_pic == 2 || (width == 0 && height == 0); + autoscale = uses_pic != 1 || (width == 0 && height == 0); ghb_dict_set_bool(settings, "autoscale", autoscale); - if (!autoscale && pic_par != NULL && !strcasecmp(pic_par, "strict")) - { - ghb_dict_set_string(settings, "PicturePAR", "loose"); - } - gint vqtype; vqtype = ghb_dict_get_int(settings, "VideoQualityType"); diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c index 952543715..00ff52429 100644 --- a/gtk/src/queuehandler.c +++ b/gtk/src/queuehandler.c @@ -332,7 +332,7 @@ add_to_queue_list(signal_user_data_t *ud, GhbValue *queueDict, GtkTreeIter *pite aspect_desc = _("(Aspect Lost)"); } } - else if (!strcasecmp(pic_par, "strict") || !strcasecmp(pic_par, "loose")) + else if (!strcasecmp(pic_par, "auto") || !strcasecmp(pic_par, "loose")) { aspect_desc = _("(Anamorphic)"); } -- cgit v1.2.3