// to an RX gain of -12 to +48 dB. However, we set here that
// a value of +16 (that is, 28 on the 0-60 scale) corresponds to
// "zero attenuation"
- chk_data(40 -(frame[4] & 0x3F) , rx_att[0], "RX1 HL ATT/GAIN");
+ chk_data(37 -(frame[4] & 0x3F) , rx_att[0], "RX1 HL ATT/GAIN");
} else {
chk_data((frame[4] & 0x1F) >> 0, rx_att[0], "RX1 ATT");
chk_data((frame[4] & 0x20) >> 5, rx1_attE, "RX1 ATT enable");
case SMETER:
{
if(have_rx_gain) {
- level=value+40.0-(adc_attenuation[rx->adc]+12.0);
+ level=value+rx_gain_calibration-adc_attenuation[rx->adc];
} else {
level=value+(double)adc_attenuation[rx->adc];
}
text_location=10;
offset=5.0;
if(have_rx_gain) {
- level=value+40.0-(adc_attenuation[rx->adc]+12.0);
+ level=value+rx_gain_calibration-adc_attenuation[rx->adc];
} else {
level=value+(double)adc_attenuation[rx->adc];
}
}
break;
case MIDI_WHEEL:
- new=adc_attenuation[active_receiver->adc] + val;
- if (new > 31) new=31;
- if (new < 0 ) new=0;
- dp=malloc(sizeof(double));
- *dp=new;
- g_idle_add(ext_set_attenuation_value,(gpointer) dp);
- break;
+ new=adc_attenuation[active_receiver->adc] + val;
+ dp=malloc(sizeof(double));
+ *dp=(double) new;
+ if(have_rx_gain) {
+ if(*dp<-12.0) {
+ *dp=-12.0;
+ } else if(*dp>48.0) {
+ *dp=48.0;
+ }
+ } else {
+ if(*dp<0.0) {
+ *dp=0.0;
+ } else if (*dp>31.0) {
+ *dp=31.0;
+ }
+ }
+ g_idle_add(ext_set_attenuation_value,(gpointer) dp);
+ break;
case MIDI_KNOB:
- new=(31*val)/100;
dp=malloc(sizeof(double));
- *dp=new;
+ if (have_rx_gain) {
+ *dp=-12.0 + 0.6*(double) val;
+ } else {
+ *dp = 0.31 * (double) val;
+ }
g_idle_add(ext_set_attenuation_value,(gpointer) dp);
break;
default:
samples[0]=-200.0;
samples[display_width-1]=-200.0;
if(have_rx_gain) {
- s1=(double)samples[0]+40.0-(adc_attenuation[rx->adc]+12.0);
+ s1=(double)samples[0]+rx_gain_calibration-adc_attenuation[rx->adc];
} else {
s1=(double)samples[0]+(double)adc_attenuation[rx->adc];
}
cairo_move_to(cr, 0.0, s1);
for(i=1;i<display_width;i++) {
if(have_rx_gain) {
- s2=(double)samples[i]+40.0-(adc_attenuation[rx->adc]+12.0);
+ s2=(double)samples[i]+rx_gain_calibration-adc_attenuation[rx->adc];
} else {
s2=(double)samples[i]+(double)adc_attenuation[rx->adc];
}