summaryrefslogtreecommitdiffstats
path: root/servers/audio/audio_effect.cpp
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2022-03-10 08:17:38 +0100
committerreduz <reduzio@gmail.com>2022-03-10 12:28:11 +0100
commit6f51eca1e3045571ccc68414a922e8b0229111f0 (patch)
tree8aee693d8f1972009c5788f34fcebfd6c681e9e1 /servers/audio/audio_effect.cpp
parent741bbb9d7c95dfd810c113ca935a8f16238b5334 (diff)
downloadredot-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.cpp')
-rw-r--r--servers/audio/audio_effect.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/servers/audio/audio_effect.cpp b/servers/audio/audio_effect.cpp
index b9eca14a4c..f38d0adfb2 100644
--- a/servers/audio/audio_effect.cpp
+++ b/servers/audio/audio_effect.cpp
@@ -30,5 +30,36 @@
#include "audio_effect.h"
+void AudioEffectInstance::process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) {
+ if (GDVIRTUAL_REQUIRED_CALL(_process, p_src_frames, p_dst_frames, p_frame_count)) {
+ return;
+ }
+}
+bool AudioEffectInstance::process_silence() const {
+ bool ret;
+ if (GDVIRTUAL_CALL(_process_silence, ret)) {
+ return ret;
+ }
+ return false;
+}
+
+void AudioEffectInstance::_bind_methods() {
+ GDVIRTUAL_BIND(_process, "src_buffer", "dst_buffer", "frame_count");
+ GDVIRTUAL_BIND(_process_silence);
+}
+
+////
+
+Ref<AudioEffectInstance> AudioEffect::instantiate() {
+ Ref<AudioEffectInstance> ret;
+ if (GDVIRTUAL_REQUIRED_CALL(_instantiate, ret)) {
+ return ret;
+ }
+ return Ref<AudioEffectInstance>();
+}
+void AudioEffect::_bind_methods() {
+ GDVIRTUAL_BIND(_instantiate);
+}
+
AudioEffect::AudioEffect() {
}