diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-01 16:12:38 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-03 16:50:40 +0300 |
commit | d02da8de23b1d5f64695d3e7e91384d5e2f24e4c (patch) | |
tree | be0dbaad0ab75d068b5384e19096e7abd1bc8df4 /source/blender/blenkernel/intern/sound.c | |
parent | 3369b8289167ddf3dbca0e3895d598bf73534124 (diff) |
Sound: Delay opening handlers for until really needed
Needs to be done in order to localize sound handlers to the evaluated
IDs only. This commit might not be fully optimal, since it does more
things on every scene update request, but that will be solved by the
upcoming change which will put those updates to a dependency graph.
Diffstat (limited to 'source/blender/blenkernel/intern/sound.c')
-rw-r--r-- | source/blender/blenkernel/intern/sound.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index c97baf8f7dd..3b46677828d 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -463,8 +463,6 @@ void BKE_sound_load(Main *bmain, bSound *sound) else { sound->playback_handle = sound->handle; } - - BKE_sound_update_sequencer(bmain, sound); } } @@ -1155,3 +1153,33 @@ char **BKE_sound_get_device_names(void) } #endif /* WITH_AUDASPACE */ + +void BKE_sound_reset_scene_pointers(Scene *scene) +{ + scene->sound_scene = NULL; + scene->playback_handle = NULL; + scene->sound_scrub_handle = NULL; + scene->speaker_handles = NULL; +} + +void BKE_sound_ensure_scene(struct Scene *scene) +{ + if (scene->sound_scene != NULL) { + return; + } + BKE_sound_create_scene(scene); +} + +void BKE_sound_reset_pointers(bSound *sound) +{ + sound->cache = NULL; + sound->playback_handle = NULL; +} + +void BKE_sound_ensure_loaded(Main *bmain, bSound *sound) +{ + if (sound->cache != NULL) { + return; + } + BKE_sound_load(bmain, sound); +} |