#include "equalizer_menu.h"
#include "radio.h"
#include "channel.h"
+#include "ext.h"
+#include "vfo.h"
static GtkWidget *parent_window=NULL;
return FALSE;
}
+void set_eq() {
+ SetTXAGrphEQ(transmitter->id, tx_equalizer);
+ SetTXAEQRun(transmitter->id, enable_tx_equalizer);
+ SetRXAGrphEQ(active_receiver->id, rx_equalizer);
+ SetRXAEQRun(active_receiver->id, enable_rx_equalizer);
+}
+
+void update_eq() {
+#ifdef CLIENT_SERVER
+ if(radio_is_remote) {
+ send_eq(client_socket,enable_rx_eq, enable_tx_equalizer);
+ } else {
+#endif
+ set_eq();
+#ifdef CLIENT_SERVER
+ }
+#endif
+}
+
static gboolean enable_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+ int m;
if(tx_menu) {
enable_tx_equalizer=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
- SetTXAEQRun(transmitter->id, enable_tx_equalizer);
+ m=vfo[get_tx_vfo()].mode;
+ mode_settings[m].en_txeq = enable_tx_equalizer;
} else {
enable_rx_equalizer=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
- SetRXAEQRun(active_receiver->id, enable_rx_equalizer);
+ m=vfo[active_receiver->id].mode;
+ mode_settings[m].en_rxeq = enable_rx_equalizer;
}
+ update_eq();
+ // EQ status is now shown in VFO bar
+ g_idle_add(ext_vfo_update, NULL);
return FALSE;
}
static void value_changed_cb (GtkWidget *widget, gpointer data) {
int i=GPOINTER_TO_UINT(data);
+ int m;
if(tx_menu) {
tx_equalizer[i]=(int)gtk_range_get_value(GTK_RANGE(widget));
- SetTXAGrphEQ(transmitter->id, tx_equalizer);
+ m=vfo[get_tx_vfo()].mode;
+ mode_settings[m].txeq[i]=tx_equalizer[i];
} else {
rx_equalizer[i]=(int)gtk_range_get_value(GTK_RANGE(widget));
- SetRXAGrphEQ(active_receiver->id, rx_equalizer);
+ m=vfo[active_receiver->id].mode;
+ mode_settings[m].rxeq[i]=rx_equalizer[i];
}
+ update_eq();
}
void equalizer_menu(GtkWidget *parent) {
sprintf(name,"modeset.%d.snb", i);
sprintf(value,"%d", mode_settings[i].snb);
setProperty(name,value);
+ sprintf(name,"modeset.%d.en_txeq", i);
+ sprintf(value,"%d", mode_settings[i].en_txeq);
+ setProperty(name,value);
+ sprintf(name,"modeset.%d.txeq.0", i);
+ sprintf(value,"%d", mode_settings[i].txeq[0]);
+ setProperty(name,value);
+ sprintf(name,"modeset.%d.txeq.1", i);
+ sprintf(value,"%d", mode_settings[i].txeq[1]);
+ setProperty(name,value);
+ sprintf(name,"modeset.%d.txeq.2", i);
+ sprintf(value,"%d", mode_settings[i].txeq[2]);
+ setProperty(name,value);
+ sprintf(name,"modeset.%d.txeq.3", i);
+ sprintf(value,"%d", mode_settings[i].txeq[3]);
+ setProperty(name,value);
+ sprintf(name,"modeset.%d.en_rxeq", i);
+ sprintf(value,"%d", mode_settings[i].en_rxeq);
+ setProperty(name,value);
+ sprintf(name,"modeset.%d.rxeq.0", i);
+ sprintf(value,"%d", mode_settings[i].rxeq[0]);
+ setProperty(name,value);
+ sprintf(name,"modeset.%d.rxeq.1", i);
+ sprintf(value,"%d", mode_settings[i].rxeq[1]);
+ setProperty(name,value);
+ sprintf(name,"modeset.%d.rxeq.2", i);
+ sprintf(value,"%d", mode_settings[i].rxeq[2]);
+ setProperty(name,value);
+ sprintf(name,"modeset.%d.rxeq.3", i);
+ sprintf(value,"%d", mode_settings[i].rxeq[3]);
+ setProperty(name,value);
}
}
mode_settings[i].nb2=0;
mode_settings[i].anf=0;
mode_settings[i].snb=0;
+ mode_settings[i].en_txeq=0;
+ mode_settings[i].txeq[0]=0;
+ mode_settings[i].txeq[1]=0;
+ mode_settings[i].txeq[2]=0;
+ mode_settings[i].txeq[3]=0;
+ mode_settings[i].en_rxeq=0;
+ mode_settings[i].rxeq[0]=0;
+ mode_settings[i].rxeq[1]=0;
+ mode_settings[i].rxeq[2]=0;
+ mode_settings[i].rxeq[3]=0;
sprintf(name,"modeset.%d.filter",i);
value=getProperty(name);
sprintf(name,"modeset.%d.snb",i);
value=getProperty(name);
if(value) mode_settings[i].snb=atoi(value);
+ sprintf(name,"modeset.%d.en_txeq",i);
+ value=getProperty(name);
+ if(value) mode_settings[i].en_txeq=atoi(value);
+ sprintf(name,"modeset.%d.txeq.0",i);
+ value=getProperty(name);
+ if(value) mode_settings[i].txeq[0]=atoi(value);
+ sprintf(name,"modeset.%d.txeq.1",i);
+ value=getProperty(name);
+ if(value) mode_settings[i].txeq[1]=atoi(value);
+ sprintf(name,"modeset.%d.txeq.2",i);
+ value=getProperty(name);
+ if(value) mode_settings[i].txeq[2]=atoi(value);
+ sprintf(name,"modeset.%d.txeq.3",i);
+ value=getProperty(name);
+ if(value) mode_settings[i].txeq[3]=atoi(value);
+ sprintf(name,"modeset.%d.en_rxeq",i);
+ value=getProperty(name);
+ if(value) mode_settings[i].en_rxeq=atoi(value);
+ sprintf(name,"modeset.%d.rxeq.0",i);
+ value=getProperty(name);
+ if(value) mode_settings[i].rxeq[0]=atoi(value);
+ sprintf(name,"modeset.%d.rxeq.1",i);
+ value=getProperty(name);
+ if(value) mode_settings[i].rxeq[1]=atoi(value);
+ sprintf(name,"modeset.%d.rxeq.2",i);
+ value=getProperty(name);
+ if(value) mode_settings[i].rxeq[2]=atoi(value);
+ sprintf(name,"modeset.%d.rxeq.3",i);
+ value=getProperty(name);
+ if(value) mode_settings[i].rxeq[3]=atoi(value);
}
}
active_receiver->nb2=mode_settings[m].nb2;
active_receiver->anf=mode_settings[m].anf;
active_receiver->snb=mode_settings[m].snb;
+ enable_rx_equalizer =mode_settings[m].en_rxeq;
+ rx_equalizer[0] =mode_settings[m].rxeq[0];
+ rx_equalizer[1] =mode_settings[m].rxeq[1];
+ rx_equalizer[2] =mode_settings[m].rxeq[2];
+ rx_equalizer[3] =mode_settings[m].rxeq[3];
+ enable_tx_equalizer =mode_settings[m].en_txeq;
+ tx_equalizer[0] =mode_settings[m].txeq[0];
+ tx_equalizer[1] =mode_settings[m].txeq[1];
+ tx_equalizer[2] =mode_settings[m].txeq[2];
+ tx_equalizer[3] =mode_settings[m].txeq[3];
// make changes effective
g_idle_add(ext_update_noise, NULL);
+ g_idle_add(ext_update_eq , NULL);
// turn off ctun
vfo[id].ctun=0;
active_receiver->nb2=mode_settings[m].nb2;
active_receiver->anf=mode_settings[m].anf;
active_receiver->snb=mode_settings[m].snb;
+ enable_rx_equalizer =mode_settings[m].en_rxeq;
+ rx_equalizer[0] =mode_settings[m].rxeq[0];
+ rx_equalizer[1] =mode_settings[m].rxeq[1];
+ rx_equalizer[2] =mode_settings[m].rxeq[2];
+ rx_equalizer[3] =mode_settings[m].rxeq[3];
+ enable_tx_equalizer =mode_settings[m].en_txeq;
+ tx_equalizer[0] =mode_settings[m].txeq[0];
+ tx_equalizer[1] =mode_settings[m].txeq[1];
+ tx_equalizer[2] =mode_settings[m].txeq[2];
+ tx_equalizer[3] =mode_settings[m].txeq[3];
// make changes effective
g_idle_add(ext_update_noise, NULL);
+ g_idle_add(ext_update_eq , NULL);
switch(id) {
case 0:
receiver_mode_changed(receiver[0]);
if(can_transmit) {
cairo_move_to(cr, 330, 50);
if (transmitter->compressor) {
- sprintf(temp_text,"CMPR %d dB",(int) transmitter->compressor_level);
+ sprintf(temp_text,"CMPR %d",(int) transmitter->compressor_level);
cairo_set_source_rgb(cr, 1.0, 1.0, 0.0);
cairo_show_text(cr, temp_text);
} else {
cairo_show_text(cr, "CMPR OFF");
}
}
+ //
+ // Indicate whether an equalizer is active
+ //
+ cairo_move_to(cr, 400, 50);
+ if ((isTransmitting() && enable_tx_equalizer) || (!isTransmitting() && enable_rx_equalizer)) {
+ cairo_set_source_rgb(cr, 1.0, 1.0, 0.0);
+ } else {
+ cairo_set_source_rgb(cr, 0.7, 0.7, 0.7);
+ }
+ cairo_show_text(cr, "EQ");
cairo_move_to(cr, 500, 50);
if(diversity_enabled) {