summaryrefslogtreecommitdiffstats
path: root/gtk/src
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2016-10-31 09:35:27 -0700
committerGitHub <[email protected]>2016-10-31 09:35:27 -0700
commit00eeae7591023ed47a5cd6b90bf7b11ac1bfae41 (patch)
tree54cfe6bd3dced28944974448f888fda63f51a274 /gtk/src
parent0a913f088db821b964edfd5a711292cc6069cfa9 (diff)
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
Diffstat (limited to 'gtk/src')
-rw-r--r--gtk/src/callbacks.c16
-rw-r--r--gtk/src/ghb.m414
-rw-r--r--gtk/src/hb-backend.c14
-rw-r--r--gtk/src/presets.c9
-rw-r--r--gtk/src/queuehandler.c2
5 files changed, 28 insertions, 27 deletions
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.<
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip_markup" translatable="yes">&lt;b&gt;Anamorphic Modes:&lt;/b&gt;
&lt;small&gt;&lt;tt&gt;
-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&lt;/tt&gt;&lt;/small&gt;</property>
+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&lt;/tt&gt;&lt;/small&gt;</property>
<signal name="changed" handler="scale_changed_cb" swapped="no"/>
</object>
<packing>
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)");
}