From: c vw <dl1ycf@darc.de>
Date: Thu, 16 Aug 2018 12:24:36 +0000 (+0200)
Subject: StreamLine: reduce diffs to original version
X-Git-Url: https://git.rkrishnan.org/pf/components/$rel_link?a=commitdiff_plain;h=582ad84b274ee9d254f87f0ff04b47485241dc77;p=pihpsdr.git

StreamLine: reduce diffs to original version
---

diff --git a/Makefile b/Makefile
index 396096f..82e9275 100644
--- a/Makefile
+++ b/Makefile
@@ -27,34 +27,28 @@ GIT_VERSION := $(shell git describe --abbrev=0 --tags)
 # uncomment the line to below include support local CW keyer
 #LOCALCW_INCLUDE=LOCALCW
 
-# uncomment the line below to include support for STEMlab discovery (with avahi)
+# uncomment the line below to include support for STEMlab discovery (WITH AVAHI)
 #STEMLAB_DISCOVERY=STEMLAB_DISCOVERY
 
-# uncomment the line below to include support for STEMlab discovery WITHOUT AVAHI
+# uncomment the line below to include support for STEMlab discovery (WITHOUT AVAHI)
 #STEMLAB_DISCOVERY=STEMLAB_DISCOVERY_NOAVAHI
 
 # uncommment this line for activate work-around some RedPitaty HPSDR bugs
 #STEMLAB_FIX_OPTION=-DSTEMLAB_FIX
 
-#uncomment the line below for the platform being compiled on
+#uncomment the line below for the platform being compiled on (actually not used)
 UNAME_N=raspberrypi
 #UNAME_N=odroid
 #UNAME_N=up
 #UNAME_N=pine64
 #UNAME_N=jetsen
 
-# Additional options that can be chosen at compile time:
-# -DPROTOCOL_DEBUG      logs (on stderr) all state changes sent to the SDR (only old protocol)
-# -DDEBUG               activate general debug output
-#
-# leave the list empty if no such option should be used
-
-DEBUGL_OPTION=
-
-
 CC=gcc
 LINK=gcc
 
+# uncomment the line below for various debug facilities
+#DEBUG_OPTION=-D DEBUG
+
 ifeq ($(PURESIGNAL_INCLUDE),PURESIGNAL)
 PURESIGNAL_OPTIONS=-D PURESIGNAL
 PURESIGNAL_SOURCES= \
@@ -176,8 +170,10 @@ ifeq ($(I2C_INCLUDE),I2C)
 endif
 
 #
-# We have two versions here, the second one has to be used
-# if you do not have the avahi libraries
+# We have two versions of STEMLAB_DISCOVERY here,
+# the second one has to be used
+# if you do not have the avahi (devel-) libraries
+# on your system.
 #
 ifeq ($(STEMLAB_DISCOVERY), STEMLAB_DISCOVERY)
 STEMLAB_OPTIONS=-D STEMLAB_DISCOVERY \
diff --git a/Makefile.mac b/Makefile.mac
index a09b6f1..e4b482e 100644
--- a/Makefile.mac
+++ b/Makefile.mac
@@ -27,29 +27,21 @@ PURESIGNAL_INCLUDE=PURESIGNAL
 # uncomment the line to below include support local CW keyer
 #LOCALCW_INCLUDE=LOCALCW
 
-# uncomment the line below to include support for STEMlab discovery (with avahi)
-#STEMLAB_DISCOVERY=STEMLAB_DISCOVERY
-
-# uncomment the line below to include support for STEMlab discovery WITHOUT AVAHI
+# uncomment the line below to include support for STEMlab discovery (WITHOUT AVAHI)
 STEMLAB_DISCOVERY=STEMLAB_DISCOVERY_NOAVAHI
 
 # un-commment this line for activate work-around some RedPitaty HPSDR bugs
 STEMLAB_FIX_OPTION=-DSTEMLAB_FIX
 
-#uncomment the line below for the platform being compiled on
+#uncomment the line below for the platform being compiled on (actually not used)
 UNAME_N=raspberrypi
 #UNAME_N=odroid
 #UNAME_N=up
 #UNAME_N=pine64
 #UNAME_N=jetsen
 
-# Additional options that can be chosen at compile time:
-# -DPROTOCOL_DEBUG	logs (on stderr) all state changes sent to the SDR (only old protocol)
-# -DDEBUG		activate debug output
-#
-# leave the list empty if no such option should be used
-
-DEBUG_OPTION=
+# uncomment the line below for various debug facilities
+#DEBUG_OPTION=-D DEBUG
 
 CC=gcc
 LINK=gcc
@@ -175,20 +167,6 @@ ifeq ($(I2C_INCLUDE),I2C)
   I2C_OBJS=i2c.o
 endif
 
-#
-# We have two versions here, the second one has to be used
-# if you do not have the avahi libraries
-#
-ifeq ($(STEMLAB_DISCOVERY), STEMLAB_DISCOVERY)
-STEMLAB_OPTIONS=-D STEMLAB_DISCOVERY \
-  `pkg-config --cflags avahi-gobject` \
-  `pkg-config --cflags libcurl`
-STEMLAB_LIBS=`pkg-config --libs avahi-gobject` `pkg-config --libs libcurl`
-STEMLAB_SOURCES=stemlab_discovery.c
-STEMLAB_HEADERS=stemlab_discovery.h
-STEMLAB_OBJS=stemlab_discovery.o
-endif
-
 ifeq ($(STEMLAB_DISCOVERY), STEMLAB_DISCOVERY_NOAVAHI)
 STEMLAB_OPTIONS=-D STEMLAB_DISCOVERY -D NO_AVAHI `pkg-config --cflags libcurl`
 STEMLAB_LIBS=`pkg-config --libs libcurl`
@@ -493,12 +471,19 @@ app:	$(OBJS) $(REMOTE_OBJS) $(USBOZY_OBJS) $(LIMESDR_OBJS) $(FREEDV_OBJS) \
 	@cp MacOS/hpsdr.icns pihpsdr.app/Contents/Resources/hpsdr.icns
 	@cp MacOS/pihpsdr.sh pihpsdr.app/Contents/MacOS/pihpsdr
 	@cp MacOS/hpsdr.png pihpsdr.app/Contents/Resources
-	@for lib in `otool -L pihpsdr.app/Contents/MacOS/pihpsdr-bin | grep dylib | sed -e "s/ (.*//" | grep -Ev "/(usr/lib|System)" | grep -Ev /libg `; do \
+	@for lib in `otool -L pihpsdr.app/Contents/MacOS/pihpsdr-bin | grep dylib | sed -e "s/ (.*//" | grep -Ev "/(usr/lib|System)" | grep -Ev /libg  | grep -Ev pango | grep -Ev cairo`; do \
 	  libfn="`basename $$lib`"; \
 	  cp "$$lib" "pihpsdr.app/Contents/Frameworks/$$libfn"; \
 	  chmod u+w "pihpsdr.app/Contents/Frameworks/$$libfn"; \
 	  install_name_tool -id "@executable_path/../Frameworks/$libfn" "pihpsdr.app/Contents/Frameworks/$$libfn"; \
 	  install_name_tool -change "$$lib" "@executable_path/../Frameworks/$$libfn" pihpsdr.app/Contents/MacOS/pihpsdr-bin; \
 	done
+#
+# Make "app" and copy wdspWisdom and props file to app bundle
+#
+localapp:	app
+	cp wdspWisdom pihpsdr.app/Contents/Resources
+	cp *.props    pihpsdr.app/Contents/Resources
+
 #############################################################################
 
diff --git a/discovery.c b/discovery.c
index 0cadd72..876a119 100644
--- a/discovery.c
+++ b/discovery.c
@@ -227,7 +227,7 @@ fprintf(stderr,"%p Protocol=%d name=%s\n",d,d->protocol,d->name);
             sprintf(text,"%s (%s) on USB /dev/ozy", d->name, d->protocol==ORIGINAL_PROTOCOL?"Protocol 1":"Protocol 2");
           } else {
 #endif
-            sprintf(text,"%s (%s %s) %s (%02X:%02X:%02X:%02X:%02X:%02X) on %s ",
+            sprintf(text,"%s (%s %s) %s (%02X:%02X:%02X:%02X:%02X:%02X) on %s",
                           d->name,
                           d->protocol==ORIGINAL_PROTOCOL?"Protocol 1":"Protocol 2",
                           version,
diff --git a/gpio.c b/gpio.c
index a593b11..422a4a9 100644
--- a/gpio.c
+++ b/gpio.c
@@ -859,6 +859,8 @@ void gpio_restore_state() {
  value=getProperty("ENABLE_GPIO_SIDETONE");		
  if(value) ENABLE_GPIO_SIDETONE=atoi(value);		
 #endif
+
+
 }
 
 void gpio_save_state() {
diff --git a/iambic.c b/iambic.c
index a3a6799..f36f594 100644
--- a/iambic.c
+++ b/iambic.c
@@ -167,13 +167,11 @@ void keyer_event(int gpio, int level) {
            cwvox=(int) vox_hang;
 	}
     }
-    if (gpio == CWL_BUTTON) {
+    if (gpio == CWL_BUTTON)
         kcwl = state;
         //fprintf(stderr,"L=%d\n",state);   
-    } else { // CWR_BUTTON
+    else // CWR_BUTTON
         kcwr = state;
-        //fprintf(stderr,"R=%d\n",state);   
-    }
 
     if (state || cw_keyer_mode == KEYER_STRAIGHT) {
 #ifdef __APPLE__
diff --git a/noise_menu.c b/noise_menu.c
index c2e280e..2e61492 100644
--- a/noise_menu.c
+++ b/noise_menu.c
@@ -132,7 +132,6 @@ static void snb_cb(GtkWidget *widget, gpointer data) {
 void noise_menu(GtkWidget *parent) {
   GtkWidget *b;
   int i;
-  int mode=vfo[active_receiver->id].mode;
 
   parent_window=parent;
 
diff --git a/old_protocol.c b/old_protocol.c
index 80427a3..4e9b9d9 100644
--- a/old_protocol.c
+++ b/old_protocol.c
@@ -131,9 +131,6 @@ static double phase=0.0;
 static int running;
 static long ep4_sequence;
 
-// DL1YCF added this variable for lost-package-check
-// init with -1 such that there is no error message if the
-// first packet is received with seq_num = 0
 static long last_seq_num=-1;
 
 static int current_rx=0;
diff --git a/ps_menu.c b/ps_menu.c
index 082cbf7..ac25096 100644
--- a/ps_menu.c
+++ b/ps_menu.c
@@ -291,7 +291,6 @@ static void twotone_cb(GtkWidget *widget, gpointer data) {
     g_timeout_add((guint) 100, info_thread, NULL);
   } else {
     running=0;
-    usleep(20000); // to be sure info_thread stopped
   }
 }
 
diff --git a/radio.c b/radio.c
index 70ed23a..3bf10ec 100644
--- a/radio.c
+++ b/radio.c
@@ -833,7 +833,7 @@ void setTune(int state) {
       //schedule_general();
     }
     if(tune) {
-        for(i=0;i<receivers;i++) {
+      for(i=0;i<receivers;i++) {
         SetChannelState(receiver[i]->id,0,i==(receivers-1));
         set_displaying(receiver[i],0);
         if(protocol==NEW_PROTOCOL) {
diff --git a/receiver.c b/receiver.c
index 76cfaef..54f862c 100644
--- a/receiver.c
+++ b/receiver.c
@@ -1197,16 +1197,8 @@ static void process_rx_buffer(RECEIVER *rx) {
   short left_audio_sample;
   short right_audio_sample;
   int i;
-  int mute=0;
-  //
-  // DL1YCF: mute the receiver if we are transmitting on its frequency
-  //
-  if (isTransmitting()) {
-    if (!split && (rx->id == active_receiver->id)) mute=1;
-    if ( split && (rx->id != active_receiver->id)) mute=1;
-  }
   for(i=0;i<rx->output_samples;i++) {
-    if(mute) {
+    if(isTransmitting()) {
       left_audio_sample=0;
       right_audio_sample=0;
     } else {
diff --git a/transmitter.c b/transmitter.c
index b2e01e3..b4c17c9 100644
--- a/transmitter.c
+++ b/transmitter.c
@@ -986,10 +986,8 @@ void add_ps_iq_samples(TRANSMITTER *tx, double i_sample_tx,double q_sample_tx, d
   if(rx_feedback->samples>=rx_feedback->buffer_size) {
     if(isTransmitting()) {
       pscc(transmitter->id, rx_feedback->buffer_size, tx_feedback->iq_input_buffer, rx_feedback->iq_input_buffer);
-      if(transmitter->displaying) {
-        if(transmitter->feedback) {
-          Spectrum0(1, rx_feedback->id, 0, 0, rx_feedback->iq_input_buffer);
-        }
+      if(transmitter->displaying && transmitter->feedback) {
+        Spectrum0(1, rx_feedback->id, 0, 0, rx_feedback->iq_input_buffer);
       }
     }
     rx_feedback->samples=0;
diff --git a/tx_panadapter.c b/tx_panadapter.c
index 85eb58d..852220f 100644
--- a/tx_panadapter.c
+++ b/tx_panadapter.c
@@ -49,9 +49,6 @@ static gfloat hz_per_pixel;
 static gfloat filter_left;
 static gfloat filter_right;
 
-#include "new_menu.h"
-#include "ext.h"
-#include "sliders.h"
 
 /* Create a new surface of the appropriate size to store our scribbles */
 static gboolean
@@ -143,16 +140,17 @@ tx_panadapter_motion_notify_event_cb (GtkWidget      *widget,
   int x, y;
   GdkModifierType state;
   gdk_window_get_device_position (event->window,
-                                  event->device,
-                                  &x,
-                                  &y,
-                                  &state);
+                                event->device,
+                                &x,
+                                &y,
+                                &state);
   if(((state & GDK_BUTTON1_MASK) == GDK_BUTTON1_MASK) || pressed) {
     int moved=last_x-x;
     vfo_move((long long)((float)moved*hz_per_pixel));
     last_x=x;
     has_moved=TRUE;
   }
+
   return TRUE;
 }
 
diff --git a/vfo.c b/vfo.c
index efd6b20..7d041a7 100644
--- a/vfo.c
+++ b/vfo.c
@@ -68,6 +68,7 @@ char *step_labels[]={"1Hz","10Hz","25Hz","50Hz","100Hz","250Hz","500Hz","1kHz","
 static GtkWidget* menu=NULL;
 static GtkWidget* band_menu=NULL;
 
+
 static void vfo_save_bandstack() {
   BANDSTACK *bandstack=bandstack_get_bandstack(vfo[0].band);
   BANDSTACK_ENTRY *entry=&bandstack->entry[vfo[0].bandstack];
@@ -345,15 +346,12 @@ void vfo_bandstack_changed(int b) {
 
 }
 
-//
-// When changing the mode, store the current filter setting
-// and for the new mode, switch to the filter we had the last time
-//
 void vfo_mode_changed(int m) {
   int id=active_receiver->id;
-
   vfo[id].mode=m;
-  // restore filter and NR configuration used last in the new mode
+//
+// Change to the filter/NR combination stored for this mode
+//
   vfo[id].filter      =mode_settings[m].filter;
   active_receiver->nr =mode_settings[m].nr;
   active_receiver->nr2=mode_settings[m].nr2;
@@ -697,7 +695,7 @@ void vfo_update() {
 	// If it is out-of-band, we display "Out of band" in red.
         // Frequencies we are not transmitting on are displayed in green
 	// (dimmed if the freq. does not belong to the active receiver).
-        // Depending on which receiver is the active one, and if we use slit,
+        // Depending on which receiver is the active one, and if we use split,
         // the following frequencies are used for transmitting (see old_protocol.c):
 	// id == 0, split == 0 : TX freq = VFO_A
 	// id == 0, split == 1 : TX freq = VFO_B