From: John Melton - G0ORX/N6LYT Date: Mon, 29 Aug 2016 06:32:56 +0000 (+0000) Subject: Fixed waterfall touch frequency when sample rate changed. Fixed popup slider when... X-Git-Url: https://git.rkrishnan.org/components/-?a=commitdiff_plain;h=4a9e7940b95bfcb2b396477817dff18a58fd16d7;p=pihpsdr.git Fixed waterfall touch frequency when sample rate changed. Fixed popup slider when adjusting attenuation using encoder. --- diff --git a/gpio.c b/gpio.c index 46ed278..da56eae 100644 --- a/gpio.c +++ b/gpio.c @@ -726,17 +726,9 @@ static int vfo_encoder_changed(void *data) { if(!locked) { int pos=*(int*)data; - if(function) { -#ifdef PSK - if(mode==modePSK) { - psk_set_frequency(psk_get_frequency()-(pos*10)); - } -#endif - } else { - // VFO - BANDSTACK_ENTRY* entry=bandstack_entry_get_current(); - setFrequency(entry->frequencyA+ddsOffset+(pos*step)); - } + // VFO + BANDSTACK_ENTRY* entry=bandstack_entry_get_current(); + setFrequency(entry->frequencyA+ddsOffset+(pos*step)); vfo_update(NULL); } free(data); diff --git a/pihpsdr b/pihpsdr index d0ee810..0f1e5a4 100755 Binary files a/pihpsdr and b/pihpsdr differ diff --git a/release/pihpsdr.tar b/release/pihpsdr.tar index 56bbe89..e1964f9 100644 Binary files a/release/pihpsdr.tar and b/release/pihpsdr.tar differ diff --git a/release/pihpsdr/pihpsdr b/release/pihpsdr/pihpsdr index d0ee810..0f1e5a4 100755 Binary files a/release/pihpsdr/pihpsdr and b/release/pihpsdr/pihpsdr differ diff --git a/sliders.c b/sliders.c index a256444..3f7991e 100644 --- a/sliders.c +++ b/sliders.c @@ -49,7 +49,7 @@ static GtkWidget *sliders; #define AGC_GAIN 3 #define DRIVE 4 #define TUNE_DRIVE 5 -#define ATTENUATION 5 +#define ATTENUATION 6 //#define MIC_GAIN_FUDGE 25.0 @@ -74,7 +74,6 @@ static GdkRGBA white; static GdkRGBA gray; int scale_timeout_cb(gpointer data) { -fprintf(stderr,"scale_timeout_cb\n"); gtk_widget_destroy(scale_dialog); scale_status=NONE; return FALSE; @@ -194,12 +193,10 @@ void set_af_gain(double value) { static void micgain_value_changed_cb(GtkWidget *widget, gpointer data) { mic_gain=gtk_range_get_value(GTK_RANGE(widget))/100.0; -fprintf(stderr,"micgain_value_changed: %f\n",mic_gain); } void set_mic_gain(double value) { mic_gain=value; -fprintf(stderr,"set_mic_gain: %f\n",mic_gain); if(display_sliders) { gtk_range_set_value (GTK_RANGE(mic_gain_scale),mic_gain*100.0); } else { diff --git a/waterfall.c b/waterfall.c index 7d39210..8523cf1 100644 --- a/waterfall.c +++ b/waterfall.c @@ -58,6 +58,7 @@ static gint mode[BANDS]; static gint band=4; static int display_width; +static int display_height; /* Create a new surface of the appropriate size to store our scribbles */ static gboolean @@ -65,13 +66,13 @@ waterfall_configure_event_cb (GtkWidget *widget, GdkEventConfigure *event, gpointer data) { - int width=gtk_widget_get_allocated_width (widget); - int height=gtk_widget_get_allocated_height (widget); - pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, width, height); + display_width=gtk_widget_get_allocated_width (widget); + display_height=gtk_widget_get_allocated_height (widget); + pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, display_width, display_height); char *pixels = gdk_pixbuf_get_pixels (pixbuf); - memset(pixels, 0, width*height*3); + memset(pixels, 0, display_width*display_height*3); return TRUE; } @@ -124,8 +125,7 @@ waterfall_button_release_event_cb (GtkWidget *widget, return TRUE; } -static gboolean -waterfall_motion_notify_event_cb (GtkWidget *widget, +static gboolean waterfall_motion_notify_event_cb (GtkWidget *widget, GdkEventMotion *event, gpointer data) { @@ -162,6 +162,8 @@ void waterfall_update(float *data) { int i; + hz_per_pixel=(double)getSampleRate()/(double)display_width; + if(pixbuf) { char *pixels = gdk_pixbuf_get_pixels (pixbuf); @@ -243,6 +245,7 @@ void waterfall_update(float *data) { GtkWidget* waterfall_init(int width,int height) { display_width=width; + display_height=height; hz_per_pixel=(double)getSampleRate()/(double)display_width;