Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It had previously leftovers from the implementation in Godot 3.x (all events, not only oneshots were managed by the server) so I got rid of them.
A oneshot is actually not something up to the Godot user to decide, it's a property of the Fmod event itself, I removed its setter from the FmodEmitter node.
On top of that, only oneshot events can now be used as such. If not, a warning will be thrown. The reason for this is that one shot events can actually end (unlike the ones designed to loop), otherwise they would continue playing forever without any way to stop them.
The methods to play a one shot won't ask for a Node if not attached.
Because emitters can no longer be set as oneshot, I replaced it with an auto release feature. When the event is done playing, the node will automatically free itself. This way, you can instantiate a scene containing a node with autoplay + autorelease to emulate oneshots.
When it comes to the implementation, I decided to simplify a bit. I removed a bunch of methods called "internal" as they were used only once and remove template parameters that were always the same.