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

Function title_opts_set

gtk/src/hb-backend.c:2492–2544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2490}
2491
2492static void
2493title_opts_set(signal_user_data_t *ud, const gchar *name,
2494 void *opts, const void* data)
2495{
2496 (void)opts; // Silence "unused variable" warning
2497 (void)data; // Silence "unused variable" warning
2498 GtkTreeIter iter;
2499 GtkListStore *store;
2500 hb_list_t * list = NULL;
2501 const hb_title_t * title = NULL;
2502 gint ii;
2503 gint count = 0;
2504
2505
2506 GtkComboBox *combo = GTK_COMBO_BOX(ghb_builder_widget(name));
2507 store = GTK_LIST_STORE(gtk_combo_box_get_model (combo));
2508 gtk_list_store_clear(store);
2509 if (h_scan != NULL)
2510 {
2511 list = hb_get_titles( h_scan );
2512 count = hb_list_count( list );
2513 }
2514 if( count <= 0 )
2515 {
2516 // No titles. Fill in a default.
2517 gtk_list_store_append(store, &iter);
2518 gtk_list_store_set(store, &iter,
2519 0, _("No Titles"),
2520 1, TRUE,
2521 2, "none",
2522 3, -1.0,
2523 -1);
2524 return;
2525 }
2526 for (ii = 0; ii < count; ii++)
2527 {
2528 char *title_opt, *title_index;
2529
2530 title = hb_list_item(list, ii);
2531 title_opt = ghb_create_title_label(title);
2532 title_index = g_strdup_printf("%d", title->index);
2533
2534 gtk_list_store_append(store, &iter);
2535 gtk_list_store_set(store, &iter,
2536 0, title_opt,
2537 1, TRUE,
2538 2, title_index,
2539 3, (gdouble)title->index,
2540 -1);
2541 g_free(title_opt);
2542 g_free(title_index);
2543 }
2544}
2545
2546static int
2547lookup_title_index(hb_handle_t *h, int title_id)

Callers

nothing calls this directly

Calls 5

ghb_builder_widgetFunction · 0.85
hb_get_titlesFunction · 0.85
hb_list_countFunction · 0.85
hb_list_itemFunction · 0.85
ghb_create_title_labelFunction · 0.85

Tested by

no test coverage detected