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

Function ghb_add_title_to_queue

gtk/src/title-add.c:209–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209gboolean
210ghb_add_title_to_queue (signal_user_data_t *ud, GhbValue *settings, gint batch)
211{
212 // Add settings to the queue
213 if (!validate_settings(ud, settings, batch))
214 {
215 return FALSE;
216 }
217
218 if (ud->queue == NULL)
219 ud->queue = ghb_array_new();
220
221 ghb_finalize_job(settings);
222
223 GhbValue *titleDict = ghb_get_title_settings(settings);
224 GhbValue *jobDict = ghb_get_job_settings(settings);
225 GhbValue *destDict = ghb_get_job_dest_settings(settings);
226 GhbValue *uiDict = ghb_value_dup(settings);
227
228 if (ghb_dict_get_string(destDict, "File") == NULL)
229 {
230 const char *dest = ghb_dict_get_string(uiDict, "destination");
231 ghb_dict_set_string(destDict, "File", dest);
232 }
233
234 ghb_dict_remove(uiDict, "Job");
235 ghb_dict_remove(uiDict, "Title");
236
237 GhbValue *queueDict = ghb_dict_new();
238 ghb_dict_set(queueDict, "uiSettings", uiDict);
239 ghb_dict_set(queueDict, "Job", ghb_value_dup(jobDict));
240 ghb_dict_set(queueDict, "Title", ghb_value_dup(titleDict));
241
242 // Copy current prefs into settings
243 // The job should run with the preferences that existed
244 // when the job was added to the queue.
245 ghb_dict_set(uiDict, "Preferences", ghb_value_dup(ud->prefs));
246
247 // Make a copy of current settings to be used for the new job
248 ghb_dict_set_int(uiDict, "job_status", GHB_QUEUE_PENDING);
249 ghb_dict_set_int(uiDict, "job_unique_id", 0);
250
251 ghb_array_append(ud->queue, queueDict);
252 ghb_add_to_queue_list(ud, queueDict);
253 ghb_save_queue(ud->queue);
254 ghb_update_pending(ud);
255 ghb_queue_buttons_grey(ud);
256
257 return TRUE;
258}
259
260static gboolean
261title_destination_is_unique (GhbValue *settings_array, gint index)

Callers 3

add_multiple_titlesFunction · 0.85
title_add_action_cbFunction · 0.85
queue_start_action_cbFunction · 0.85

Calls 12

validate_settingsFunction · 0.85
ghb_finalize_jobFunction · 0.85
ghb_get_title_settingsFunction · 0.85
ghb_get_job_settingsFunction · 0.85
ghb_dict_get_stringFunction · 0.85
ghb_dict_set_stringFunction · 0.85
ghb_dict_set_intFunction · 0.85
ghb_add_to_queue_listFunction · 0.85
ghb_save_queueFunction · 0.85
ghb_update_pendingFunction · 0.85
ghb_queue_buttons_greyFunction · 0.85

Tested by

no test coverage detected