| 112 | } |
| 113 | |
| 114 | static void |
| 115 | chapter_refresh_list_ui(signal_user_data_t *ud) |
| 116 | { |
| 117 | GhbValue * chapter_list; |
| 118 | GtkListBox * lb; |
| 119 | GtkWidget * row; |
| 120 | gint ii, count; |
| 121 | gint64 start = 0, duration; |
| 122 | |
| 123 | lb = GTK_LIST_BOX(ghb_builder_widget("chapters_list")); |
| 124 | |
| 125 | chapter_list = ghb_get_job_chapter_list(ud->settings); |
| 126 | count = ghb_array_len(chapter_list); |
| 127 | for (ii = 0; ii < count; ii++) |
| 128 | { |
| 129 | GhbValue * chapter_dict; |
| 130 | GhbValue * duration_dict; |
| 131 | const char * name; |
| 132 | |
| 133 | chapter_dict = ghb_array_get(chapter_list, ii); |
| 134 | name = ghb_dict_get_string(chapter_dict, "Name"); |
| 135 | duration_dict = ghb_dict_get(chapter_dict, "Duration"); |
| 136 | duration = ghb_dict_get_int(duration_dict, "Ticks") / 90000; |
| 137 | row = create_chapter_row(ii + 1, start, duration, name, ud); |
| 138 | start += duration; |
| 139 | |
| 140 | gtk_list_box_insert(lb, row, -1); |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | void |
| 145 | ghb_chapter_list_refresh_all(signal_user_data_t *ud) |
no test coverage detected