summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Makefile6
-rw-r--r--src/spatial.c24
2 files changed, 22 insertions, 8 deletions
diff --git a/src/Makefile b/src/Makefile
index e8bf54d..ce60d40 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -7,9 +7,11 @@ CC = $(CROSS)cc
CFLAGS += -I$(INCLUDE_PATH)
LDFLAGS +=
-HEADERS = audio.h riff.h mixer.h synth.h vox.h bank.h spatial.h script.h
+HEADERS = audio.h riff.h mixer.h object.h synth.h vox.h bank.h \
+ spatial.h script.h
-OBJS = audio.o riff.o mixer.o synth.o vox.o bank.o spatial.o script.o
+OBJS = audio.o riff.o mixer.o object.o synth.o vox.o bank.o \
+ spatial.o script.o
VERSION_MAJOR = 0
VERSION_MINOR = 0.1
diff --git a/src/spatial.c b/src/spatial.c
index 9399369..da89ad3 100644
--- a/src/spatial.c
+++ b/src/spatial.c
@@ -346,14 +346,9 @@ static void object_position(xas_spatial_scene *scene,
object->shift_r = object->delta_r - delta_r_old;
}
-void xas_spatial_scene_set_speaker_coords(xas_spatial_scene *scene,
- xas_spatial_coord speaker_l,
- xas_spatial_coord speaker_r) {
+static void object_update_deltas(xas_spatial_scene *scene) {
xas_spatial_object *obj = scene->first;
- scene->speaker_l = speaker_l;
- scene->speaker_r = speaker_r;
-
while (obj) {
xas_spatial_object *next = obj->next;
@@ -363,6 +358,15 @@ void xas_spatial_scene_set_speaker_coords(xas_spatial_scene *scene,
}
}
+void xas_spatial_scene_set_speaker_coords(xas_spatial_scene *scene,
+ xas_spatial_coord speaker_l,
+ xas_spatial_coord speaker_r) {
+ scene->speaker_l = speaker_l;
+ scene->speaker_r = speaker_r;
+
+ object_update_deltas(scene);
+}
+
int xas_spatial_scene_set_speed(xas_spatial_scene *scene, float speed) {
scene->speed = speed;
@@ -417,6 +421,14 @@ error_invalid_source:
return NULL;
}
+void xas_spatial_scene_position_object(xas_spatial_scene *scene,
+ xas_spatial_object *object,
+ xas_spatial_coord point) {
+ object->point = point;
+
+ object_update_deltas(scene);
+}
+
void xas_spatial_object_get_point(xas_spatial_object *object,
xas_spatial_coord *point) {
point->x = object->point.x;