diff options
author | XANTRONIX Development | 2022-03-01 01:49:43 -0500 |
---|---|---|
committer | XANTRONIX Development | 2022-03-01 01:49:43 -0500 |
commit | 91a00438028c9e48d0fffbcc838fe038cc18d7e0 (patch) | |
tree | 2769ce2cc264824024c8fa8e603881dc2dac44a7 /src | |
parent | 6667ece6e0cec1a515f076f310295a5e691c24c3 (diff) | |
download | xas-91a00438028c9e48d0fffbcc838fe038cc18d7e0.tar.gz xas-91a00438028c9e48d0fffbcc838fe038cc18d7e0.tar.bz2 xas-91a00438028c9e48d0fffbcc838fe038cc18d7e0.zip |
Destroy managed spatial scene objects
Diffstat (limited to 'src')
-rw-r--r-- | src/bank.c | 1 | ||||
-rw-r--r-- | src/spatial.c | 5 | ||||
-rw-r--r-- | src/synth.c | 1 | ||||
-rw-r--r-- | src/vox.c | 1 |
4 files changed, 8 insertions, 0 deletions
@@ -135,6 +135,7 @@ xas_bank_player *xas_bank_player_new(xas_bank *bank) { player->obj.stop = (xas_object_stop_callback)xas_bank_player_stop; player->obj.set_gain = (xas_object_set_gain_callback)set_gain; player->obj.stream_new = (xas_object_stream_new_callback)xas_bank_player_stream_new; + player->obj.destroy = (xas_object_destroy_callback)xas_bank_player_destroy; player->bank = bank; player->status = XAS_BANK_PLAYER_STOPPED; diff --git a/src/spatial.c b/src/spatial.c index 63207fa..9631603 100644 --- a/src/spatial.c +++ b/src/spatial.c @@ -311,6 +311,10 @@ void xas_spatial_scene_destroy(xas_spatial_scene *scene) { while (object) { xas_spatial_object *next = object->next; + if (object->flags & XAS_SPATIAL_OBJECT_MANAGED) { + xas_object_destroy(object->ctx); + } + free(object); object = next; @@ -398,6 +402,7 @@ xas_spatial_object *xas_spatial_scene_add_object(xas_spatial_scene *scene, object->point = point; object->source = source; object->ctx = ctx; + object->flags = XAS_SPATIAL_OBJECT_NONE; object->next = NULL; object->delta_l = 0; object->delta_r = 0; diff --git a/src/synth.c b/src/synth.c index 4956621..6057ce3 100644 --- a/src/synth.c +++ b/src/synth.c @@ -130,6 +130,7 @@ xas_synth *xas_synth_new(xas_audio_format format, synth->obj.stop = (xas_object_stop_callback)synth_stop; synth->obj.set_gain = (xas_object_set_gain_callback)set_gain; synth->obj.stream_new = (xas_object_stream_new_callback)xas_synth_stream_new; + synth->obj.destroy = (xas_object_destroy_callback)xas_synth_destroy; synth->type = type; synth->state = XAS_SYNTH_IDLE; @@ -293,6 +293,7 @@ xas_vox *xas_vox_new_args(xas_audio_format format, vox->obj.stop = (xas_object_stop_callback)xas_vox_stop; vox->obj.set_gain = (xas_object_set_gain_callback)set_gain; vox->obj.stream_new = (xas_object_stream_new_callback)xas_vox_stream_new; + vox->obj.destroy = (xas_object_destroy_callback)xas_vox_destroy; vox->text2wave_path = text2wave_path; |