aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2018-01-21 09:30:00 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2018-01-21 10:46:12 +0100
commit8877729048f4de34229769c13c1e0e72f57bd0a0 (patch)
tree2b3cb836eed3fe1ac3f6d0e0e0f62212df95b69f
parent819859db1f6390172c8e45f0e1c244ccaac4d01f (diff)
libdisplay: Removing dependency from libmobile
-rw-r--r--src/amps/dsp.c4
-rw-r--r--src/anetz/dsp.c4
-rw-r--r--src/bnetz/dsp.c10
-rw-r--r--src/cnetz/fsk_demod.c4
-rw-r--r--src/jolly/dsp.c4
-rw-r--r--src/libdisplay/display.h26
-rw-r--r--src/libdisplay/display_iq.c2
-rw-r--r--src/libdisplay/display_measurements.c34
-rw-r--r--src/libdisplay/display_spectrum.c53
-rw-r--r--src/libdisplay/display_status.c2
-rw-r--r--src/libdisplay/display_wave.c12
-rw-r--r--src/libmobile/sender.c15
-rw-r--r--src/libsdr/sdr.c8
-rw-r--r--src/libsound/sound_alsa.c2
-rw-r--r--src/nmt/dsp.c4
-rw-r--r--src/r2000/dsp.c8
16 files changed, 126 insertions, 66 deletions
diff --git a/src/amps/dsp.c b/src/amps/dsp.c
index 1847f8d..93f4eab 100644
--- a/src/amps/dsp.c
+++ b/src/amps/dsp.c
@@ -267,8 +267,8 @@ int dsp_init_sender(amps_t *amps, int tolerant)
/* be more tolerant when syncing */
amps->fsk_rx_sync_tolerant = tolerant;
- amps->dmp_frame_level = display_measurements_add(&amps->sender, "Frame Level", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
- amps->dmp_frame_quality = display_measurements_add(&amps->sender, "Frame Quality", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
+ amps->dmp_frame_level = display_measurements_add(&amps->sender.dispmeas, "Frame Level", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
+ amps->dmp_frame_quality = display_measurements_add(&amps->sender.dispmeas, "Frame Quality", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
return 0;
diff --git a/src/anetz/dsp.c b/src/anetz/dsp.c
index 828f551..3bcf112 100644
--- a/src/anetz/dsp.c
+++ b/src/anetz/dsp.c
@@ -111,8 +111,8 @@ int dsp_init_sender(anetz_t *anetz, double page_gain, int page_sequence, double
anetz->tone_phaseshift65536 = 65536.0 / ((double)anetz->sender.samplerate / tone);
PDEBUG(DDSP, DEBUG_DEBUG, "TX %.0f Hz phaseshift = %.4f\n", tone, anetz->tone_phaseshift65536);
- anetz->dmp_tone_level = display_measurements_add(&anetz->sender, "Tone Level", "%.1f %%", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
- anetz->dmp_tone_quality = display_measurements_add(&anetz->sender, "Tone Quality", "%.1f %%", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
+ anetz->dmp_tone_level = display_measurements_add(&anetz->sender.dispmeas, "Tone Level", "%.1f %%", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
+ anetz->dmp_tone_quality = display_measurements_add(&anetz->sender.dispmeas, "Tone Quality", "%.1f %%", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
return 0;
}
diff --git a/src/bnetz/dsp.c b/src/bnetz/dsp.c
index 093cb1a..6915d9f 100644
--- a/src/bnetz/dsp.c
+++ b/src/bnetz/dsp.c
@@ -100,11 +100,11 @@ int dsp_init_sender(bnetz_t *bnetz, double squelch_db)
bnetz->meter_phaseshift65536 = 65536.0 / ((double)bnetz->sender.samplerate / METERING_HZ);
PDEBUG(DDSP, DEBUG_DEBUG, "dial_phaseshift = %.4f\n", bnetz->meter_phaseshift65536);
- bnetz->dmp_tone_level = display_measurements_add(&bnetz->sender, "Tone Level", "%.1f %%", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
- bnetz->dmp_tone_quality = display_measurements_add(&bnetz->sender, "Tone Quality", "%.1f %%", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
- bnetz->dmp_frame_level = display_measurements_add(&bnetz->sender, "Frame Level", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
- bnetz->dmp_frame_stddev = display_measurements_add(&bnetz->sender, "Frame Stddev", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
- bnetz->dmp_frame_quality = display_measurements_add(&bnetz->sender, "Frame Quality", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
+ bnetz->dmp_tone_level = display_measurements_add(&bnetz->sender.dispmeas, "Tone Level", "%.1f %%", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
+ bnetz->dmp_tone_quality = display_measurements_add(&bnetz->sender.dispmeas, "Tone Quality", "%.1f %%", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
+ bnetz->dmp_frame_level = display_measurements_add(&bnetz->sender.dispmeas, "Frame Level", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
+ bnetz->dmp_frame_stddev = display_measurements_add(&bnetz->sender.dispmeas, "Frame Stddev", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
+ bnetz->dmp_frame_quality = display_measurements_add(&bnetz->sender.dispmeas, "Frame Quality", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
return 0;
}
diff --git a/src/cnetz/fsk_demod.c b/src/cnetz/fsk_demod.c
index a2b85ba..5acf8b5 100644
--- a/src/cnetz/fsk_demod.c
+++ b/src/cnetz/fsk_demod.c
@@ -191,8 +191,8 @@ int fsk_fm_init(fsk_fm_demod_t *fsk, cnetz_t *cnetz, int samplerate, double bitr
printf("**** Writing decoder debug file '%s' ****\n", debug_filename);
#endif
- fsk->dmp_frame_level = display_measurements_add(&cnetz->sender, "Frame Level", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
- fsk->dmp_frame_stddev = display_measurements_add(&cnetz->sender, "Frame Stddev", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
+ fsk->dmp_frame_level = display_measurements_add(&cnetz->sender.dispmeas, "Frame Level", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
+ fsk->dmp_frame_stddev = display_measurements_add(&cnetz->sender.dispmeas, "Frame Stddev", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
return 0;
diff --git a/src/jolly/dsp.c b/src/jolly/dsp.c
index c8c34d8..fff5390 100644
--- a/src/jolly/dsp.c
+++ b/src/jolly/dsp.c
@@ -123,8 +123,8 @@ int dsp_init_sender(jolly_t *jolly, int nbfm, double squelch_db, int repeater)
}
- jolly->dmp_dtmf_low = display_measurements_add(&jolly->sender, "DTMF Low", "%.1f dB (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, -30.0, 6.0, 0.0);
- jolly->dmp_dtmf_high = display_measurements_add(&jolly->sender, "DTMF High", "%.1f dB (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, -30.0, 6.0, 0.0);
+ jolly->dmp_dtmf_low = display_measurements_add(&jolly->sender.dispmeas, "DTMF Low", "%.1f dB (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, -30.0, 6.0, 0.0);
+ jolly->dmp_dtmf_high = display_measurements_add(&jolly->sender.dispmeas, "DTMF High", "%.1f dB (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, -30.0, 6.0, 0.0);
return 0;
diff --git a/src/libdisplay/display.h b/src/libdisplay/display.h
index 634e74f..6300948 100644
--- a/src/libdisplay/display.h
+++ b/src/libdisplay/display.h
@@ -3,9 +3,8 @@
#define MAX_DISPLAY_WIDTH 1024
-typedef struct sender sender_t;
-
typedef struct display_wave {
+ int kanal;
int interval_pos;
int interval_max;
int offset;
@@ -43,7 +42,9 @@ typedef struct display_measurements_param {
} dispmeasparam_t;
typedef struct display_measurements {
- dispmeasparam_t *head;
+ struct display_measurements *next;
+ int kanal;
+ dispmeasparam_t *param;
} dispmeas_t;
#define MAX_DISPLAY_IQ 1024
@@ -56,20 +57,27 @@ typedef struct display_iq {
#define MAX_DISPLAY_SPECTRUM 1024
+typedef struct display_spectrum_mark {
+ struct display_spectrum_mark *next;
+ int kanal;
+ double frequency;
+} dispspectrum_mark_t;
+
typedef struct display_spectrum {
int interval_pos;
int interval_max;
double buffer_I[MAX_DISPLAY_SPECTRUM];
double buffer_Q[MAX_DISPLAY_SPECTRUM];
+ dispspectrum_mark_t *mark;
} dispspectrum_t;
#define MAX_HEIGHT_STATUS 32
void get_win_size(int *w, int *h);
-void display_wave_init(sender_t *sender, int samplerate);
+void display_wave_init(dispwav_t *disp, int samplerate, int kanal);
void display_wave_on(int on);
-void display_wave(sender_t *sender, sample_t *samples, int length, double range);
+void display_wave(dispwav_t *disp, sample_t *samples, int length, double range);
void display_status_on(int on);
void display_status_start(void);
@@ -77,10 +85,10 @@ void display_status_channel(int channel, const char *type, const char *state);
void display_status_subscriber(const char *number, const char *state);
void display_status_end(void);
-void display_measurements_init(sender_t *sender, int samplerate);
-void display_measurements_exit(sender_t *sender);
+void display_measurements_init(dispmeas_t *disp, int samplerate, int kanal);
+void display_measurements_exit(dispmeas_t *disp);
void display_measurements_on(int on);
-dispmeasparam_t *display_measurements_add(sender_t *sender, char *name, char *format, enum display_measurements_type type, enum display_measurements_bar bar, double min, double max, double mark);
+dispmeasparam_t *display_measurements_add(dispmeas_t *disp, char *name, char *format, enum display_measurements_type type, enum display_measurements_bar bar, double min, double max, double mark);
void display_measurements_update(dispmeasparam_t *param, double value, double value2);
void display_measurements(double elapsed);
@@ -89,6 +97,8 @@ void display_iq_on(int on);
void display_iq(float *samples, int length);
void display_spectrum_init(int samplerate, double center_frequency);
+void display_spectrum_add_mark(int kanal, double frequency);
+void display_spectrum_exit(void);
void display_spectrum_on(int on);
void display_spectrum(float *samples, int length);
diff --git a/src/libdisplay/display_iq.c b/src/libdisplay/display_iq.c
index c99833b..303706a 100644
--- a/src/libdisplay/display_iq.c
+++ b/src/libdisplay/display_iq.c
@@ -24,8 +24,8 @@
#include <pthread.h>
#include <stdlib.h>
#include "../libsample/sample.h"
-#include "../libmobile/sender.h"
#include "../libdebug/debug.h"
+#include "../libdisplay/display.h"
/* must be odd value! */
#define SIZE 23
diff --git a/src/libdisplay/display_measurements.c b/src/libdisplay/display_measurements.c
index 9dc06ae..7c963cd 100644
--- a/src/libdisplay/display_measurements.c
+++ b/src/libdisplay/display_measurements.c
@@ -25,8 +25,8 @@
#include <sys/ioctl.h>
#include <math.h>
#include "../libsample/sample.h"
-#include "../libmobile/sender.h"
#include "../libdebug/debug.h"
+#include "../libdisplay/display.h"
#define MAX_NAME_LEN 16
#define MAX_UNIT_LEN 16
@@ -38,27 +38,34 @@ static int lines_total = 0;
static char line[MAX_DISPLAY_WIDTH];
static char line_color[MAX_DISPLAY_WIDTH];
-void display_measurements_init(sender_t *sender, int __attribute__((unused)) samplerate)
+dispmeas_t *meas_head = NULL;
+
+void display_measurements_init(dispmeas_t *disp, int __attribute__((unused)) samplerate, int kanal)
{
- dispmeas_t *disp = &sender->dispmeas;
+ dispmeas_t **disp_p;
memset(disp, 0, sizeof(*disp));
+ disp->kanal = kanal;
has_init = 1;
lines_total = 0;
time_elapsed = 0.0;
+
+ disp_p = &meas_head;
+ while (*disp_p)
+ disp_p = &((*disp_p)->next);
+ *disp_p = disp;
}
-void display_measurements_exit(sender_t *sender)
+void display_measurements_exit(dispmeas_t *disp)
{
- dispmeas_t *disp = &sender->dispmeas;
- dispmeasparam_t *param = disp->head, *temp;
+ dispmeasparam_t *param = disp->param, *temp;
while (param) {
temp = param;
param = param->next;
free(temp);
}
- disp->head = NULL;
+ disp->param = NULL;
has_init = 0;
}
@@ -86,7 +93,7 @@ static void display_line(int on, int w)
static void print_measurements(int on)
{
- sender_t *sender;
+ dispmeas_t *disp;
dispmeasparam_t *param;
int i, j;
int width, h;
@@ -104,13 +111,13 @@ static void print_measurements(int on)
lines_total = 0;
color = -1;
printf("\0337\033[H");
- for (sender = sender_head; sender; sender = sender->next) {
+ for (disp = meas_head; disp; disp = disp->next) {
memset(line, ' ', width);
memset(line_color, 7, width);
- sprintf(line, "(chan %d", sender->kanal);
+ sprintf(line, "(chan %d", disp->kanal);
*strchr(line, '\0') = ')';
display_line(on, width);
- for (param = sender->dispmeas.head; param; param = param->next) {
+ for (param = disp->param; param; param = param->next) {
memset(line, ' ', width);
memset(line_color, 7, width);
memset(line_color, 3, MAX_NAME_LEN); /* yellow */
@@ -259,10 +266,9 @@ void display_measurements_on(int on)
}
/* add new parameter on startup to the list of measurements */
-dispmeasparam_t *display_measurements_add(sender_t *sender, char *name, char *format, enum display_measurements_type type, enum display_measurements_bar bar, double min, double max, double mark)
+dispmeasparam_t *display_measurements_add(dispmeas_t *disp, char *name, char *format, enum display_measurements_type type, enum display_measurements_bar bar, double min, double max, double mark)
{
- dispmeas_t *disp = &sender->dispmeas;
- dispmeasparam_t *param, **param_p = &disp->head;
+ dispmeasparam_t *param, **param_p = &disp->param;
int i;
if (!has_init) {
diff --git a/src/libdisplay/display_spectrum.c b/src/libdisplay/display_spectrum.c
index 2e2f167..4da35d9 100644
--- a/src/libdisplay/display_spectrum.c
+++ b/src/libdisplay/display_spectrum.c
@@ -23,12 +23,13 @@
#include <string.h>
#include <math.h>
#include "../libsample/sample.h"
-#include "../libmobile/sender.h"
#include "../libfft/fft.h"
#include "../libdebug/debug.h"
+#include "../libdisplay/display.h"
#define HEIGHT 20
+static int has_init = 0;
static double buffer_delay[MAX_DISPLAY_SPECTRUM];
static double buffer_hold[MAX_DISPLAY_SPECTRUM];
static char screen[HEIGHT][MAX_DISPLAY_WIDTH];
@@ -50,6 +51,42 @@ void display_spectrum_init(int samplerate, double _center_frequency)
center_frequency = _center_frequency;
frequency_range = (double)samplerate;
+
+ has_init = 1;
+}
+
+void display_spectrum_add_mark(int kanal, double frequency)
+{
+ dispspectrum_mark_t *mark, **mark_p;
+
+ if (!has_init)
+ return;
+
+ mark = calloc(1, sizeof(*mark));
+ if (!mark) {
+ fprintf(stderr, "no mem!");
+ abort();
+ }
+ mark->kanal = kanal;
+ mark->frequency = frequency;
+
+ mark_p = &disp.mark;
+ while (*mark_p)
+ mark_p = &((*mark_p)->next);
+ *mark_p = mark;
+}
+
+void display_spectrum_exit(void)
+{
+ dispspectrum_mark_t *mark = disp.mark, *temp;
+
+ while (mark) {
+ temp = mark;
+ mark = mark->next;
+ free(temp);
+ }
+ disp.mark = NULL;
+ has_init = 0;
}
void display_spectrum_on(int on)
@@ -88,7 +125,7 @@ void display_spectrum_on(int on)
*/
void display_spectrum(float *samples, int length)
{
- sender_t *sender;
+ dispspectrum_mark_t *mark;
char print_channel[32], print_frequency[32];
int width, h;
int pos, max;
@@ -300,8 +337,8 @@ void display_spectrum(float *samples, int length)
}
}
/* add channel positions in spectrum */
- for (sender = sender_head; sender; sender = sender->next) {
- j = (int)((sender->empfangsfrequenz - center_frequency) / frequency_range * (double) fft_size + width / 2 + 0.5);
+ for (mark = disp.mark; mark; mark = mark->next) {
+ j = (int)((mark->frequency - center_frequency) / frequency_range * (double) fft_size + width / 2 + 0.5);
if (j < 0 || j >= width) /* check out-of-range, should not happen */
continue;
for (k = 0; k < HEIGHT; k++) {
@@ -311,7 +348,7 @@ void display_spectrum(float *samples, int length)
screen[k][j] = ':';
screen_color[k][j] = 12;
}
- sprintf(print_channel, "Ch%d", sender->kanal);
+ sprintf(print_channel, "Ch%d", mark->kanal);
for (o = 0; o < (int)strlen(print_channel); o++) {
s = j - strlen(print_channel) + o;
if (s >= 0 && s < width) {
@@ -319,10 +356,10 @@ void display_spectrum(float *samples, int length)
screen_color[HEIGHT - 1][s] = 7;
}
}
- if (fmod(sender->empfangsfrequenz, 1000.0))
- sprintf(print_frequency, "%.4f", sender->empfangsfrequenz / 1e6);
+ if (fmod(mark->frequency, 1000.0))
+ sprintf(print_frequency, "%.4f", mark->frequency / 1e6);
else
- sprintf(print_frequency, "%.3f", sender->empfangsfrequenz / 1e6);
+ sprintf(print_frequency, "%.3f", mark->frequency / 1e6);
for (o = 0; o < (int)strlen(print_frequency); o++) {
s = j + o + 1;
if (s >= 0 && s < width) {
diff --git a/src/libdisplay/display_status.c b/src/libdisplay/display_status.c
index 681c217..671dd7f 100644
--- a/src/libdisplay/display_status.c
+++ b/src/libdisplay/display_status.c
@@ -23,8 +23,8 @@
#include <pthread.h>
#include <sys/ioctl.h>
#include "../libsample/sample.h"
-#include "../libmobile/sender.h"
#include "../libdebug/debug.h"
+#include "../libdisplay/display.h"
static int status_on = 0;
static int line_count = 0;
diff --git a/src/libdisplay/display_wave.c b/src/libdisplay/display_wave.c
index dcb1dfb..282c1c1 100644
--- a/src/libdisplay/display_wave.c
+++ b/src/libdisplay/display_wave.c
@@ -24,8 +24,8 @@
#include <math.h>
#include <sys/ioctl.h>
#include "../libsample/sample.h"
-#include "../libmobile/sender.h"
#include "../libdebug/debug.h"
+#include "../libdisplay/display.h"
#define HEIGHT 11
@@ -51,13 +51,12 @@ void get_win_size(int *w, int *h)
*w = MAX_DISPLAY_WIDTH - 1;
}
-void display_wave_init(sender_t *sender, int samplerate)
+void display_wave_init(dispwav_t *disp, int samplerate, int kanal)
{
- dispwav_t *disp = &sender->dispwav;
-
memset(disp, 0, sizeof(*disp));
disp->offset = (num_sender++) * HEIGHT;
disp->interval_max = (double)samplerate * DISPLAY_INTERVAL + 0.5;
+ disp->kanal = kanal;
}
void display_wave_on(int on)
@@ -105,9 +104,8 @@ void display_wave_on(int on)
* y is in range of 0..4, so these are 5 steps, where 2 is the
* center line. this is calculated by (HEIGHT * 2 - 1)
*/
-void display_wave(sender_t *sender, sample_t *samples, int length, double range)
+void display_wave(dispwav_t *disp, sample_t *samples, int length, double range)
{
- dispwav_t *disp = &sender->dispwav;
int pos, max;
sample_t *buffer;
int i, j, k, s, e;
@@ -218,7 +216,7 @@ void display_wave(sender_t *sender, sample_t *samples, int length, double range)
screen[k][j] = '|';
}
}
- sprintf(screen[0], "(chan %d", sender->kanal);
+ sprintf(screen[0], "(chan %d", disp->kanal);
*strchr(screen[0], '\0') = ')';
printf("\0337\033[H");
for (j = 0; j < disp->offset; j++)
diff --git a/src/libmobile/sender.c b/src/libmobile/sender.c
index 98ac1bb..728fa46 100644
--- a/src/libmobile/sender.c
+++ b/src/libmobile/sender.c
@@ -143,8 +143,8 @@ int sender_create(sender_t *sender, int kanal, double sendefrequenz, double empf
*sender_tailp = sender;
sender_tailp = &sender->next;
- display_wave_init(sender, samplerate);
- display_measurements_init(sender, samplerate);
+ display_wave_init(&sender->dispwav, samplerate, sender->kanal);
+ display_measurements_init(&sender->dispmeas, samplerate, sender->kanal);
return 0;
error:
@@ -215,6 +215,13 @@ int sender_open_audio(int latspl)
}
}
+#ifdef HAVE_SDR
+ /* in case of initialized spectrum display (SDR), we add all channels.
+ * if spectrum display was not initialized (sound card), function call is ignored */
+ for (inst = sender_head; inst; inst = inst->next)
+ display_spectrum_add_mark(inst->kanal, inst->empfangsfrequenz);
+#endif
+
return 0;
}
@@ -336,7 +343,7 @@ cant_recover:
sender_send(inst, samples[i], power[i], count);
/* internal loopback: loop back TX audio to RX */
if (inst->loopback == 1) {
- display_wave(inst, samples[i], count, inst->max_display);
+ display_wave(&inst->dispwav, samples[i], count, inst->max_display);
sender_receive(inst, samples[i], count, 0.0);
}
/* do pre emphasis towards radio */
@@ -409,7 +416,7 @@ cant_recover:
de_emphasis(&inst->estate, samples[i], count);
}
if (inst->loopback != 1) {
- display_wave(inst, samples[i], count, inst->max_display);
+ display_wave(&inst->dispwav, samples[i], count, inst->max_display);
sender_receive(inst, samples[i], count, rf_level_db[i]);
}
if (inst->loopback == 3)
diff --git a/src/libsdr/sdr.c b/src/libsdr/sdr.c
index 1333a6a..decf5bd 100644
--- a/src/libsdr/sdr.c
+++ b/src/libsdr/sdr.c
@@ -351,9 +351,9 @@ void *sdr_open(const char __attribute__((__unused__)) *audiodev, double *tx_freq
sender_t *sender = get_sender_by_empfangsfrequenz(sdr->chan[c].rx_frequency);
if (!sender)
continue;
- sdr->chan[c].dmp_rf_level = display_measurements_add(sender, "RF Level", "%.1f dB", DISPLAY_MEAS_AVG, DISPLAY_MEAS_LEFT, -96.0, 0.0, -INFINITY);
- sdr->chan[c].dmp_freq_offset = display_measurements_add(sender, "Freq. Offset", "%+.2f KHz", DISPLAY_MEAS_AVG, DISPLAY_MEAS_CENTER, -max_deviation / 1000.0 * 2.0, max_deviation / 1000.0 * 2.0, 0.0);
- sdr->chan[c].dmp_deviation = display_measurements_add(sender, "Deviation", "%.2f KHz", DISPLAY_MEAS_PEAK2PEAK, DISPLAY_MEAS_LEFT, 0.0, max_deviation / 1000.0 * 1.5, max_deviation / 1000.0);
+ sdr->chan[c].dmp_rf_level = display_measurements_add(&sender->dispmeas, "RF Level", "%.1f dB", DISPLAY_MEAS_AVG, DISPLAY_MEAS_LEFT, -96.0, 0.0, -INFINITY);
+ sdr->chan[c].dmp_freq_offset = display_measurements_add(&sender->dispmeas, "Freq. Offset", "%+.2f KHz", DISPLAY_MEAS_AVG, DISPLAY_MEAS_CENTER, -max_deviation / 1000.0 * 2.0, max_deviation / 1000.0 * 2.0, 0.0);
+ sdr->chan[c].dmp_deviation = display_measurements_add(&sender->dispmeas, "Deviation", "%.2f KHz", DISPLAY_MEAS_PEAK2PEAK, DISPLAY_MEAS_LEFT, 0.0, max_deviation / 1000.0 * 1.5, max_deviation / 1000.0);
}
}
@@ -644,6 +644,8 @@ void sdr_close(void *inst)
free(sdr);
sdr = NULL;
}
+
+ display_spectrum_exit();
}
int sdr_write(void *inst, sample_t **samples, uint8_t **power, int num, enum paging_signal __attribute__((unused)) *paging_signal, int *on, int channels)
diff --git a/src/libsound/sound_alsa.c b/src/libsound/sound_alsa.c
index 12318a7..5c75fa4 100644
--- a/src/libsound/sound_alsa.c
+++ b/src/libsound/sound_alsa.c
@@ -196,7 +196,7 @@ void *sound_open(const char *audiodev, double __attribute__((unused)) *tx_freque
sender = get_sender_by_empfangsfrequenz(sound->rx_frequency[i]);
if (!sender)
continue;
- sound->dmp[i] = display_measurements_add(sender, "RX Level", "%.1f dB", DISPLAY_MEAS_PEAK, DISPLAY_MEAS_LEFT, -96.0, 0.0, -INFINITY);
+ sound->dmp[i] = display_measurements_add(&sender->dispmeas, "RX Level", "%.1f dB", DISPLAY_MEAS_PEAK, DISPLAY_MEAS_LEFT, -96.0, 0.0, -INFINITY);
}
}
diff --git a/src/nmt/dsp.c b/src/nmt/dsp.c
index e4bbbc5..d442324 100644
--- a/src/nmt/dsp.c
+++ b/src/nmt/dsp.c
@@ -151,8 +151,8 @@ int dsp_init_sender(nmt_t *nmt, double deviation_factor)
/* dtmf, generate tone relative to speech level */
dtmf_encode_init(&nmt->dtmf, 8000, 1.0 / SPEECH_LEVEL);
- nmt->dmp_frame_level = display_measurements_add(&nmt->sender, "Frame Level", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
- nmt->dmp_frame_quality = display_measurements_add(&nmt->sender, "Frame Quality", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
+ nmt->dmp_frame_level = display_measurements_add(&nmt->sender.dispmeas, "Frame Level", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
+ nmt->dmp_frame_quality = display_measurements_add(&nmt->sender.dispmeas, "Frame Quality", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
return 0;
}
diff --git a/src/r2000/dsp.c b/src/r2000/dsp.c
index 61b20e6..72f3136 100644
--- a/src/r2000/dsp.c
+++ b/src/r2000/dsp.c
@@ -108,11 +108,11 @@ int dsp_init_sender(r2000_t *r2000)
iir_highpass_init(&r2000->super_tx_hp, SUPER_CUTOFF_H, r2000->sender.samplerate, 2);
iir_highpass_init(&r2000->super_rx_hp, SUPER_CUTOFF_H, r2000->sender.samplerate, 2);
- r2000->dmp_frame_level = display_measurements_add(&r2000->sender, "Frame Level", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
- r2000->dmp_frame_quality = display_measurements_add(&r2000->sender, "Frame Quality", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
+ r2000->dmp_frame_level = display_measurements_add(&r2000->sender.dispmeas, "Frame Level", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
+ r2000->dmp_frame_quality = display_measurements_add(&r2000->sender.dispmeas, "Frame Quality", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
if (r2000->sysinfo.chan_type == CHAN_TYPE_TC || r2000->sysinfo.chan_type == CHAN_TYPE_CC_TC) {
- r2000->dmp_super_level = display_measurements_add(&r2000->sender, "Super Level", "%.1f %%", DISPLAY_MEAS_AVG, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
- r2000->dmp_super_quality = display_measurements_add(&r2000->sender, "Super Quality", "%.1f %%", DISPLAY_MEAS_AVG, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
+ r2000->dmp_super_level = display_measurements_add(&r2000->sender.dispmeas, "Super Level", "%.1f %%", DISPLAY_MEAS_AVG, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
+ r2000->dmp_super_quality = display_measurements_add(&r2000->sender.dispmeas, "Super Quality", "%.1f %%", DISPLAY_MEAS_AVG, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
}
return 0;