#ifndef _XAS_SEQ_H #define _XAS_SEQ_H #include #include #include #include #include enum xas_seq_event_type { XAS_SEQ_EVENT_SET_POSITION, XAS_SEQ_EVENT_SET_HEADING, XAS_SEQ_EVENT_SET_SPEED, XAS_SEQ_EVENT_SET_GAIN, XAS_SEQ_EVENT_SET_FREQUENCY, XAS_SEQ_EVENT_SET_SYNTH_TYPE, XAS_SEQ_EVENT_SET_BANK_INDEX, XAS_SEQ_EVENT_SET_PLAYER_FLAGS, XAS_SEQ_EVENT_SPEECH, XAS_SEQ_EVENT_OFF, XAS_SEQ_EVENT_ON, XAS_SEQ_EVENT_STOP }; typedef struct _xas_seq_event xas_seq_event; struct _xas_seq_event { enum xas_seq_event_type type; xas_spatial_object *object; struct timeval timestamp; union { xas_spatial_coord point; xas_spatial_coord heading; float speed; float gain; int flags; size_t index; size_t frequency; enum xas_synth_type synth_type; const char *phrase; }; xas_seq_event *next; }; typedef struct _xas_seq { xas_spatial_scene *scene; xas_seq_event *first, *last; 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, size_t index); int xas_seq_add_event_on(xas_seq *seq, xas_spatial_object *object, struct timeval timestamp, size_t index); 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_heading(xas_seq *seq, xas_spatial_object *object, struct timeval timestamp, xas_spatial_coord heading); int xas_seq_add_set_speed(xas_seq *seq, xas_spatial_object *object, struct timeval timestamp, float speed); 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_player_flags(xas_seq *seq, xas_spatial_object *object, struct timeval timestamp, int flags); int xas_seq_add_set_synth_type(xas_seq *seq, xas_spatial_object *object, struct timeval timestamp, enum xas_synth_type type); 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_add_stop(xas_seq *seq, struct timeval timestamp); int xas_seq_play(xas_seq *seq, xas_audio_stream *sink); #endif /* _XAS_SEQ_H */