diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2020-10-23 18:33:20 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2020-11-10 11:42:51 +0100 |
commit | e2083871eb57e56fe637c3d8f6647ddb4ff539e0 (patch) | |
tree | a58669c68065541e0062f82d7edb45789d8f354f /platform/javascript/audio_driver_javascript.h | |
parent | 54cda5c3b8622c9168fcd5d1c68964ef7697b27e (diff) | |
download | redot-engine-e2083871eb57e56fe637c3d8f6647ddb4ff539e0.tar.gz |
[HTML5] Port JavaScript inline code to libraries.
The API is implemented in javascript, and generates C functions that can
be called from godot.
This allows much cleaner code replacing all `EM_ASM` calls in our C++
code with plain C function calls.
This also gets rid of few hacks and comes with few optimizations (e.g.
custom cursor shapes should be much faster now).
Diffstat (limited to 'platform/javascript/audio_driver_javascript.h')
-rw-r--r-- | platform/javascript/audio_driver_javascript.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/platform/javascript/audio_driver_javascript.h b/platform/javascript/audio_driver_javascript.h index 56a7da0307..60ad6480c9 100644 --- a/platform/javascript/audio_driver_javascript.h +++ b/platform/javascript/audio_driver_javascript.h @@ -44,7 +44,6 @@ private: int mix_rate = 0; int channel_count = 0; -public: #ifndef NO_THREADS Mutex mutex; Thread *thread = nullptr; @@ -53,9 +52,12 @@ public: static void _audio_thread_func(void *p_data); #endif + static void _audio_driver_process_start(); + static void _audio_driver_process_end(); + static void _audio_driver_process_capture(float p_sample); + void _audio_driver_process(); - void _js_driver_process(); - +public: static bool is_available(); void process_capture(float sample); @@ -72,7 +74,6 @@ public: void lock() override; void unlock() override; void finish() override; - void finish_async(); Error capture_start() override; Error capture_stop() override; |