From 5f1c6fab613c1c39ba895dd4e59e498fc026fecd Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 27 Jun 2013 11:42:33 +0000 Subject: experimental: switch position of waterfall and spectrogram, waterfall flows down --- spectrogram.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'spectrogram.c') diff --git a/spectrogram.c b/spectrogram.c index ca65521..0255fc7 100644 --- a/spectrogram.c +++ b/spectrogram.c @@ -143,7 +143,8 @@ draw_panel(Display *d, struct panel *p) /* blit waterfall */ XCopyArea(d, p->pix, p->pix, p->pgc, - 0, 1, p->w.width, p->w.height, 0, 0); + p->w.x, p->w.y, p->w.width, p->w.height - 1, + p->w.x, p->w.y + 1); /* clear spectrogram */ XSetForeground(d, p->pgc, p->palette[0]); @@ -167,7 +168,7 @@ draw_panel(Display *d, struct panel *p) /* draw waterfall */ XSetForeground(d, p->pgc, p->palette[v]); XDrawPoint(d, p->pix, p->pgc, - x, p->w.height); + x, p->w.y); /* draw spectrogram */ XSetForeground(d, p->mgc, 1); @@ -226,18 +227,18 @@ init_panel(Display *d, Window win, int x, int y, int w, int h, int mirror) p->p.width = w; p->p.height = h; - /* waterfall */ - p->w.x = 0; - p->w.y = 0; - p->w.width = w; - p->w.height = h * 0.75; - /* spectrogram */ p->s.x = 0; - p->s.y = p->w.height + 1; + p->s.y = 0; p->s.width = w; p->s.height = h * 0.25; + /* waterfall */ + p->w.x = 0; + p->w.y = p->s.height; + p->w.width = w; + p->w.height = h * 0.75; + p->data = calloc(w, sizeof(double)); p->maxval = p->s.height; -- cgit v1.2.3