presets_remove_nth(folder, indices[len-1]);
else
{
- g_warning("ghb_presets_remove ()");
- g_warning("internal preset lookup error");
+ g_warning("ghb_presets_remove (): internal preset lookup error");
return FALSE;
}
return TRUE;
ghb_array_replace(folder, indices[len-1], dict);
else
{
- g_warning("ghb_presets_replace ()");
- g_warning("internal preset lookup error");
+ g_warning("ghb_presets_replace (): internal preset lookup error");
}
}
ghb_array_insert(folder, indices[len-1], dict);
else
{
- g_warning("ghb_presets_insert ()");
- g_warning("internal preset lookup error");
+ g_warning("ghb_presets_insert (): internal preset lookup error");
}
}
{
if (preset_is_default(dict))
{
- indices = malloc(MAX_NESTED_PRESET * sizeof(gint));
+ indices = g_malloc(MAX_NESTED_PRESET * sizeof(gint));
indices[*len] = ii;
(*len)++;
return indices;
}
else
{
- g_warning("ghb_presets_get_type ()");
- g_warning("internal preset lookup error");
+ g_warning("ghb_presets_get_type (): internal preset lookup error");
}
return type;
}
}
else
{
- g_warning("ghb_presets_get_folder ()");
- g_warning("internal preset lookup error");
+ g_warning("ghb_presets_get_folder (): internal preset lookup error");
}
return folder;
}
init_settings_from_dict(ud->settings, hidden, dict);
init_ui_from_dict(ud, internal, dict);
init_ui_from_dict(ud, hidden, dict);
-
- if (ghb_settings_get_boolean(ud->settings, "allow_tweaks"))
- {
- const GValue *gval;
- gval = preset_dict_get_value(dict, "PictureDeinterlace");
- if (gval)
- {
- ghb_ui_update(ud, "tweak_PictureDeinterlace", gval);
- }
- gval = preset_dict_get_value(dict, "PictureDenoise");
- if (gval)
- {
- ghb_ui_update(ud, "tweak_PictureDenoise", gval);
- }
- }
}
void
static GValue *current_preset = NULL;
+gboolean
+ghb_preset_is_custom()
+{
+ const GValue *val;
+
+ if (current_preset == NULL) return FALSE;
+ val = preset_dict_get_value(current_preset, "Type");
+ return (ghb_value_int(val) == 1);
+}
+
void
ghb_set_preset_from_indices(signal_user_data_t *ud, gint *indices, gint len)
{
}
gchar*
-ghb_get_user_config_dir()
+ghb_get_user_config_dir(gchar *subdir)
{
const gchar *dir;
gchar *config;
if (!g_file_test(config, G_FILE_TEST_IS_DIR))
g_mkdir (config, 0755);
}
+ if (subdir)
+ {
+ gchar **split;
+ gint ii;
+
+ split = g_strsplit(subdir, "/", -1);
+ for (ii = 0; split[ii] != NULL; ii++)
+ {
+ gchar *tmp;
+
+ tmp = g_strdup_printf ("%s/%s", config, split[ii]);
+ g_free(config);
+ config = tmp;
+ if (!g_file_test(config, G_FILE_TEST_IS_DIR))
+ g_mkdir (config, 0755);
+ }
+ }
return config;
}
gchar *config, *path;
FILE *file;
- config = ghb_get_user_config_dir();
+ config = ghb_get_user_config_dir(NULL);
path = g_strdup_printf ("%s/%s", config, name);
file = g_fopen(path, "w");
g_free(config);
gchar *config, *path;
GValue *plist = NULL;
- config = ghb_get_user_config_dir();
+ config = ghb_get_user_config_dir(NULL);
path = g_strdup_printf ("%s/%s", config, name);
if (g_file_test(path, G_FILE_TEST_IS_REGULAR))
{
{
gchar *config, *path;
- config = ghb_get_user_config_dir();
+ config = ghb_get_user_config_dir(NULL);
path = g_strdup_printf ("%s/%s", config, name);
if (g_file_test(path, G_FILE_TEST_IS_REGULAR))
{
}
gval = ghb_settings_get_value(ud->settings, "default_source");
ghb_settings_set_value (ud->settings, "source", gval);
+
str = ghb_settings_get_string(ud->settings, "destination_dir");
+ ghb_ui_update(ud, "dest_dir", ghb_string_value(str));
- gchar *path = g_strdup_printf ("%s/new_video.mp4", str);
- ghb_ui_update(ud, "destination", ghb_string_value(path));
+ gchar *file = g_strdup_printf ("new_video.mp4");
+ ghb_ui_update(ud, "dest_file", ghb_string_value(file));
g_free(str);
- g_free(path);
+ g_free(file);
prefs_initializing = FALSE;
}
value_map_t deint_xlat[] =
{
{"0", "none"},
- {"1", "fast"},
- {"2", "slow"},
- {"3", "slower"},
+ {"1", "custom"},
+ {"2", "fast"},
+ {"3", "slow"},
+ {"4", "slower"},
{NULL, NULL}
};
value_map_t denoise_xlat[] =
{
{"0", "none"},
- {"1", "weak"},
- {"2", "medium"},
- {"3", "strong"},
+ {"1", "custom"},
+ {"2", "weak"},
+ {"3", "medium"},
+ {"4", "strong"},
+ {NULL, NULL}
+};
+
+value_map_t detel_xlat[] =
+{
+ {"0", "none"},
+ {"1", "custom"},
+ {"2", "default"},
+ {NULL, NULL}
+};
+
+value_map_t decomb_xlat[] =
+{
+ {"0", "none"},
+ {"1", "custom"},
+ {"2", "default"},
{NULL, NULL}
};
gval = export_value_xlat2(framerate_xlat, lin_val, G_TYPE_STRING);
if (gval)
ghb_dict_insert(dict, g_strdup(key), gval);
+ key = "PictureDetelecine";
+ lin_val = ghb_dict_lookup(dict, key);
+ gval = export_value_xlat2(detel_xlat, lin_val, G_TYPE_INT);
+ if (gval)
+ ghb_dict_insert(dict, g_strdup(key), gval);
+ else
+ ghb_dict_insert(dict, g_strdup(key), ghb_value_dup(lin_val));
+ key = "PictureDecomb";
+ lin_val = ghb_dict_lookup(dict, key);
+ gval = export_value_xlat2(decomb_xlat, lin_val, G_TYPE_INT);
+ if (gval)
+ ghb_dict_insert(dict, g_strdup(key), gval);
+ else
+ ghb_dict_insert(dict, g_strdup(key), ghb_value_dup(lin_val));
key = "PictureDeinterlace";
lin_val = ghb_dict_lookup(dict, key);
gval = export_value_xlat2(deint_xlat, lin_val, G_TYPE_INT);
gval = import_value_xlat2(defaults, framerate_xlat, key, mac_val);
if (gval)
ghb_dict_insert(dict, g_strdup(key), gval);
+ key = "PictureDetelecine";
+ mac_val = ghb_dict_lookup(dict, key);
+ gval = import_value_xlat2(defaults, detel_xlat, key, mac_val);
+ if (gval)
+ ghb_dict_insert(dict, g_strdup(key), gval);
+ key = "PictureDecomb";
+ mac_val = ghb_dict_lookup(dict, key);
+ gval = import_value_xlat2(defaults, decomb_xlat, key, mac_val);
+ if (gval)
+ ghb_dict_insert(dict, g_strdup(key), gval);
key = "PictureDeinterlace";
mac_val = ghb_dict_lookup(dict, key);
gval = import_value_xlat2(defaults, deint_xlat, key, mac_val);
ghb_dict_insert(dict, g_strdup("VideoQualityType"),
ghb_int_value_new(2));
}
+ ghb_dict_remove(dict, "UsesMaxPictureSettings");
ghb_dict_remove(dict, "autoscale");
ghb_dict_remove(dict, "anamorphic");
ghb_dict_remove(dict, "vquality_type_target");
if (presetsPlist == NULL)
{
presetsPlist = ghb_value_dup(ghb_resource_get("standard-presets"));
+ import_xlat_presets(presetsPlist);
store_presets();
}
else if (G_VALUE_TYPE(presetsPlist) == ghb_dict_get_type())
{ // Presets is older dictionary format. Convert to array
ghb_value_free(presetsPlist);
presetsPlist = ghb_value_dup(ghb_resource_get("standard-presets"));
+ import_xlat_presets(presetsPlist);
store_presets();
}
else if (check_old_presets())
{
ghb_value_free(presetsPlist);
presetsPlist = ghb_value_dup(ghb_resource_get("standard-presets"));
+ import_xlat_presets(presetsPlist);
store_presets();
}
import_xlat_presets(presetsPlist);
return;
}
}
-
- if (ghb_settings_get_boolean(ud->settings, "allow_tweaks"))
- {
- gchar *str;
- str = ghb_settings_get_string(ud->settings, "tweak_PictureDeinterlace");
- if (str)
- {
- ghb_settings_set_string(ud->settings, "PictureDeinterlace", str);
- g_free(str);
- }
- str = ghb_settings_get_string(ud->settings, "tweak_PictureDenoise");
- if (str)
- {
- ghb_settings_set_string(ud->settings, "PictureDenoise", str);
- g_free(str);
- }
- }
+ current_preset = dict;
autoscale = ghb_settings_get_boolean(ud->settings, "autoscale");
ghb_settings_set_int64(ud->settings, "Type", PRESETS_CUSTOM);