]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
try to invoke it without being able to bring up the menu
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Sat, 4 Nov 2023 16:59:14 +0000 (22:29 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Sat, 4 Nov 2023 17:00:10 +0000 (22:30 +0530)
rx_menu.c

index 2708bb26bb0b40ec5e4fddba206def37c4da89d2..a41ed8cb68ac91a7911dd6ce87dd1a2111bd1ba3 100644 (file)
--- a/rx_menu.c
+++ b/rx_menu.c
@@ -140,18 +140,6 @@ static void mute_radio_cb(GtkWidget *widget, gpointer data) {
         gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
 }
 
-void toggle_audio_output_device(void) {
-    // n_output_devices holds the number of output devices (global -
-    // aargh!!)
-    int out_index = gtk_combo_box_get_active(GTK_COMBO_BOX(output));
-
-    // toggle
-    out_index = (out_index + 1) % n_output_devices;
-
-    // set the other device as active
-    gtk_combo_box_set_active(GTK_COMBO_BOX(output), out_index);
-}
-
 //
 // possible the device has been changed:
 // call audo_close_output with old device, audio_open_output with new one
@@ -189,6 +177,20 @@ static void local_output_changed_cb(GtkWidget *widget, gpointer data) {
             active_receiver->id, active_receiver->local_audio);
 }
 
+void toggle_audio_output_device(void) {
+    // n_output_devices holds the number of output devices (global -
+    // aargh!!)
+    int out_index = gtk_combo_box_get_active(GTK_COMBO_BOX(output));
+
+    // toggle
+    out_index = (out_index + 1) % n_output_devices;
+
+    // set the other device as active
+    gtk_combo_box_set_active(GTK_COMBO_BOX(output), out_index);
+
+    local_output_changed_cb(GTK_COMBO_BOX(output), NULL);
+}
+
 static void audio_channel_cb(GtkWidget *widget, gpointer data) {
     if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
         active_receiver->audio_channel = GPOINTER_TO_INT(data);