/* runner.h by Michael Thorpe 2023-05-29 */ #define DMX_MAXCHAN 512 struct frame { int h,w; /* height and width of window */ int y,x; const char *title; void (*draw)(); int (*input)(int c); }; struct dmx { int len; int fd,pos,sawFE; /* only used for DMX read from the outside */ unsigned char data[1+DMX_MAXCHAN]; }; struct look { const char *name; unsigned char (*func)(struct look *me,int chan); void (*update)(struct look *me,double curtime); struct look **subs; struct dmx *dmx; int numsubs; double frac; const char *proc; }; /* audio.c */ int startaudio(int testmode); void playaudio(const char *s); /* cli.c */ extern int rest_column; extern struct frame cliframe; /* dmx.c */ extern struct dmx **procdmx; extern int numprocdmx; #define PERROW(w) (((w)+2)/13) /* number of quad-channels that fit in one row of width w */ #define MARGIN(w) (((w)+2-PERROW(w)*13+1)/2) void show_new_chan(struct frame *frame,int pos,unsigned char val); void dmx_redraw(struct frame *frame,struct dmx *dmx); struct dmx *makeprocdmx(int fd); int dmx_setup(int testmode); /* dmxin.c */ extern struct dmx dmxin; extern struct frame dmxinframe; void dmxin_setoffset(int new); /* -1 means use the current offset */ void dmxin_unlinkchan(int chan); void dmx_readable(struct dmx *dmx); /* dmxout.c */ extern int pifd; /* hacky way to have dmx_setup() open it */ extern struct dmx dmxout; extern struct frame dmxoutframe; void dmxout_doit(); void dmxout_save(); /* fade.c */ int fade_init(); /* looks.c */ extern struct look *editlook; extern struct look *curlook; extern struct frame looksframe; unsigned char storedlook(struct look *me,int chan); void nullupdate(struct look *me,double curtime); int looks_load(); struct look *findlook(const char *name); /* returns a look, or NULL if not found */ struct look *getlook(const char *name); /* returns a look, creating one if necessary */ void looks_redraw(); /* mhl.c */ extern int mhl_base_pos,mhl_last_pos; /* 1="fine" mode (16-bit pan/tilt), 0="coarse" mode (8-bit) */ #define FINE_MODE 1 extern struct frame mhlframe; int mhl_load(); void mhl_update(); enum mhlpower_t {NEUTRAL,ON,OFF}; void mhl_power(enum mhlpower_t newval); unsigned char mhl_output(int subchan); void mhl_setscene(int mhlposidx); /* net.c */ #define ARTNET_SUPPORT #ifdef ARTNET_SUPPORT int artnet_setup(const char *host); void output_artnet_packet(struct dmx *frame); #endif /* quad.c */ extern struct frame *curframe; void draw_titlebar(struct frame *frame); /* scenes.c */ extern struct frame scenesframe; int find_scene(const char *cuename,int dofade); int scenes_load(); /* util.c */ void errmsg(const char *msg); double gettime();