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

Function ghb_get_current_preset

gtk/src/presets.c:3181–3210  ·  view source on GitHub ↗

Makes a copy of the preset and assigns "PresetFullName" which is use to look up the preset in the preset list should the need arrise, e.g. saving changes to the preset.

Source from the content-addressed store, hash-verified

3179// is use to look up the preset in the preset list should the need
3180// arrise, e.g. saving changes to the preset.
3181GhbValue*
3182ghb_get_current_preset(signal_user_data_t *ud)
3183{
3184 GtkTreeView *tv;
3185 GtkTreeModel *tm;
3186 GtkTreeSelection *ts;
3187 GtkTreeIter ti;
3188 GhbValue *preset = NULL;
3189
3190 tv = GTK_TREE_VIEW(ghb_builder_widget("presets_list"));
3191 ts = gtk_tree_view_get_selection(tv);
3192 if (gtk_tree_selection_get_selected(ts, &tm, &ti))
3193 {
3194 hb_preset_index_t *path;
3195
3196 path = tree_get_index(tm, &ti);
3197 preset = hb_preset_get(path);
3198 if (preset != NULL)
3199 {
3200 char *fullname;
3201
3202 preset = hb_value_dup(preset);
3203 fullname = preset_get_fullname(path, "/", FALSE);
3204 ghb_dict_set_string(preset, "PresetFullName", fullname);
3205 free(fullname);
3206 }
3207 free(path);
3208 }
3209 return preset;
3210}
3211
3212G_MODULE_EXPORT void
3213presets_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_t *ud)

Callers 1

load_all_titlesFunction · 0.85

Calls 6

ghb_builder_widgetFunction · 0.85
tree_get_indexFunction · 0.85
hb_preset_getFunction · 0.85
hb_value_dupFunction · 0.85
preset_get_fullnameFunction · 0.85
ghb_dict_set_stringFunction · 0.85

Tested by

no test coverage detected