-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmartrix.h
91 lines (80 loc) · 1.6 KB
/
martrix.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef XMARTRIX
#define XMARTRIX
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <signal.h>
#include <time.h>
#include <ctype.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xrender.h>
#include "xfds.h"
#define MARTRIX_VERSION "martrix 1.0"
extern volatile sig_atomic_t shutdown_requested;
typedef enum /*_visualizer_channel*/ {
ignore = 0,
dimmer,
strobe,
red,
green,
blue,
white,
uv,
channel_max
} fixture_channel_t;
typedef struct /*_visualizer_fixture_type*/ {
char* name;
size_t channels;
fixture_channel_t* map;
} fixture_type_t;
typedef struct /*_visualizer_fixture*/ {
bool alive;
size_t type;
uint8_t universe;
uint16_t addr;
} fixture_t;
typedef struct /*_visualizer*/ {
size_t dim_x, dim_y;
size_t num_types;
fixture_type_t* types;
fixture_t* fixtures;
} martrix_t;
typedef struct /*_artnet_universe*/ {
uint8_t data[512];
uint16_t ident;
} input_universe_t;
typedef enum /*_martrix_data_input*/ {
input_artnet = 0,
input_sacn
} input_type_t;
typedef struct /*_input_data*/ {
size_t num_universes;
input_universe_t* universes;
uint8_t net;
input_type_t type;
char* bindhost;
int fd;
uint8_t verbose;
} input_t;
typedef struct /*_x11_data*/ {
Display* display;
int screen;
Window main;
Picture window_picture;
Colormap colormap;
XVisualInfo visual_info;
X_FDS fds;
Atom wm_delete;
unsigned width, height;
bool windowed;
uint8_t rerender_required;
} x11_data_t;
typedef struct /*_visualizer_config*/ {
martrix_t visualizer;
x11_data_t xres;
input_t network;
struct timespec last_render;
} config_t;
#endif