summaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2019-04-10 12:57:03 -0300
committerJuan Linietsky <reduzio@gmail.com>2019-04-10 12:58:06 -0300
commite33764744cb2bf72ee77c823c3beeb6dc870d2dc (patch)
treef8b792a5a014af65173ece9aa8e4293ee080610a /core/math
parentf75b9e62468ba65753f2ce49c02f1a129c08b717 (diff)
Added generator audio stream, and spectrum analyzer audio effect
Made AudioFrame and Vector2 equivalent for casting. Added ability to obtain the playback object from stream players. Added ability to obtain effect instance from audio server.
Diffstat (limited to 'core/math')
-rw-r--r--core/math/audio_frame.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/math/audio_frame.h b/core/math/audio_frame.h
index ebe0356c93..98e4e33021 100644
--- a/core/math/audio_frame.h
+++ b/core/math/audio_frame.h
@@ -31,6 +31,7 @@
#ifndef AUDIOFRAME_H
#define AUDIOFRAME_H
+#include "core/math/vector2.h"
#include "core/typedefs.h"
static inline float undenormalise(volatile float f) {
@@ -128,6 +129,14 @@ struct AudioFrame {
return *this;
}
+ _ALWAYS_INLINE_ operator Vector2() const {
+ return Vector2(l, r);
+ }
+
+ _ALWAYS_INLINE_ AudioFrame(const Vector2 &p_v2) {
+ l = p_v2.x;
+ r = p_v2.y;
+ }
_ALWAYS_INLINE_ AudioFrame() {}
};