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:
authorJulian Eisel <julian@blender.org>2022-06-30 19:36:42 +0300
committerJulian Eisel <julian@blender.org>2022-06-30 19:38:44 +0300
commit65166e145b4d6292abc289b71894c53b25c186ba (patch)
tree707513038d00a964d7a400ac8e7e22251fffb02d /source/blender/blenkernel/intern/sound.c
parent66de653784ab06ccea46413de6b2f086b5a69d30 (diff)
Cleanup: Remove scene frame macros (`CFRA` et al.)
Removes the following macros for scene/render frame values: - `CFRA` - `SUBFRA` - `SFRA` - `EFRA` These macros don't add much, other than saving a few characters when typing. It's not immediately clear what they refer to, they just hide what they actually access. Just be explicit and clear about that. Plus these macros gave read and write access to the variables, so eyesores like this would be done (eyesore because it looks like assigning to a constant): ``` CFRA = some_frame_nbr; ``` Reviewed By: sergey Differential Revision: https://developer.blender.org/D15311
Diffstat (limited to 'source/blender/blenkernel/intern/sound.c')
-rw-r--r--source/blender/blenkernel/intern/sound.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 343a829cf76..f459b5a82ac 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -804,7 +804,7 @@ void BKE_sound_set_scene_volume(Scene *scene, float volume)
}
AUD_Sequence_setAnimationData(scene->sound_scene,
AUD_AP_VOLUME,
- CFRA,
+ scene->r.cfra,
&volume,
(scene->audio.flag & AUDIO_VOLUME_ANIMATED) != 0);
}
@@ -855,7 +855,7 @@ static double get_cur_time(Scene *scene)
/* We divide by the current framelen to take into account time remapping.
* Otherwise we will get the wrong starting time which will break A/V sync.
* See T74111 for further details. */
- return FRA2TIME((CFRA + SUBFRA) / (double)scene->r.framelen);
+ return FRA2TIME((scene->r.cfra + scene->r.subframe) / (double)scene->r.framelen);
}
void BKE_sound_play_scene(Scene *scene)
@@ -911,7 +911,7 @@ void BKE_sound_seek_scene(Main *bmain, Scene *scene)
int animation_playing;
const double one_frame = 1.0 / FPS;
- const double cur_time = FRA2TIME(CFRA);
+ const double cur_time = FRA2TIME(scene->r.cfra);
AUD_Device_lock(sound_device);
@@ -1131,13 +1131,13 @@ static void sound_update_base(Scene *scene, Object *object, void *new_set)
mat4_to_quat(quat, object->obmat);
AUD_SequenceEntry_setAnimationData(
- strip->speaker_handle, AUD_AP_LOCATION, CFRA, object->obmat[3], 1);
+ strip->speaker_handle, AUD_AP_LOCATION, scene->r.cfra, object->obmat[3], 1);
AUD_SequenceEntry_setAnimationData(
- strip->speaker_handle, AUD_AP_ORIENTATION, CFRA, quat, 1);
+ strip->speaker_handle, AUD_AP_ORIENTATION, scene->r.cfra, quat, 1);
AUD_SequenceEntry_setAnimationData(
- strip->speaker_handle, AUD_AP_VOLUME, CFRA, &speaker->volume, 1);
+ strip->speaker_handle, AUD_AP_VOLUME, scene->r.cfra, &speaker->volume, 1);
AUD_SequenceEntry_setAnimationData(
- strip->speaker_handle, AUD_AP_PITCH, CFRA, &speaker->pitch, 1);
+ strip->speaker_handle, AUD_AP_PITCH, scene->r.cfra, &speaker->pitch, 1);
AUD_SequenceEntry_setSound(strip->speaker_handle, speaker->sound->playback_handle);
AUD_SequenceEntry_setMuted(strip->speaker_handle, mute);
}
@@ -1172,8 +1172,8 @@ void BKE_sound_update_scene(Depsgraph *depsgraph, Scene *scene)
if (scene->camera) {
mat4_to_quat(quat, scene->camera->obmat);
AUD_Sequence_setAnimationData(
- scene->sound_scene, AUD_AP_LOCATION, CFRA, scene->camera->obmat[3], 1);
- AUD_Sequence_setAnimationData(scene->sound_scene, AUD_AP_ORIENTATION, CFRA, quat, 1);
+ scene->sound_scene, AUD_AP_LOCATION, scene->r.cfra, scene->camera->obmat[3], 1);
+ AUD_Sequence_setAnimationData(scene->sound_scene, AUD_AP_ORIENTATION, scene->r.cfra, quat, 1);
}
AUD_destroySet(scene->speaker_handles);