From b541607ca1ca1031a63acb3cd18ce679dee4c309 Mon Sep 17 00:00:00 2001
From: DL1YCF <dl1ycf@darc.de>
Date: Sat, 14 Mar 2020 19:09:58 +0100
Subject: [PATCH] small corrections

---
 Makefile.mac | 16 ++++++++++++++++
 discovery.c  |  2 +-
 midi3.c      |  6 ++++++
 radio.c      |  5 ++++-
 receiver.c   |  2 ++
 5 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/Makefile.mac b/Makefile.mac
index e74d92e..6d6fdec 100644
--- a/Makefile.mac
+++ b/Makefile.mac
@@ -26,6 +26,9 @@ STEMLAB_DISCOVERY=STEMLAB_DISCOVERY_NOAVAHI
 # uncomment the line below to include MIDI support
 MIDI_INCLUDE=MIDI
 
+# very early code not included yet
+#SERVER_INCLUDE=SERVER
+
 # uncomment the line below for various debug facilities
 #DEBUG_OPTION=-D DEBUG
 
@@ -126,6 +129,16 @@ STEMLAB_HEADERS=stemlab_discovery.h
 STEMLAB_OBJS=stemlab_discovery.o
 endif
 
+ifeq ($(SERVER_INCLUDE), SERVER)
+SERVER_OPTIONS=-D SERVER
+SERVER_SOURCES= \
+hpsdr_server.c
+SERVER_HEADERS= \
+hpsdr_server.h
+SERVER_OBJS= \
+hpsdr_server.o
+endif
+
 GTKINCLUDES=`pkg-config --cflags gtk+-3.0`
 GTKLIBS=`pkg-config --libs gtk+-3.0`
 
@@ -201,6 +214,7 @@ rigctl.c \
 rigctl_menu.c \
 toolbar.c \
 transmitter.c \
+zoompan.c \
 sliders.c \
 version.c \
 vfo.c \
@@ -271,6 +285,7 @@ rigctl.h \
 rigctl_menu.h \
 toolbar.h \
 transmitter.h \
+zoompan.h \
 sliders.h \
 version.h \
 vfo.h \
@@ -340,6 +355,7 @@ rigctl.o \
 rigctl_menu.o \
 toolbar.o \
 transmitter.o \
+zoompan.o \
 sliders.o \
 vfo.o \
 waterfall.o \
diff --git a/discovery.c b/discovery.c
index 8b3a870..64973ec 100644
--- a/discovery.c
+++ b/discovery.c
@@ -537,7 +537,7 @@ fprintf(stderr,"%p Protocol=%d name=%s\n",d,d->protocol,d->name);
                 "stemlab_sdr_transceiver_hpsdr");
           }
           gtk_widget_show(apps_combobox[row]);
-          gtk_grid_attach(GTK_GRID(grid), apps_combobox[row], 4, i, 1, 1);
+          gtk_grid_attach(GTK_GRID(grid), apps_combobox[row], 4, row, 1, 1);
         }
       }
 #endif
diff --git a/midi3.c b/midi3.c
index ff92e31..6f3415d 100644
--- a/midi3.c
+++ b/midi3.c
@@ -479,6 +479,9 @@ void DoTheMidi(enum MIDIaction action, enum MIDItype type, int val) {
 	      case MIDI_KNOB:
                 g_idle_add(ext_pan_set,GINT_TO_POINTER(val));
                 break;
+	      default:
+		// no action for keys (we should not come here anyway)
+		break;
             }
             break;
 	/////////////////////////////////////////////////////////// "PANHIGH"
@@ -828,6 +831,9 @@ g_print("MIDI_ZOOM: MIDI_WHEEL: val=%d\n",val);
 g_print("MIDI_ZOOM: MIDI_KNOB: val=%d\n",val);
                 g_idle_add(ext_zoom_set,GINT_TO_POINTER(val));
                 break;
+	      default:
+		// no action for keys (should not come here anyway)
+		break;
             }
             break;
 	/////////////////////////////////////////////////////////// "ZOOMDOWN"
diff --git a/radio.c b/radio.c
index 81a7310..dd31ea8 100644
--- a/radio.c
+++ b/radio.c
@@ -69,7 +69,10 @@
 #include "iambic.h"
 #endif
 #ifdef MIDI
-#include "midi.h"
+// rather than including MIDI.h with all its internal stuff
+// (e.g. enum components) we just declare the single bit thereof
+// we need here to make a strict compiler happy.
+void MIDIstartup();
 #endif
 #ifdef SERVER
 #include "hpsdr_server.h"
diff --git a/receiver.c b/receiver.c
index 107174a..88ee5b1 100644
--- a/receiver.c
+++ b/receiver.c
@@ -1144,10 +1144,12 @@ g_print("receiver_change_sample_rate: id=%d rate=%d scale=%d buffer_size=%d outp
   SetInputSamplerate(rx->id, sample_rate);
   SetEXTANBSamplerate (rx->id, sample_rate);
   SetEXTNOBSamplerate (rx->id, sample_rate);
+#ifdef SOAPYSDR
   if(protocol==SOAPYSDR_PROTOCOL) {
     soapy_protocol_change_sample_rate(rx);
     soapy_protocol_set_mic_sample_rate(rx->sample_rate);
   }
+#endif
 
   SetChannelState(rx->id,1,0);
 
-- 
2.45.2