| 1395 | } |
| 1396 | |
| 1397 | G_MODULE_EXPORT void |
| 1398 | audio_add_cb (GSimpleAction *action, GVariant *param, gpointer data) |
| 1399 | { |
| 1400 | // Add the current audio settings to the list. |
| 1401 | GhbValue *asettings, *backup; |
| 1402 | int title_id, titleindex; |
| 1403 | const hb_title_t *title; |
| 1404 | signal_user_data_t *ud = ghb_ud(); |
| 1405 | |
| 1406 | title_id = ghb_dict_get_int(ud->settings, "title"); |
| 1407 | title = ghb_lookup_title(title_id, &titleindex); |
| 1408 | |
| 1409 | // Back up settings in case we need to revert. |
| 1410 | backup = ghb_value_dup(ghb_get_job_audio_list(ud->settings)); |
| 1411 | GhbValue *pref_audio = ghb_dict_get_value(ud->settings, "AudioList"); |
| 1412 | asettings = audio_select_and_add_track(title, ud->settings, pref_audio, |
| 1413 | "und", 0, 0); |
| 1414 | audio_add_to_ui(ud, asettings); |
| 1415 | |
| 1416 | if (asettings != NULL) |
| 1417 | { |
| 1418 | // Pop up the edit dialog |
| 1419 | GtkWidget *dialog = ghb_builder_widget("audio_dialog"); |
| 1420 | gtk_window_set_title(GTK_WINDOW(dialog), _("Add Audio Track")); |
| 1421 | g_signal_connect(dialog, "response", G_CALLBACK(audio_add_response), backup); |
| 1422 | gtk_widget_set_visible(dialog, TRUE); |
| 1423 | } |
| 1424 | } |
| 1425 | |
| 1426 | static void |
| 1427 | audio_add_response (GtkWidget *dialog, int response, GhbValue *backup) |
nothing calls this directly
no test coverage detected