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 missing documentation for AudioStream & AudioStreamPlayback #86958

Conversation

Mickeon
Copy link
Contributor

@Mickeon Mickeon commented Jan 8, 2024

Related to #86927

This PR completes the documentation of AudioServer, AudioStream and AudioStreamPlayback, filling all of the undocumented methods.
The existing descriptions where mostly left untouched even though they're quite poor.

Some doubts are still there, but it's still way better than leaving them as the "mystery meat" methods. Actually writing for them has you realise how flawed some of these are.

@Mickeon Mickeon requested a review from a team as a code owner January 8, 2024 10:30
@Mickeon Mickeon force-pushed the reduz-adds-stuff,-refuses-to-elaborate,-leaves branch from aa0adcb to 9c39945 Compare January 8, 2024 10:38
@AThousandShips AThousandShips added this to the 4.3 milestone Jan 8, 2024
@AThousandShips AThousandShips added cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release labels Jan 8, 2024
Copy link
Contributor

@RedMser RedMser left a comment

Choose a reason for hiding this comment

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

From a quick look into AudioServer::_mix_step there were some things that did not seem right to me.

doc/classes/AudioStreamPlayback.xml Outdated Show resolved Hide resolved
doc/classes/AudioStreamPlayback.xml Outdated Show resolved Hide resolved
@Mickeon Mickeon force-pushed the reduz-adds-stuff,-refuses-to-elaborate,-leaves branch from 9c39945 to 3edfb7d Compare January 8, 2024 16:10
@Mickeon
Copy link
Contributor Author

Mickeon commented Jan 8, 2024

Updated this PR to address the above, and filled the descriptions of both _tag_used_streams and set_enable_tagging_used_audio_streams based on further insight https://chat.godotengine.org/channel/audio?msg=nh7hTna84fNH7vcPJ

@@ -16,31 +16,39 @@
<method name="_get_beat_count" qualifiers="virtual const">
<return type="int" />
<description>
Should return the total number of beats of this audio stream. Used by the engine to determine the position of every beat.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should always explicitly tell the user that virtual methods need to be implemented by them. Without this clarification a description starting with "Should return" looks concerning, as if we don't know exactly if this method returns what we think it returns.

Same below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The usual "Override this method to[...]" cannot really work here otherwise it would be too verbose.

I would introduce them with "Overridable method." personally. I don't like to say "Virtual method to be implemented by the user" because it feels very redundant, but that's obviously just an opinion. virtual is right there, you can see what it does, and all virtual methods begin with an underscore. Users should be used by this, especially if they're trying to make their own audio streams.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about the verbosity argument. It's better if the description is explicit, and a bit of redundancy is okay when we don't know where the user will start reading. Use "Overridable method." if you want, that's better than nothing.

@Mickeon Mickeon force-pushed the reduz-adds-stuff,-refuses-to-elaborate,-leaves branch from 3edfb7d to 8f4598b Compare January 23, 2024 14:38
@Mickeon
Copy link
Contributor Author

Mickeon commented Jan 23, 2024

Updated the PR to add "Overridable method" or similar to the methods that don't explicitly start with "Override" or similar.

@akien-mga akien-mga merged commit 5ae4faf into godotengine:master Feb 13, 2024
16 checks passed
@Mickeon Mickeon deleted the reduz-adds-stuff,-refuses-to-elaborate,-leaves branch February 13, 2024 16:30
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 4.2.2.
Cherry-picked for 4.1.4.

@akien-mga akien-mga removed cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release labels Mar 11, 2024
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.

5 participants