summaryrefslogtreecommitdiffstats
path: root/gtk/src/hb-backend.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2016-02-20 18:00:46 -0700
committerJohn Stebbins <[email protected]>2016-03-09 13:10:10 -0700
commita44ccb49f182d4eeb122fbe675b28deb5c36b793 (patch)
tree6cc064cc24dacc2a80d41fb9543640c9004895af /gtk/src/hb-backend.c
parent96c02dd6f256f4a4e74f8962f56502d28e5e65a3 (diff)
filters: make job filter settings an hb_dict_t
This simplifies accessing and changing filter parameters programatically. It also changes the custom filter string format to a ':' separated list of key/value pairs.
Diffstat (limited to 'gtk/src/hb-backend.c')
-rw-r--r--gtk/src/hb-backend.c54
1 files changed, 17 insertions, 37 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index ccadcfbd4..2a8d79bb9 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -3741,12 +3741,10 @@ ghb_validate_filters(GhbValue *settings, GtkWindow *parent)
"PictureDeinterlaceFilter");
deint_preset = ghb_dict_get_string(settings,
"PictureDeinterlacePreset");
- if (!strcasecmp(deint_preset, "custom"))
- {
- deint_custom = ghb_dict_get_string(settings,
- "PictureDeinterlaceCustom");
- }
- if (hb_validate_filter_preset(filter_id, deint_preset, deint_custom))
+ deint_custom = ghb_dict_get_string(settings,
+ "PictureDeinterlaceCustom");
+ if (hb_validate_filter_preset(filter_id, deint_preset, NULL,
+ deint_custom))
{
if (deint_custom != NULL)
{
@@ -3780,12 +3778,9 @@ ghb_validate_filters(GhbValue *settings, GtkWindow *parent)
int filter_id;
filter_id = HB_FILTER_DETELECINE;
- if (!strcasecmp(detel_preset, "custom"))
- {
- detel_custom = ghb_dict_get_string(settings,
- "PictureDetelecineCustom");
- }
- if (hb_validate_filter_preset(filter_id, detel_preset, detel_custom))
+ detel_custom = ghb_dict_get_string(settings, "PictureDetelecineCustom");
+ if (hb_validate_filter_preset(filter_id, detel_preset, NULL,
+ detel_custom))
{
if (detel_custom != NULL)
{
@@ -3820,32 +3815,17 @@ ghb_validate_filters(GhbValue *settings, GtkWindow *parent)
{
denoise_tune = ghb_dict_get_string(settings, "PictureDenoiseTune");
}
- if (!strcasecmp(denoise_preset, "custom"))
+ denoise_custom = ghb_dict_get_string(settings, "PictureDenoiseCustom");
+ if (hb_validate_filter_preset(filter_id, denoise_preset, denoise_tune,
+ denoise_custom))
{
- denoise_custom = ghb_dict_get_string(settings,
- "PictureDenoiseCustom");
- }
- if (hb_validate_filter_preset(filter_id, denoise_preset,
- denoise_custom != NULL ? denoise_custom : denoise_tune))
- {
- if (denoise_custom != NULL)
- {
- message = g_strdup_printf(
- _("Invalid Denoise Settings:\n\n"
- "Filter: %s\n"
- "Preset: %s\n"
- "Custom: %s\n"), denoise_filter, denoise_preset,
- denoise_custom);
- }
- else
- {
- message = g_strdup_printf(
- _("Invalid Denoise Settings:\n\n"
- "Filter: %s\n"
- "Preset: %s\n"
- "Tune: %s\n"), denoise_filter, denoise_preset,
- denoise_tune);
- }
+ message = g_strdup_printf(
+ _("Invalid Denoise Settings:\n\n"
+ "Filter: %s\n"
+ "Preset: %s\n"
+ "Tune: %s\n"
+ "Custom: %s\n"), denoise_filter, denoise_preset,
+ denoise_tune, denoise_custom);
ghb_message_dialog(parent, GTK_MESSAGE_ERROR,
message, _("Cancel"), NULL);
g_free(message);