summaryrefslogtreecommitdiffstats
path: root/modules/minimp3/audio_stream_mp3.h
diff options
context:
space:
mode:
authorAdam Scott <ascott.ca@gmail.com>2024-04-18 10:50:34 -0400
committerAdam Scott <ascott.ca@gmail.com>2024-06-18 11:06:31 -0400
commit52fa4f05f3945fdf511c249adede9b6d07c51beb (patch)
tree2ac2aca86c09dd757fd4a8b5defab932f2b8eb5d /modules/minimp3/audio_stream_mp3.h
parenteb20a68b323c1fcb75492f8132e1bd6d321713ec (diff)
downloadredot-engine-52fa4f05f3945fdf511c249adede9b6d07c51beb.tar.gz
Add samples playback support
Diffstat (limited to 'modules/minimp3/audio_stream_mp3.h')
-rw-r--r--modules/minimp3/audio_stream_mp3.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/minimp3/audio_stream_mp3.h b/modules/minimp3/audio_stream_mp3.h
index 7d85e0a321..81e8f8633c 100644
--- a/modules/minimp3/audio_stream_mp3.h
+++ b/modules/minimp3/audio_stream_mp3.h
@@ -58,6 +58,9 @@ class AudioStreamPlaybackMP3 : public AudioStreamPlaybackResampled {
Ref<AudioStreamMP3> mp3_stream;
+ bool _is_sample = false;
+ Ref<AudioSamplePlayback> sample_playback;
+
protected:
virtual int _mix_internal(AudioFrame *p_buffer, int p_frames) override;
virtual float get_stream_sampling_rate() override;
@@ -74,6 +77,11 @@ public:
virtual void tag_used_streams() override;
+ virtual void set_is_sample(bool p_is_sample) override;
+ virtual bool get_is_sample() const override;
+ virtual Ref<AudioSamplePlayback> get_sample_playback() const override;
+ virtual void set_sample_playback(const Ref<AudioSamplePlayback> &p_playback) override;
+
virtual void set_parameter(const StringName &p_name, const Variant &p_value) override;
virtual Variant get_parameter(const StringName &p_name) const override;
@@ -131,6 +139,11 @@ public:
virtual bool is_monophonic() const override;
+ virtual bool can_be_sampled() const override {
+ return true;
+ }
+ virtual Ref<AudioSample> generate_sample() const override;
+
virtual void get_parameter_list(List<Parameter> *r_parameters) override;
AudioStreamMP3();