diff options
Diffstat (limited to 'include/xas')
-rw-r--r-- | include/xas/script.h | 95 | ||||
-rw-r--r-- | include/xas/seq.h | 95 |
2 files changed, 95 insertions, 95 deletions
diff --git a/include/xas/script.h b/include/xas/script.h deleted file mode 100644 index ff07b49..0000000 --- a/include/xas/script.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef _XAS_SCRIPT_H -#define _XAS_SCRIPT_H - -#include <sys/types.h> -#include <sys/time.h> - -#include <xas/audio.h> -#include <xas/spatial.h> - -enum xas_script_event_type { - XAS_SCRIPT_EVENT_OFF, - XAS_SCRIPT_EVENT_ON, - XAS_SCRIPT_EVENT_SET_POSITION, - XAS_SCRIPT_EVENT_SET_GAIN, - XAS_SCRIPT_EVENT_SET_FREQUENCY, - XAS_SCRIPT_EVENT_SET_BANK_INDEX, - XAS_SCRIPT_EVENT_SPEECH -}; - -enum xas_script_object_type { - XAS_SCRIPT_OBJECT_ANY, - XAS_SCRIPT_OBJECT_SYNTH, - XAS_SCRIPT_OBJECT_VOX, - XAS_SCRIPT_OBJECT_BANK_PLAYER -}; - -typedef struct _xas_script_event xas_script_event; - -struct _xas_script_event { - enum xas_script_event_type type; - enum xas_script_object_type objtype; - - xas_spatial_object *object; - - struct timeval timestamp; - - union { - float gain; - xas_spatial_coord point; - size_t index; - size_t frequency; - const char *phrase; - }; - - xas_script_event *next; -}; - -typedef struct _xas_script { - xas_spatial_scene *scene; - - xas_script_event *first; - - size_t buffer_size; -} xas_script; - -xas_script *xas_script_new(xas_spatial_scene *scene, size_t buffer_size); - -void xas_script_destroy(xas_script *script); - -int xas_script_add_event_off(xas_script *script, - xas_spatial_object *object, - struct timeval timestamp); - -int xas_script_add_event_on(xas_script *script, - xas_spatial_object *object, - struct timeval timestamp); - -int xas_script_add_set_position(xas_script *script, - xas_spatial_object *object, - struct timeval timestamp, - xas_spatial_coord point); - -int xas_script_add_set_gain(xas_script *script, - xas_spatial_object *object, - struct timeval timestamp, - float gain); - -int xas_script_add_set_bank(xas_script *script, - xas_spatial_object *object, - struct timeval timestamp, - size_t index); - -int xas_script_add_set_frequency(xas_script *script, - xas_spatial_object *object, - struct timeval timestamp, - size_t frequency); - -int xas_script_add_phrase(xas_script *script, - xas_spatial_object *object, - struct timeval timestamp, - const char *phrase); - -int xas_script_play(xas_script *script, xas_audio_stream *sink); - -#endif /* _XAS_SCRIPT_H */ diff --git a/include/xas/seq.h b/include/xas/seq.h new file mode 100644 index 0000000..74b198f --- /dev/null +++ b/include/xas/seq.h @@ -0,0 +1,95 @@ +#ifndef _XAS_SEQ_H +#define _XAS_SEQ_H + +#include <sys/types.h> +#include <sys/time.h> + +#include <xas/audio.h> +#include <xas/spatial.h> + +enum xas_seq_event_type { + XAS_SEQ_EVENT_OFF, + XAS_SEQ_EVENT_ON, + XAS_SEQ_EVENT_SET_POSITION, + XAS_SEQ_EVENT_SET_GAIN, + XAS_SEQ_EVENT_SET_FREQUENCY, + XAS_SEQ_EVENT_SET_BANK_INDEX, + XAS_SEQ_EVENT_SPEECH +}; + +enum xas_seq_object_type { + XAS_SEQ_OBJECT_ANY, + XAS_SEQ_OBJECT_SYNTH, + XAS_SEQ_OBJECT_VOX, + XAS_SEQ_OBJECT_BANK_PLAYER +}; + +typedef struct _xas_seq_event xas_seq_event; + +struct _xas_seq_event { + enum xas_seq_event_type type; + enum xas_seq_object_type objtype; + + xas_spatial_object *object; + + struct timeval timestamp; + + union { + float gain; + xas_spatial_coord point; + size_t index; + size_t frequency; + const char *phrase; + }; + + xas_seq_event *next; +}; + +typedef struct _xas_seq { + xas_spatial_scene *scene; + + xas_seq_event *first; + + size_t buffer_size; +} xas_seq; + +xas_seq *xas_seq_new(xas_spatial_scene *scene, size_t buffer_size); + +void xas_seq_destroy(xas_seq *seq); + +int xas_seq_add_event_off(xas_seq *seq, + xas_spatial_object *object, + struct timeval timestamp); + +int xas_seq_add_event_on(xas_seq *seq, + xas_spatial_object *object, + struct timeval timestamp); + +int xas_seq_add_set_position(xas_seq *seq, + xas_spatial_object *object, + struct timeval timestamp, + xas_spatial_coord point); + +int xas_seq_add_set_gain(xas_seq *seq, + xas_spatial_object *object, + struct timeval timestamp, + float gain); + +int xas_seq_add_set_bank(xas_seq *seq, + xas_spatial_object *object, + struct timeval timestamp, + size_t index); + +int xas_seq_add_set_frequency(xas_seq *seq, + xas_spatial_object *object, + struct timeval timestamp, + size_t frequency); + +int xas_seq_add_phrase(xas_seq *seq, + xas_spatial_object *object, + struct timeval timestamp, + const char *phrase); + +int xas_seq_play(xas_seq *seq, xas_audio_stream *sink); + +#endif /* _XAS_SEQ_H */ |