diff options
author | XANTRONIX Development | 2022-03-10 00:41:49 -0500 |
---|---|---|
committer | XANTRONIX Development | 2022-03-10 00:41:49 -0500 |
commit | 945f3ba330620e429bb70cb71d8dc0b9521d8b1d (patch) | |
tree | b068c5a8c4c9147d19e568a65db04500fcf31574 /include | |
parent | c9232a69a0c44afd90be01137369e692672007c4 (diff) | |
download | xas-945f3ba330620e429bb70cb71d8dc0b9521d8b1d.tar.gz xas-945f3ba330620e429bb70cb71d8dc0b9521d8b1d.tar.bz2 xas-945f3ba330620e429bb70cb71d8dc0b9521d8b1d.zip |
Initial commit of src/drone.c
Diffstat (limited to 'include')
-rw-r--r-- | include/xas/drone.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/include/xas/drone.h b/include/xas/drone.h new file mode 100644 index 0000000..d77834c --- /dev/null +++ b/include/xas/drone.h @@ -0,0 +1,88 @@ +#ifndef _XAS_DRONE_H +#define _XAS_DRONE_H + +#include <sys/time.h> + +#include <xas/spatial.h> +#include <xas/seq.h> + +enum xas_drone_chamber_event_type { + XAS_DRONE_CHAMBER_EVENT_NONE, + XAS_DRONE_CHAMBER_EVENT_SYNTH, + XAS_DRONE_CHAMBER_EVENT_DRONE_SPEECH +}; + +typedef struct _xas_drone xas_drone; + +struct _xas_drone { + xas_bank *bank; + xas_spatial_scene *scene; + xas_spatial_object *obj; + float speech_speed; + + const char **speech_lines; + + xas_drone *next; +}; + +typedef struct _xas_drone_chamber_interval { + struct timeval duration; + + size_t freq_l, + freq_r; + + enum xas_synth_type type_l, + type_r; +} xas_drone_chamber_interval; + +typedef struct _xas_drone_chamber_speech { + size_t drone_index, + speech_line; +} xas_drone_chamber_speech; + +typedef struct _xas_drone_chamber_event { + enum xas_drone_chamber_event_type type; + + union { + xas_drone_chamber_interval interval; + xas_drone_chamber_speech speech; + }; +} xas_drone_chamber_event; + +typedef struct _xas_drone_chamber { + xas_spatial_scene *scene; + xas_drone **drones; + size_t drone_count; + + xas_spatial_object *synth_l, + *synth_r; +} xas_drone_chamber; + +xas_drone *xas_drone_new(xas_spatial_scene *scene, + xas_spatial_coord position, + float speech_speed, + size_t speech_sample_count, + size_t speech_line_count, + const char **speech_lines); + +void xas_drone_destroy(xas_drone *drone); + +xas_spatial_object *xas_drone_get_spatial_object(xas_drone *drone); + +xas_drone_chamber *xas_drone_chamber_new(xas_spatial_scene *scene, + xas_spatial_coord location, + size_t drone_count); + +void xas_drone_chamber_destroy(xas_drone_chamber *chamber); + +void xas_drone_chamber_insert_drone(xas_drone_chamber *chamber, + xas_drone *drone, + size_t index); + +int xas_drone_chamber_event_seq(xas_drone_chamber *chamber, + xas_drone_chamber_event *ev, + xas_seq *seq, + int advance, + struct timeval *now); + +#endif /* _XAS_DRONE_H */ |