mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2024-11-23 17:34:37 +02:00
ubb-la/gui.c: mark the center of the view area
This commit is contained in:
parent
a83d8bf323
commit
b0a576dd64
11
ubb-la/gui.c
11
ubb-la/gui.c
@ -40,6 +40,7 @@
|
||||
#define UNIT_RGBA 0xb0e0ffff /* units */
|
||||
#define MAP_BUF_RGBA 0x808080ff /* buffer in the map */
|
||||
#define MAP_VIEW_RGBA 0xffffffff /* current view in the map */
|
||||
#define CENTER_RGBA 0x5080ffff /* center marker */
|
||||
#define LEVEL_RGBA 0xffff00ff /* constant level or single change */
|
||||
#define BOUNCE_RGBA 0xff8080ff /* bouncing signal */
|
||||
#define LABEL_RGBA 0xffffffff /* channel label */
|
||||
@ -57,6 +58,10 @@
|
||||
#define MAP_VIEW_Y0 0
|
||||
#define MAP_VIEW_Y1 10
|
||||
|
||||
#define CENTER_W 8
|
||||
#define CENTER_Y0 20
|
||||
#define CENTER_Y1 24
|
||||
|
||||
#define CH_XOFF 30
|
||||
#define CH_YOFF 30
|
||||
#define CH_SKIP 16
|
||||
@ -381,7 +386,8 @@ static void show_divisions(void)
|
||||
|
||||
for (i = -n; i <= n; i++)
|
||||
vlineColor(surf, XCENTER+i*DIV_X,
|
||||
ch_y(0, 1)-DIV_Y, ch_y(3, 0)+DIV_Y, DIV_RGBA);
|
||||
ch_y(0, 1)-DIV_Y, ch_y(3, 0)+DIV_Y,
|
||||
i ? DIV_RGBA : CENTER_RGBA);
|
||||
}
|
||||
|
||||
|
||||
@ -410,6 +416,9 @@ void gui(const uint8_t *buf, int skip, int nibbles, double freq)
|
||||
for (i = 0; i != 4; i++)
|
||||
textf(0, ch_y(i, 1), LABEL_RGBA, "CH%d", i);
|
||||
show_divisions();
|
||||
filledTrigonColor(surf, XCENTER, CENTER_Y1,
|
||||
XCENTER-CENTER_W/2, CENTER_Y0,
|
||||
XCENTER+CENTER_W/2, CENTER_Y0, CENTER_RGBA);
|
||||
show_buffer(buf, skip, nibbles, CH_XOFF, XRES, zoom, pos);
|
||||
show_freq(freq, zoom);
|
||||
update();
|
||||
|
Loading…
Reference in New Issue
Block a user