diff options
author | MrCdK <contact@mrcdk.com> | 2018-01-22 20:35:33 +0100 |
---|---|---|
committer | MrCdK <contact@mrcdk.com> | 2018-01-22 20:35:33 +0100 |
commit | 8a9f1c2a5d7364016b9c67dc158557607f6de4bd (patch) | |
tree | 2f3c276d5dd6d524f7f58bff2f4cd31e7d01503c /servers/audio/audio_stream.h | |
parent | f4d67433e7ffa2be15966c00e8e9d495bf42f8d0 (diff) | |
download | redot-engine-8a9f1c2a5d7364016b9c67dc158557607f6de4bd.tar.gz |
Expose audio streams get_length()
Diffstat (limited to 'servers/audio/audio_stream.h')
-rw-r--r-- | servers/audio/audio_stream.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/servers/audio/audio_stream.h b/servers/audio/audio_stream.h index a6fb88364f..fda4fc2ccc 100644 --- a/servers/audio/audio_stream.h +++ b/servers/audio/audio_stream.h @@ -50,8 +50,6 @@ public: virtual void seek(float p_time) = 0; virtual void mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) = 0; - - virtual float get_length() const = 0; //if supported, otherwise return 0 }; class AudioStreamPlaybackResampled : public AudioStreamPlayback { @@ -85,9 +83,14 @@ class AudioStream : public Resource { GDCLASS(AudioStream, Resource) OBJ_SAVE_TYPE(AudioStream) //children are all saved as AudioStream, so they can be exchanged +protected: + static void _bind_methods(); + public: virtual Ref<AudioStreamPlayback> instance_playback() = 0; virtual String get_stream_name() const = 0; + + virtual float get_length() const = 0; //if supported, otherwise return 0 }; class AudioStreamPlaybackRandomPitch; @@ -114,6 +117,8 @@ public: virtual Ref<AudioStreamPlayback> instance_playback(); virtual String get_stream_name() const; + virtual float get_length() const; //if supported, otherwise return 0 + AudioStreamRandomPitch(); }; @@ -139,8 +144,6 @@ public: virtual void mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames); - virtual float get_length() const; //if supported, otherwise return 0 - ~AudioStreamPlaybackRandomPitch(); }; |