VSE: Add sound strip retiming support #105072

Merged
Richard Antalik merged 16 commits from iss/blender:retiming-sound-2 into main 2023-04-21 16:53:39 +02:00
5 changed files with 6 additions and 6 deletions
Showing only changes of commit cf00b351a8 - Show all commits

View File

@ -165,10 +165,10 @@ AUD_API void AUD_SequenceEntry_move(AUD_SequenceEntry* entry, double begin, doub
(*entry)->move(begin, end, skip);
}
AUD_API void AUD_SequenceEntry_setAnimationData_constant_range(AUD_SequenceEntry* entry, AUD_AnimateablePropertyType type, int frame_start, int frame_end, float* data)
AUD_API void AUD_SequenceEntry_setConstantRangeAnimationData(AUD_SequenceEntry* entry, AUD_AnimateablePropertyType type, int frame_start, int frame_end, float* data)
{
AnimateableProperty* prop = (*entry)->getAnimProperty(static_cast<AnimateablePropertyType>(type));
iss marked this conversation as resolved Outdated

Audaspace has its own coding style as you surely noticed, since you're following most of it. Please make sure that indentation happens with tabs everywhere. I just recently introduced a clang-format file in upstream that you can find here: https://github.com/audaspace/audaspace/blob/master/.clang-format. Please only apply it to the changes though, since not all of audaspace is following it perfectly and I wouldn't want to make this patch verbose because of it (see the clang-format-diff script or https://offlinemark.com/2021/04/02/surgical-formatting-with-git-clang-format/ for example).

While we're at it: I would appreciate if you also create a pull request for the audaspace changes upstream (https://github.com/audaspace/audaspace/pulls)!

Audaspace has its own coding style as you surely noticed, since you're following most of it. Please make sure that indentation happens with tabs everywhere. I just recently introduced a clang-format file in upstream that you can find here: https://github.com/audaspace/audaspace/blob/master/.clang-format. Please only apply it to the changes though, since not all of audaspace is following it perfectly and I wouldn't want to make this patch verbose because of it (see the clang-format-diff script or https://offlinemark.com/2021/04/02/surgical-formatting-with-git-clang-format/ for example). While we're at it: I would appreciate if you also create a pull request for the audaspace changes upstream (https://github.com/audaspace/audaspace/pulls)!
prop->write_constant_range(data, frame_start, frame_end);
prop->writeConstantRange(data, frame_start, frame_end);
}
AUD_API void AUD_SequenceEntry_setAnimationData(AUD_SequenceEntry* entry, AUD_AnimateablePropertyType type, int frame, float* data, char animated)

View File

@ -72,7 +72,7 @@ extern AUD_API void AUD_Sequence_remove(AUD_Sound* sequence, AUD_SequenceEntry*
* \param frame_end End of the frame range.
* \param data The data to write.
*/
AUD_API void AUD_SequenceEntry_setAnimationData_constant_range(AUD_SequenceEntry* entry, AUD_AnimateablePropertyType type, int frame_start, int frame_end, float* data);
AUD_API void AUD_SequenceEntry_setConstantRangeAnimationData(AUD_SequenceEntry* entry, AUD_AnimateablePropertyType type, int frame_start, int frame_end, float* data);
neXyon marked this conversation as resolved Outdated

AUD_SequenceEntry_setConstantRangeAnimationData

`AUD_SequenceEntry_setConstantRangeAnimationData`
/**
* Writes animation data to a sequenced entry.

View File

@ -118,7 +118,7 @@ public:
* \param position_start The start position in the animation in frames.
* \param position_end The end position in the animation in frames.
*/
void write_constant_range(const float* data, int position_start, int position_end);
void writeConstantRange(const float* data, int position_start, int position_end);
iss marked this conversation as resolved Outdated

Please rename write_range similarly to the other API functions that call it, so that its also clear from the name that it writes the same data into the range and doesn't get the full data for the range in the parameters. I.e. it repeats the data found in the parameter rather than expecting a bigger block of data that may differ all the way from start to end.

Please rename `write_range` similarly to the other API functions that call it, so that its also clear from the name that it writes the same data into the range and doesn't get the full data for the range in the parameters. I.e. it repeats the data found in the parameter rather than expecting a bigger block of data that may differ all the way from start to end.

writeConstantRange

`writeConstantRange`
/**
* Reads the properties value.

View File

@ -65,7 +65,7 @@ void AnimateableProperty::write(const float* data)
std::memcpy(getBuffer(), data, m_count * sizeof(float));
}
void AnimateableProperty::write_constant_range(const float* data, int position_start, int position_end)
void AnimateableProperty::writeConstantRange(const float* data, int position_start, int position_end)
{
assureSize(position_end * m_count * sizeof(float), true);
float* buf = getBuffer();

View File

@ -824,7 +824,7 @@ void BKE_sound_set_scene_sound_pitch_constant_range(void *handle,
int frame_end,
float pitch)
{
AUD_SequenceEntry_setAnimationData_constant_range(
AUD_SequenceEntry_setConstantRangeAnimationData(
handle, AUD_AP_PITCH, frame_start, frame_end, &pitch);
}