From d27f2349a858c013810a97408802d3b130a212b4 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 26 Sep 2022 22:43:49 +0200 Subject: Save audio name instead of id because id is likely to change after a reboot --- src/main.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 6ef4479..174f99b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -269,11 +269,11 @@ static void for_each_item_in_combo_box(GtkComboBox *combo_box, std::functionid); + config.main_config.audio_input.push_back(gtk_label_get_text(GTK_LABEL(audio_row->label))); }); config.main_config.quality = gtk_combo_box_get_active_id(GTK_COMBO_BOX(quality_input_menu)); @@ -1551,14 +1551,14 @@ static gboolean handle_child_process_death(gpointer userdata) { return G_SOURCE_CONTINUE; } -// Only adds the item if |id| matches an item in the audio input menu -static void add_audio_input_track(const char *id) { - std::string audio_input_name; - const gint audio_input_row = combo_box_text_get_row_by_id(GTK_COMBO_BOX(audio_input_menu_todo), id, audio_input_name); +// Only adds the item if |name| matches an item in the audio input menu +static void add_audio_input_track(const char *name) { + std::string audio_input_id; + const gint audio_input_row = combo_box_text_get_row_by_label(GTK_COMBO_BOX(audio_input_menu_todo), name, audio_input_id); if(audio_input_row == -1) return; - GtkWidget *row = create_used_audio_input_row(id, audio_input_name.c_str()); + GtkWidget *row = create_used_audio_input_row(audio_input_id.c_str(), name); gtk_widget_show_all(row); gtk_list_box_insert (GTK_LIST_BOX(audio_input_used_list), row, -1); gtk_combo_box_text_remove(audio_input_menu_todo, audio_input_row); -- cgit v1.2.3