]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Fixed waterfall touch frequency when sample rate changed. Fixed popup slider when...
authorJohn Melton - G0ORX/N6LYT <john.d.melton@googlemail.com>
Mon, 29 Aug 2016 06:32:56 +0000 (06:32 +0000)
committerJohn Melton - G0ORX/N6LYT <john.d.melton@googlemail.com>
Mon, 29 Aug 2016 06:32:56 +0000 (06:32 +0000)
gpio.c
pihpsdr
release/pihpsdr.tar
release/pihpsdr/pihpsdr
sliders.c
waterfall.c

diff --git a/gpio.c b/gpio.c
index 46ed2783542cac4e945871931ec3a007d6ab3b1b..da56eae6ffa527c6411cce83f76f1bba6b01da47 100644 (file)
--- 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 d0ee810c8d340827cebaef2d9eb887bbf944361e..0f1e5a41dbdd2f58aeb81277b97e9943a3635386 100755 (executable)
Binary files a/pihpsdr and b/pihpsdr differ
index 56bbe892d45e07194f3de0fb0fb38a627711d430..e1964f948c09774ac0181822db70c7253a3d57f3 100644 (file)
Binary files a/release/pihpsdr.tar and b/release/pihpsdr.tar differ
index d0ee810c8d340827cebaef2d9eb887bbf944361e..0f1e5a41dbdd2f58aeb81277b97e9943a3635386 100755 (executable)
Binary files a/release/pihpsdr/pihpsdr and b/release/pihpsdr/pihpsdr differ
index a256444857bb7842d6e1dbddf19018d624f7be4e..3f7991e976a6f8ec80c31c47ce25d7a060b29987 100644 (file)
--- 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 {
index 7d39210ea1d2d465cc1279f8d28510b590401ca9..8523cf1f28812f170a7ebf7b0ede29483e3ee934 100644 (file)
@@ -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;