diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2023-06-24 16:29:34 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-06-24 16:31:50 -0700 |
commit | 40d001b40aeca62f21a77687b96144c8d0487069 (patch) | |
tree | 9489a830e46a1c26367a09a169928e2ee7a4906c | |
parent | 598fc4e2d571d05e51479c9448c495682bb275e2 (diff) |
modules/rkt: move rkt types to a header
Preparatory commit for adding an interactive scene editing server
of sorts. It'll go in a separate listing, but needs these types
as it'll operate on rkt_context_t->scenes[].
-rw-r--r-- | src/modules/rkt/Makefile.am | 2 | ||||
-rw-r--r-- | src/modules/rkt/rkt.c | 36 | ||||
-rw-r--r-- | src/modules/rkt/rkt.h | 40 |
3 files changed, 43 insertions, 35 deletions
diff --git a/src/modules/rkt/Makefile.am b/src/modules/rkt/Makefile.am index ed446c4..03cebe6 100644 --- a/src/modules/rkt/Makefile.am +++ b/src/modules/rkt/Makefile.am @@ -1,3 +1,3 @@ noinst_LTLIBRARIES = librkt.la -librkt_la_SOURCES = rkt.c +librkt_la_SOURCES = rkt.c rkt.h librkt_la_CPPFLAGS = -I@top_srcdir@/src -I@top_srcdir@/src/libs -I@top_srcdir@/src/libs/rocket/rocket/lib diff --git a/src/modules/rkt/rkt.c b/src/modules/rkt/rkt.c index 903777c..33bdd73 100644 --- a/src/modules/rkt/rkt.c +++ b/src/modules/rkt/rkt.c @@ -17,6 +17,8 @@ #include "txt/txt.h" +#include "rkt.h" + /* Copyright (C) 2023 - Vito Caputo <vcaputo@pengaru.com> */ /* This implements a rudimentary sequencing module varying @@ -24,40 +26,6 @@ * GNU Rocket (https://github.com/rocket/rocket) */ -typedef struct rkt_scene_t { - const til_module_t *module; - til_module_context_t *module_ctxt; -} rkt_scene_t; - -typedef struct rkt_context_t { - til_module_context_t til_module_context; - - struct sync_device *sync_device; - const struct sync_track *scene_track; - double rows_per_ms; - double rocket_row; - unsigned last_ticks; - unsigned paused:1; - rkt_scene_t scenes[]; -} rkt_context_t; - -typedef struct rkt_setup_scene_t { - char *module_name; - til_setup_t *setup; -} rkt_setup_scene_t; - -typedef struct rkt_setup_t { - til_setup_t til_setup; - const char *base; - double rows_per_ms; - unsigned connect:1; - const char *host; - unsigned short port; - size_t n_scenes; - rkt_setup_scene_t scenes[]; -} rkt_setup_t; - - /* variadic helper wrapping librocket's sync_get_track() */ static const struct sync_track * sync_get_trackf(struct sync_device *device, const char *format, ...) { diff --git a/src/modules/rkt/rkt.h b/src/modules/rkt/rkt.h new file mode 100644 index 0000000..c4c8550 --- /dev/null +++ b/src/modules/rkt/rkt.h @@ -0,0 +1,40 @@ +#ifndef _RKT_H +#define _RKT_H + +#include "til.h" +#include "til_module_context.h" + +typedef struct rkt_scene_t { + const til_module_t *module; + til_module_context_t *module_ctxt; +} rkt_scene_t; + +typedef struct rkt_context_t { + til_module_context_t til_module_context; + + struct sync_device *sync_device; + const struct sync_track *scene_track; + double rows_per_ms; + double rocket_row; + unsigned last_ticks; + unsigned paused:1; + rkt_scene_t scenes[]; +} rkt_context_t; + +typedef struct rkt_setup_scene_t { + char *module_name; + til_setup_t *setup; +} rkt_setup_scene_t; + +typedef struct rkt_setup_t { + til_setup_t til_setup; + const char *base; + double rows_per_ms; + unsigned connect:1; + const char *host; + unsigned short port; + size_t n_scenes; + rkt_setup_scene_t scenes[]; +} rkt_setup_t; + +#endif |