| 675 | } |
| 676 | |
| 677 | static GhbValue* |
| 678 | audio_get_selected_settings(signal_user_data_t *ud, int *index) |
| 679 | { |
| 680 | GtkTreeView *tv; |
| 681 | GtkTreePath *tp; |
| 682 | GtkTreeSelection *ts; |
| 683 | GtkTreeModel *tm; |
| 684 | GtkTreeIter ti; |
| 685 | gint *indices; |
| 686 | gint row; |
| 687 | GhbValue *asettings = NULL; |
| 688 | const GhbValue *audio_list; |
| 689 | |
| 690 | tv = GTK_TREE_VIEW(ghb_builder_widget("audio_list_view")); |
| 691 | ts = gtk_tree_view_get_selection (tv); |
| 692 | if (gtk_tree_selection_get_selected(ts, &tm, &ti)) |
| 693 | { |
| 694 | // Get the row number |
| 695 | tp = gtk_tree_model_get_path (tm, &ti); |
| 696 | indices = gtk_tree_path_get_indices (tp); |
| 697 | row = indices[0]; |
| 698 | gtk_tree_path_free(tp); |
| 699 | // find audio settings |
| 700 | if (row < 0) return NULL; |
| 701 | |
| 702 | audio_list = ghb_get_job_audio_list(ud->settings); |
| 703 | if (row >= ghb_array_len(audio_list)) |
| 704 | return NULL; |
| 705 | |
| 706 | asettings = ghb_array_get(audio_list, row); |
| 707 | if (index != NULL) |
| 708 | *index = row; |
| 709 | } |
| 710 | return asettings; |
| 711 | } |
| 712 | |
| 713 | static void |
| 714 | audio_refresh_list_row_ui( |
no test coverage detected