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

Function subtitle_get_selected_settings

gtk/src/subtitlehandler.c:573–619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

571}
572
573static GhbValue*
574subtitle_get_selected_settings(signal_user_data_t *ud, int *index)
575{
576 GtkTreeView *tv;
577 GtkTreeSelection *ts;
578 GtkTreeModel *tm;
579 GtkTreeIter iter;
580 GhbValue *subsettings = NULL;
581
582 tv = GTK_TREE_VIEW(ghb_builder_widget("subtitle_list_view"));
583 ts = gtk_tree_view_get_selection(tv);
584 if (gtk_tree_selection_get_selected(ts, &tm, &iter))
585 {
586 GhbValue *subtitle_list, *subtitle_search;
587 gboolean search;
588 gint row, *indices;
589 GtkTreePath *tp;
590
591 // Get the row number
592 tp = gtk_tree_model_get_path(tm, &iter);
593 indices = gtk_tree_path_get_indices(tp);
594 row = indices[0];
595 gtk_tree_path_free(tp);
596
597 subtitle_search = ghb_get_job_subtitle_search(ud->settings);
598 search = ghb_dict_get_bool(subtitle_search, "Enable");
599 if (search)
600 {
601 if (row == 0)
602 {
603 if (index != NULL)
604 *index = -1;
605 return subtitle_search;
606 }
607 row--;
608 }
609
610 subtitle_list = ghb_get_job_subtitle_list(ud->settings);
611 if (row < 0 || row >= ghb_array_len(subtitle_list))
612 return NULL;
613
614 subsettings = ghb_array_get(subtitle_list, row);
615 if (index != NULL)
616 *index = row;
617 }
618 return subsettings;
619}
620
621static void
622subtitle_update_dialog_widgets(signal_user_data_t *ud, GhbValue *subsettings)

Callers 8

subtitle_update_settingFunction · 0.85
import_setting_updateFunction · 0.85
ghb_subtitle_pruneFunction · 0.85
subtitle_edit_responseFunction · 0.85

Calls 4

ghb_builder_widgetFunction · 0.85
ghb_dict_get_boolFunction · 0.85

Tested by

no test coverage detected