summaryrefslogtreecommitdiffstats
path: root/src/spatial.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/spatial.c')
-rw-r--r--src/spatial.c24
1 files changed, 18 insertions, 6 deletions
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;