static void frames_per_second_value_changed_cb(GtkWidget *widget, gpointer data) {
updates_per_second=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
+ active_receiver->fps=updates_per_second;
calculate_display_average(active_receiver);
+ set_displaying(active_receiver, 1);
}
static void panadapter_high_value_changed_cb(GtkWidget *widget, gpointer data) {
double t=0.001*display_average_time;
display_avb = exp(-1.0 / ((double)rx->fps * t));
- display_average = max(2, (int)min(60, (double)rx->fps * t));
+ display_average = max(2, (int)fmin(60, (double)rx->fps * t));
SetDisplayAvBackmult(rx->id, 0, display_avb);
SetDisplayNumAverage(rx->id, 0, display_average);
}
void set_displaying(RECEIVER *rx,int state) {
rx->displaying=state;
if(state) {
- rx->update_timer_id=gdk_threads_add_timeout_full(G_PRIORITY_HIGH_IDLE,1000/rx->fps, update_display, rx, NULL);
+ if(rx->update_timer_id>=0) g_source_remove(rx->update_timer_id);
+ rx->update_timer_id=g_timeout_add_full(G_PRIORITY_HIGH_IDLE,1000/rx->fps, update_display, rx, NULL);
} else {
rx->update_timer_id=-1;
}
int max_w = fft_size + (int) min(keep_time * (double) rx->fps, keep_time * (double) fft_size * (double) rx->fps);
- overlap = (int)max(0.0, ceil(fft_size - (double)rx->sample_rate / (double)rx->fps));
+ overlap = (int)fmax(0.0, ceil(fft_size - (double)rx->sample_rate / (double)rx->fps));
//g_print("SetAnalyzer id=%d buffer_size=%d overlap=%d\n",rx->id,rx->buffer_size,overlap);