This would enable a frontpanel switch to select the audio output by
sending a command to rigctl.
#include "receiver.h"
#include "rigctl.h"
#include "rigctl_menu.h"
+#include "rx_menu.h"
#include "sliders.h"
#include "store.h"
#include "toolbar.h"
case 'I': // ZZAI
implemented = FALSE;
break;
+ case 'O': // ZZAO
+ if (command[4] == ';') {
+ toggle_audio_output_device();
+ }
+ break;
case 'P': // ZZAP
implemented = FALSE;
break;
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
*/
extern void rx_menu(GtkWidget *parent);
+extern void toggle_audio_output_device(void);