MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / meta_pass_changed_cb

Function meta_pass_changed_cb

gtk/src/callbacks.c:2989–3058  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2987}
2988
2989G_MODULE_EXPORT void
2990meta_pass_changed_cb (GtkWidget *widget, gpointer data)
2991{
2992 setting_widget_changed_cb(widget, data);
2993
2994 int title_id, titleindex;
2995 const hb_title_t * title;
2996 signal_user_data_t *ud = ghb_ud();
2997
2998 title_id = ghb_dict_get_int(ud->settings, "title");
2999 title = ghb_lookup_title(title_id, &titleindex);
3000
3001 if (title != NULL &&
3002 ghb_dict_get_bool(ud->settings, "MetadataPassthru"))
3003 {
3004 // Reload metadata from title
3005 if (title->metadata && title->metadata->dict)
3006 {
3007
3008 hb_dict_iter_t iter = hb_dict_iter_init(title->metadata->dict);
3009
3010 while (iter != HB_DICT_ITER_DONE)
3011 {
3012 const char * key;
3013 hb_value_t * val;
3014
3015 hb_dict_iter_next_ex(title->metadata->dict, &iter, &key, &val);
3016 if (key != NULL && val != NULL)
3017 {
3018 const char * str = hb_value_get_string(val);
3019
3020 update_meta(ud->settings, key, str);
3021
3022 if (!strcmp(key, "Album"))
3023 {
3024 key = "Name";
3025 }
3026 char * ui_key = g_strdup_printf("Meta%s", key);
3027 ghb_dict_set_string(ud->settings, ui_key, str);
3028 free(ui_key);
3029 }
3030 }
3031 }
3032 }
3033 else
3034 {
3035 // Clear metadata
3036 ghb_dict_set_string(ud->settings, "MetaName", "");
3037 ghb_dict_set_string(ud->settings, "MetaArtist", "");
3038 ghb_dict_set_string(ud->settings, "MetaReleaseDate", "");
3039 ghb_dict_set_string(ud->settings, "MetaComment", "");
3040 ghb_dict_set_string(ud->settings, "MetaAlbumArtist", "");
3041 ghb_dict_set_string(ud->settings, "MetaGenre", "");
3042 ghb_dict_set_string(ud->settings, "MetaDescription", "");
3043 ghb_dict_set_string(ud->settings, "MetaLongDescription", "");
3044
3045 GhbValue * meta = ghb_get_job_metadata_settings(ud->settings);
3046 hb_dict_clear(meta);

Callers

nothing calls this directly

Calls 13

ghb_udFunction · 0.85
ghb_dict_get_intFunction · 0.85
ghb_lookup_titleFunction · 0.85
ghb_dict_get_boolFunction · 0.85
hb_dict_iter_initFunction · 0.85
hb_dict_iter_next_exFunction · 0.85
hb_value_get_stringFunction · 0.85
update_metaFunction · 0.85
ghb_dict_set_stringFunction · 0.85
hb_dict_clearFunction · 0.85

Tested by

no test coverage detected