summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-02-23 13:04:47 +0100
committerGitHub <noreply@github.com>2022-02-23 13:04:47 +0100
commit96261838c531433b710fed29dd42b008be34b675 (patch)
treee500e9aa3f0b2190ce25e407a451d2546bab5f7e
parent95783f7bfc78ad779b05ed435b981e90e87e3527 (diff)
parentded9dc1e825f1b050c95afa6be786723420e1a2b (diff)
Merge pull request #57956 from Eoin-ONeill-Yokai/audio_stream_hotfix
-rw-r--r--doc/classes/AudioStream.xml6
-rw-r--r--servers/audio/audio_stream.cpp1
2 files changed, 7 insertions, 0 deletions
diff --git a/doc/classes/AudioStream.xml b/doc/classes/AudioStream.xml
index 1e6f700c7c..6343da6eed 100644
--- a/doc/classes/AudioStream.xml
+++ b/doc/classes/AudioStream.xml
@@ -39,6 +39,12 @@
Returns the length of the audio stream in seconds.
</description>
</method>
+ <method name="instance_playback">
+ <return type="AudioStreamPlayback" />
+ <description>
+ Returns an AudioStreamPlayback. Useful for when you want to extend `_instance_playback` but call `instance_playback` from an internally held AudioStream subresource. An example of this can be found in the source files for `AudioStreamRandomPitch::instance_playback`.
+ </description>
+ </method>
<method name="is_monophonic" qualifiers="const">
<return type="bool" />
<description>
diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp
index 39060286a4..a710658bff 100644
--- a/servers/audio/audio_stream.cpp
+++ b/servers/audio/audio_stream.cpp
@@ -200,6 +200,7 @@ bool AudioStream::is_monophonic() const {
void AudioStream::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_length"), &AudioStream::get_length);
ClassDB::bind_method(D_METHOD("is_monophonic"), &AudioStream::is_monophonic);
+ ClassDB::bind_method(D_METHOD("instance_playback"), &AudioStream::instance_playback);
GDVIRTUAL_BIND(_instance_playback);
GDVIRTUAL_BIND(_get_stream_name);
GDVIRTUAL_BIND(_get_length);