From 6fa34433fe111a55fa1543d5a4b2bf73f4b41b8b Mon Sep 17 00:00:00 2001 From: c vw Date: Tue, 21 Sep 2021 16:11:47 +0200 Subject: [PATCH] small tidy-ups --- actions.c | 15 ++------------- vfo_menu.c | 6 ++---- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/actions.c b/actions.c index cc0e52d..708ef87 100644 --- a/actions.c +++ b/actions.c @@ -300,11 +300,7 @@ int process_action(void *data) { } break; case ATTENUATION: - if(have_rx_gain) { - value=KnobOrWheel(a, adc[active_receiver->adc].attenuation, -12.0, 48.0, 1.0); - } else { - value=KnobOrWheel(a, adc[active_receiver->adc].attenuation, 0.0, 31.0, 1.0); - } + value=KnobOrWheel(a, adc[active_receiver->adc].attenuation, 0.0, 31.0, 1.0); set_attenuation_value(value); break; case B_TO_A: @@ -1081,14 +1077,7 @@ int process_action(void *data) { g_idle_add(ext_vfo_update, NULL); break; case VOXLEVEL: - value=KnobOrWheel(a, vox_threshold, 0.0, 1.0, 0.01); - if(a->mode==ABSOLUTE) { - vox_threshold = 0.01 * a->val; - } else if(a->mode==RELATIVE) { - vox_threshold += a->val * 0.01; - if (vox_threshold > 1.0) vox_threshold=1.0; - if (vox_threshold < 0.0) vox_threshold=0.0; - } + vox_threshold=KnobOrWheel(a, vox_threshold, 0.0, 1.0, 0.01); break; case WATERFALL_HIGH: value=KnobOrWheel(a, active_receiver->waterfall_high, -100.0, 0.0, 1.0); diff --git a/vfo_menu.c b/vfo_menu.c index e47db55..284d574 100644 --- a/vfo_menu.c +++ b/vfo_menu.c @@ -188,10 +188,8 @@ static void rit_cb(GtkComboBox *widget,gpointer data) { static void vfo_cb(GtkComboBox *widget,gpointer data) { int i=gtk_combo_box_get_active(widget); - if (i >= 0 && i < STEPS) { - vfo_set_stepsize(steps[i]); - g_idle_add(ext_vfo_update,NULL); - } + vfo_set_step_from_index(i); + g_idle_add(ext_vfo_update,NULL); } #ifdef PURESIGNAL -- 2.45.2