Date:2013-01-31 05:09:42 (11 years 1 month ago)
Author:Werner Almesberger
Commit:acd9fd66739a748f35a1127f7c5b285a42d6f6c5
Message:ubb-la/gui.c: show horizontal divisions

Files: ubb-la/gui.c (4 diffs)

Change Details

ubb-la/gui.c
4141#define LEVEL_RGBA 0xffff00ff /* constant level or single change */
4242#define BOUNCE_RGBA 0xff8080ff /* bouncing signal */
4343#define LABEL_RGBA 0xffffffff /* channel label */
44#define DIV_RGBA 0x808080ff /* divisions */
4445
4546#define XCENTER ((XRES+CH_XOFF)/2)
4647
...... 
5455#define CH_SKIP 16
5556#define CH_HEIGHT 8
5657
58#define DIV_X 32
59#define DIV_Y 6
60
5761#define MAX_ZOOM 3
5862
5963#define FREQ_X 0
...... 
342346}
343347
344348
349/* ----- Show a divisions -------------------------------------------------- */
350
351
352static void show_divisions(void)
353{
354    int n = (XRES-CH_XOFF)/2/DIV_X;
355    int i;
356
357    for (i = -n; i <= n; i++)
358        vlineColor(surf, XCENTER+i*DIV_X,
359            ch_y(0, 1)-DIV_Y, ch_y(3, 0)+DIV_Y, DIV_RGBA);
360}
361
362
345363/* ----- Main event loop --------------------------------------------------- */
346364
347365
...... 
366384        clear();
367385        for (i = 0; i != 4; i++)
368386            textf(0, ch_y(i, 1), LABEL_RGBA, "CH%d", i);
387        show_divisions();
369388        show_buffer(buf, skip, nibbles, CH_XOFF, XRES, zoom, pos);
370389        show_freq(freq);
371390        update();

Archive Download the corresponding diff file

Branches:
master



interactive