I’ve been extending some functionalities in the FMOD plugin for UE4 for my own purposes and noticed a few things that confused me a little bit. I’d like to ask about some of them and also suggest a few small mistakes I noticed in the code.
I’d like to point out that I’m using UE4.27 implementation with 2.02.07 version of FMOD, so there’s a chance my concerns might be outdated, but they might not.
- Why is UFMODAudioComponent::SetParameter method without bool bIgnoreSeekSpeed in the argument list by default? I find it weird, because having IgnoreSeekSpeed, even in Blueprint, is very useful.
BTW, declaring SetParameter(FName Name, float Value, bool bIgnoreSeekSpeed = false) will be compatible with previous usage of SetParameter and won’t require developers to change anything in their implementation.
- Possible overlook: In UFMODAudioComponent::EndPlay(const EEndPlayReason::Type EndPlayReason) there’s no Super::EndPlay().
- Possible overlook: In FMODBlueprintStatics.h line #include “Kismet/BlueprintFunctionLibrary.h” is doubled.
- Possible overlook: In FMODBlueprintStatics.h you don’t need “class” in static class UFMODAudioComponent* PlayEventAttached method, because UFMODAudioComponent is already forward declared below the include paths.
- Have you thought about assigning variables to their default value in the class declarations? Like assigning nullptr to the pointers and, for example, zeros to floats or doubles etc. My friend, who is much better programmer than me, said that leaving those variables without default values in declaration or even constructor is a mistake and might be a cause of some problems.
Looking forward to your answer!