libdebug: Remove dependency on MAX_DISPLAY_WIDTH

pull/1/head
Andreas Eversberg 2 years ago
parent f37dfbe4ee
commit 76c6304ae3
  1. 2
      src/libdebug/debug.c
  2. 4
      src/libdisplay/display_iq.c
  3. 2
      src/libdisplay/display_measurements.c
  4. 6
      src/libdisplay/display_spectrum.c
  5. 2
      src/libdisplay/display_status.c
  6. 4
      src/libdisplay/display_wave.c

@ -101,8 +101,6 @@ void get_win_size(int *w, int *h)
*h = win.ws_row;
*w = win.ws_col;
if (*w > MAX_DISPLAY_WIDTH - 1)
*w = MAX_DISPLAY_WIDTH - 1;
}
void _printdebug(const char *file, const char __attribute__((unused)) *function, int line, int cat, int level, const char *kanal, const char *fmt, ...)

@ -54,6 +54,8 @@ void display_iq_on(int on)
int w, h;
get_win_size(&w, &h);
if (w > MAX_DISPLAY_WIDTH - 1)
w = MAX_DISPLAY_WIDTH - 1;
if (iq_on) {
memset(&screen, ' ', sizeof(screen));
@ -113,6 +115,8 @@ void display_iq(float *samples, int length)
return;
get_win_size(&width, &h);
if (width > MAX_DISPLAY_WIDTH - 1)
width = MAX_DISPLAY_WIDTH - 1;
/* at what line we draw our zero-line and what character we use */
x_center = width >> 1;

@ -102,6 +102,8 @@ static void print_measurements(int on)
int bar_width, bar_left, bar_right, bar_hold, bar_mark;
get_win_size(&width, &h);
if (width > MAX_DISPLAY_WIDTH - 1)
width = MAX_DISPLAY_WIDTH - 1;
/* no display, if bar graph is less than one character */
bar_width = width - MAX_NAME_LEN - MAX_UNIT_LEN;

@ -95,6 +95,8 @@ void display_spectrum_on(int on)
int w, h;
get_win_size(&w, &h);
if (w > MAX_DISPLAY_WIDTH - 1)
w = MAX_DISPLAY_WIDTH - 1;
if (spectrum_on) {
memset(&screen, ' ', sizeof(screen));
@ -139,8 +141,8 @@ void display_spectrum(float *samples, int length)
return;
get_win_size(&width, &h);
if (width > MAX_DISPLAY_WIDTH)
width = MAX_DISPLAY_WIDTH;
if (width > MAX_DISPLAY_WIDTH - 1)
width = MAX_DISPLAY_WIDTH - 1;
/* calculate size of FFT */
int m, fft_size = 0, fft_taps = 0;

@ -37,6 +37,8 @@ static void print_status(int on)
int w, h;
get_win_size(&w, &h);
if (w > MAX_DISPLAY_WIDTH - 1)
w = MAX_DISPLAY_WIDTH - 1;
if (w > MAX_DISPLAY_WIDTH)
w = MAX_DISPLAY_WIDTH;

@ -47,6 +47,8 @@ void display_wave_on(int on)
int w, h;
get_win_size(&w, &h);
if (w > MAX_DISPLAY_WIDTH - 1)
w = MAX_DISPLAY_WIDTH - 1;
if (wave_on) {
memset(&screen, ' ', sizeof(screen));
@ -101,6 +103,8 @@ void display_wave(dispwav_t *disp, sample_t *samples, int length, double range)
return;
get_win_size(&width, &h);
if (width > MAX_DISPLAY_WIDTH - 1)
width = MAX_DISPLAY_WIDTH - 1;
/* at what line we draw our zero-line and what character we use */
center_line = (HEIGHT - 1) >> 1;

Loading…
Cancel
Save