Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-07-03 13:55:50 +0300
committerBastien Montagne <bastien@blender.org>2020-07-03 13:56:21 +0300
commitaab41401f9e911f417039c06a28e948d75cbcdaf (patch)
tree8240bc9e89782c321c7b43de5b86d3e2e7fadb58 /source/blender/blenkernel/intern/sound.c
parentae5529c848127b0c87809e17516a1fe283e49a69 (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.c15
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