Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a bus_renamed AudioServer signal #81641

Merged
merged 1 commit into from
Sep 17, 2023

Conversation

MewPurPur
Copy link
Contributor

@MewPurPur MewPurPur commented Sep 14, 2023

Adds a new signal and uses it to avoid unnecessary rebuilds of the audio bus editor, softening some lag spikes.

A slightly compat-breaking alternative to #81611 that also adds a new feature. The compat-breaking could be called a bugfix, depending on how you want to look at it. See the first few comments of the linked PR.

Copy link
Contributor

@MJacred MJacred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

: )

editor/editor_audio_buses.cpp Outdated Show resolved Hide resolved
@MewPurPur
Copy link
Contributor Author

MewPurPur commented Sep 14, 2023

Funnily, the old docs description is even more overbearing, it suggests any change in the AudioBusLayout is supposed to signal. Including... things like muting, bypassing, solo, volume changes, maybe even effects! I don't know what the signal was truly intended for at this point, so might as well invent a proper meaning now?

Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change makes more sense to me than the alternative (basically because I wrote the original comment in the modified code :P)

PS. We can preserve compatibility by adding another signal (or signals) that would be emitted for all the other activities. So we would avoid using bus_layout_changed entirely.

scene/audio/audio_stream_player.h Outdated Show resolved Hide resolved
scene/audio/audio_stream_player.cpp Outdated Show resolved Hide resolved
scene/3d/audio_stream_player_3d.h Outdated Show resolved Hide resolved
scene/3d/audio_stream_player_3d.cpp Outdated Show resolved Hide resolved
scene/2d/audio_stream_player_2d.h Outdated Show resolved Hide resolved
scene/2d/audio_stream_player_2d.cpp Outdated Show resolved Hide resolved
@MewPurPur
Copy link
Contributor Author

MewPurPur commented Sep 14, 2023

Yup I saw in the blame. Since the signal never did what the documentation describes anyway, I think we can break compatibility here.

Unfortunately, I think that the initial idea was that the "bus layout changed" signal was meant to be for when the active AudioBusLayout changed - but the idea was forgotten over the eons as people interpreted "layout" as its standard meaning - the positioning of things.

I thought the intention of the signal was to alert things that the user-facing part of AudioBusLayout has changed, which does include renaming since buses can be accessed via their names. This is still a valid way to think of it IMO.

So, idk what to do with this, man. I hope I provided the facts and the different possible perspectives here.

p.s. I'll address the code style remarks after we decide what to really do.

@akien-mga akien-mga changed the title Add a bus_renamed AudioServer signal Add a bus_renamed AudioServer signal Sep 14, 2023
Copy link
Member

@reduz reduz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@YuriSizov
Copy link
Contributor

Note on merging: This is one of two alternatives to address the problem, #81611 is the other one. We likely need to pick just one, because they don't really make sense together.

@MJacred
Copy link
Contributor

MJacred commented Sep 15, 2023

This one could be merged into master for 4.2 and the other one into 4.0 and 4.1, no?

@YuriSizov
Copy link
Contributor

@MJacred This is not how we maintain Godot's codebase. Discrepancies like that makes it harder to support several branches at the same time, so the solution must come through all branches, or not come through at all. Unless it's something really really critical, but in this case it's just some lag.

If we want to preserve the compatibility and cherry-pick this fix, there are other options, as I've mentioned.

@akien-mga akien-mga merged commit 04d2aa6 into godotengine:master Sep 17, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@MewPurPur MewPurPur deleted the bus-go-brrrr-2 branch September 17, 2023 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants