diff options
author | reduz <reduzio@gmail.com> | 2022-03-10 08:17:38 +0100 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2022-03-10 12:28:11 +0100 |
commit | 6f51eca1e3045571ccc68414a922e8b0229111f0 (patch) | |
tree | 8aee693d8f1972009c5788f34fcebfd6c681e9e1 /servers/audio/audio_effect.h | |
parent | 741bbb9d7c95dfd810c113ca935a8f16238b5334 (diff) | |
download | redot-engine-6f51eca1e3045571ccc68414a922e8b0229111f0.tar.gz |
Discern between virtual and abstract class bindings
* Previous "virtual" classes (which can't be instantiated) are not corretly named "abstract".
* Added a new "virtual" category for classes, they can't be instantiated from the editor, but can be inherited from script and extensions.
* Converted a large amount of classes from "abstract" to "virtual" where it makes sense.
Most classes that make sense have been converted. Missing:
* Physics servers
* VideoStream
* Script* classes.
which will go in a separate PR due to the complexity involved.
Diffstat (limited to 'servers/audio/audio_effect.h')
-rw-r--r-- | servers/audio/audio_effect.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/servers/audio/audio_effect.h b/servers/audio/audio_effect.h index 00a5d6c004..3a0578679d 100644 --- a/servers/audio/audio_effect.h +++ b/servers/audio/audio_effect.h @@ -33,20 +33,32 @@ #include "core/io/resource.h" #include "core/math/audio_frame.h" +#include "core/object/gdvirtual.gen.inc" +#include "core/object/script_language.h" +#include "core/variant/native_ptr.h" class AudioEffectInstance : public RefCounted { GDCLASS(AudioEffectInstance, RefCounted); +protected: + GDVIRTUAL3(_process, GDNativeConstPtr<AudioFrame>, GDNativePtr<AudioFrame>, int) + GDVIRTUAL0RC(bool, _process_silence) + static void _bind_methods(); + public: - virtual void process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) = 0; - virtual bool process_silence() const { return false; } + virtual void process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count); + virtual bool process_silence() const; }; class AudioEffect : public Resource { GDCLASS(AudioEffect, Resource); +protected: + GDVIRTUAL0R(Ref<AudioEffectInstance>, _instantiate) + static void _bind_methods(); + public: - virtual Ref<AudioEffectInstance> instantiate() = 0; + virtual Ref<AudioEffectInstance> instantiate(); AudioEffect(); }; |