#include "receiver.h"
#include "vfo.h"
#include "button_text.h"
+#ifdef CLIENT_SERVER
#include "client_server.h"
+#endif
static GtkWidget *parent_window=NULL;
gtk_widget_destroy(dialog);
dialog=NULL;
sub_menu=NULL;
+ active_menu=NO_MENU;
}
}
long long frequency_min=radio->frequency_min;
long long frequency_max=radio->frequency_max;
-//g_print("band_menu: min=%lld max=%lld\n",frequency_min,frequency_max);
+ //g_print("band_menu: min=%lld max=%lld\n",frequency_min,frequency_max);
j=0;
for(i=0;i<BANDS+XVTRS;i++) {
band=(BAND*)band_get_band(i);
bp=buffer+16; // skip 8 header and 8 SYNC/C&C bytes
sum=0.0;
for (j=0; j<126; j++) {
- bp +=4; / skip audio samples
+ bp +=4; // skip audio samples
sample = (int)((signed char) *bp++)<<8;
sample |= (int) ((signed char) *bp++ & 0xFF);
disample=(double) sample * 0.000030517578125; // division by 32768
**************************************************************************************************************
*/
+#include <gtk/gtk.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct timespec *__rem);
#endif
-#ifndef GPIO
-//
-// Dummy functions if compiled without GPIO
-//
-int gpio_cw_sidetone_enabled() { return 0; }
-void gpio_cw_sidetone_set(int level) {}
-#endif
-
-static void keyer_straight_key(int state) {
- //
- // Interface for simple key-down action e.g. from a MIDI message
- //
- if (state != 0) {
- cw_key_down=960000; // max. 20 sec to protect hardware
- cw_key_up=0;
- cw_key_hit=1;
- gpio_cw_sidetone_set(1);
- } else {
- cw_key_down=0;
- cw_key_up=0;
- gpio_cw_sidetone_set(0);
- }
-}
-
void keyer_update() {
//
// This function will take notice of changes in the following variables
// If using GPIO side tone information, mute CW side tone
// as long as the keyer thread is active
//
+#ifdef GPIO
if (gpio_cw_sidetone_enabled()) {
old_volume=cw_keyer_sidetone_volume;
cw_keyer_sidetone_volume=0;
}
+#endif
//
// Normally the keyer will be used in "break-in" mode, that is, we switch to TX
// If both paddles are pressed (should not happen), then
// the dash paddle wins.
if (*kdash) { // send manual dashes
- keyer_straight_key(1); // do key down
+ cw_key_down=960000; // max. 20 sec to protect hardware
+ cw_key_up=0;
+ cw_key_hit=1;
+#ifdef GPIO
+ gpio_cw_sidetone_set(1);
+#endif
key_state=STRAIGHT;
}
} else {
// Wait for dash paddle being released in "straight key" mode.
//
if (! *kdash) {
- keyer_straight_key(0); // key-up
+ cw_key_down=0;
+ cw_key_up=0;
+#ifdef GPIO
+ gpio_cw_sidetone_set(0);
+#endif
key_state=CHECK;
}
break;
dash_held = *kdash;
cw_key_down=dot_samples;
cw_key_up=dot_samples;
+#ifdef GPIO
gpio_cw_sidetone_set(1);
+#endif
key_state=SENDDOT;
break;
// wait for dot being complete
//
if (cw_key_down == 0) {
+#ifdef GPIO
gpio_cw_sidetone_set(0);
+#endif
key_state=DOTDELAY;
}
break;
dot_held = *kdot; // remember if dot is still held at beginning of the dash
cw_key_down=dash_samples;
cw_key_up=dot_samples;
+#ifdef GPIO
gpio_cw_sidetone_set(1);
+#endif
key_state=SENDDASH;
break;
// wait for dot being complete
//
if (cw_key_down == 0) {
+#ifdef GPIO
gpio_cw_sidetone_set(0);
+#endif
key_state=DASHDELAY;
}
break;
//
// If we have reduced the side tone volume, restore it!
//
+#ifdef GPIO
if (gpio_cw_sidetone_enabled()) {
cw_keyer_sidetone_volume = old_volume;
}
+#endif
}
fprintf(stderr,"keyer_thread: EXIT\n");
if (seqnum != 0 &&seqnum != seqold+1 ) {
fprintf(stderr,"Audio thread: SEQ ERROR, old=%lu new=%lu\n", seqold, seqnum);
}
- p=buffer+4;
- for (i=0; i<64; i++) {
- lsample = ((signed char) *p++) << 8;
- lsample |= (*p++ & 0xff);
- rsample = ((signed char) *p++) << 8;
- rsample |= (*p++ & 0xff);
- audio_write(lsample,rsample);
- }
+ // just skip the audio samples
}
close (sock);
return NULL;