return 0;
}
+int ext_mute_update(void *data) {
+g_print("ext_mute_update: currently %d\n",active_receiver->mute_radio);
+ active_receiver->mute_radio=!active_receiver->mute_radio;
+ return 0;
+}
+
int ext_set_rx_frequency(void *data);
int ext_set_rx_mode(void *data);
int ext_set_rx_filter(void *data);
+int ext_mute_update(void *data);
"DIV MENU",
"PS MENU",
"FUNCTION",
+ "MUTE"
};
int *sw_action=NULL;
static int e_function_pressed(void *data) {
int action=(int)data;
-//g_print("e_function_pressed: %d\n",action);
+g_print("e_function_pressed: %d\n",action);
switch(action) {
case TUNE:
if(can_transmit) g_idle_add(ext_tune_update,NULL);
case FUNCTION:
g_idle_add(ext_function_update,NULL);
break;
+ case MUTE:
+ g_idle_add(ext_mute_update,NULL);
+ break;
}
return 0;
}
MENU_DIVERSITY,
MENU_PS,
FUNCTION,
+ MUTE,
SWITCH_ACTIONS
};
case MENU_DIVERSITY:
g_idle_add(ext_diversity_update,GINT_TO_POINTER(1));
break;
+ case MENU_PS:
+#ifdef PURESIGNAL
+ g_idle_add(ext_start_ps,NULL);
+#endif
+ break;
+ case FUNCTION:
+ g_idle_add(ext_function_update,NULL);
+ break;
+ case MUTE:
+ g_idle_add(ext_mute_update,NULL);
+ break;
}
}
}
VOXLEVEL, // VOXLEVEL: adjust VOX threshold
MIDI_XIT_CLEAR, // XITCLEAR: clear XIT value
XIT_VAL, // XITVAL: change XIT value
+ MIDI_MUTE, // MUTE: toggle mute on/off
};
//
{ VOXLEVEL, "VOXLEVEL"},
{ MIDI_XIT_CLEAR, "XITCLEAR"},
{ XIT_VAL, "XITVAL"},
+ { MIDI_MUTE, "MUTE"},
{ ACTION_NONE, "NONE"}
};
g_idle_add(ext_vfo_update, NULL);
}
break;
+ /////////////////////////////////////////////////////////// "MUTE"
+ case MIDI_MUTE:
+ g_idle_add(ext_mute_update,NULL);
+ break;
+
case ACTION_NONE:
// No error message, this is the "official" action for un-used controller buttons.
break;
int can_transmit=0;
gboolean duplex=FALSE;
+gboolean mute_rx_while_transmitting=FALSE;
gint rx_height;
void radio_stop() {
void setMox(int state) {
if(!can_transmit) return;
+#ifdef SOAPYSDR
+ if(!transmitter->local_microphone) return;
+#endif
vox_cancel(); // remove time-out
if(mox!=state) {
if (state && vox) {
int i;
if(!can_transmit) return;
+ if(!transmitter->local_microphone) return;
// if state==tune, this function is a no-op
if(value) duplex=atoi(value);
value=getProperty("sat_mode");
if(value) sat_mode=atoi(value);
+ value=getProperty("mute_rx_while_transmitting");
+ if(value) mute_rx_while_transmitting=atoi(value);
#ifdef SOAPYSDR
if(device==SOAPYSDR_USB_DEVICE) {
setProperty("split",value);
sprintf(value,"%d",sat_mode);
setProperty("sat_mode",value);
+ sprintf(value,"%d",mute_rx_while_transmitting);
+ setProperty("mute_rx_while_transmitting",value);
filterSaveState();
bandSaveState();
extern int rit_increment;
extern gboolean duplex;
+extern gboolean mute_rx_while_transmitting;
extern gint rx_height;
extern int lt2208Dither;
static GtkWidget *receivers_1;
static GtkWidget *receivers_2;
static GtkWidget *duplex_b;
+static GtkWidget *mute_rx_b;
static void cleanup() {
if(dialog!=NULL) {
setDuplex();
}
+static void mute_rx_cb(GtkWidget *widget, gpointer data) {
+ mute_rx_while_transmitting=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+}
+
static void sat_cb(GtkWidget *widget, gpointer data) {
sat_mode=gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
g_idle_add(ext_vfo_update, NULL);
gtk_grid_attach(GTK_GRID(grid),sat_combo,col,row,1,1);
g_signal_connect(sat_combo,"changed",G_CALLBACK(sat_cb),NULL);
+ col++;
+
+ mute_rx_b=gtk_check_button_new_with_label("Mute RX when TX");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mute_rx_b), mute_rx_while_transmitting);
+ gtk_grid_attach(GTK_GRID(grid),mute_rx_b,col,row,1,1);
+ g_signal_connect(mute_rx_b,"toggled",G_CALLBACK(mute_rx_cb),NULL);
+
row++;
if(have_rx_gain) {
short left_audio_sample,right_audio_sample;
int i;
for(i=0;i<rx->output_samples;i++) {
- if(isTransmitting() && !duplex) {
+ if(isTransmitting() && (!duplex || mute_rx_while_transmitting)) {
left_sample=0.0;
right_sample=0.0;
left_audio_sample=0;
}
if(rx->local_audio) {
- if(rx!=active_receiver && rx->mute_when_not_active) {
+ if((rx!=active_receiver && rx->mute_when_not_active) || rx->mute_radio) {
audio_write(rx,0.0F,0.0F);
} else {
switch(rx->audio_channel) {