From 6f51eca1e3045571ccc68414a922e8b0229111f0 Mon Sep 17 00:00:00 2001 From: reduz Date: Thu, 10 Mar 2022 08:17:38 +0100 Subject: 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. --- servers/audio/audio_effect.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'servers/audio/audio_effect.h') 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, GDNativePtr, 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, _instantiate) + static void _bind_methods(); + public: - virtual Ref instantiate() = 0; + virtual Ref instantiate(); AudioEffect(); }; -- cgit v1.2.3