diff options
author | Bastien Montagne <bastien@blender.org> | 2020-07-03 13:55:50 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-07-03 13:56:21 +0300 |
commit | aab41401f9e911f417039c06a28e948d75cbcdaf (patch) | |
tree | 8240bc9e89782c321c7b43de5b86d3e2e7fadb58 /source/blender/blenkernel/intern/sound.c | |
parent | ae5529c848127b0c87809e17516a1fe283e49a69 (diff) |
Move bSound cache handling during undo to new system.
Diffstat (limited to 'source/blender/blenkernel/intern/sound.c')
-rw-r--r-- | source/blender/blenkernel/intern/sound.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index a293bc55073..18fd8a10cc1 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -112,6 +112,20 @@ static void sound_free_data(ID *id) } } +static void sound_foreach_cache(ID *id, + IDTypeForeachCacheFunctionCallback function_callback, + void *user_data) +{ + bSound *sound = (bSound *)id; + IDCacheKey key = { + .id_session_uuid = id->session_uuid, + .offset_in_ID = offsetof(bSound, waveform), + .cache_v = sound->waveform, + }; + + function_callback(id, &key, &sound->waveform, user_data); +} + IDTypeInfo IDType_ID_SO = { .id_code = ID_SO, .id_filter = FILTER_ID_SO, @@ -128,6 +142,7 @@ IDTypeInfo IDType_ID_SO = { .free_data = sound_free_data, .make_local = NULL, .foreach_id = NULL, + .foreach_cache = sound_foreach_cache, }; #ifdef WITH_AUDASPACE |