You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
[HTML5] Add function signatures to JS libraries.
This commit is contained in:
@@ -137,6 +137,7 @@ const GodotAudio = {
|
||||
},
|
||||
},
|
||||
|
||||
godot_audio_is_available__sig: 'i',
|
||||
godot_audio_is_available__proxy: 'sync',
|
||||
godot_audio_is_available: function () {
|
||||
if (!(window.AudioContext || window.webkitAudioContext)) {
|
||||
@@ -145,12 +146,14 @@ const GodotAudio = {
|
||||
return 1;
|
||||
},
|
||||
|
||||
godot_audio_init__sig: 'iiiii',
|
||||
godot_audio_init: function (p_mix_rate, p_latency, p_state_change, p_latency_update) {
|
||||
const statechange = GodotRuntime.get_func(p_state_change);
|
||||
const latencyupdate = GodotRuntime.get_func(p_latency_update);
|
||||
return GodotAudio.init(p_mix_rate, p_latency, statechange, latencyupdate);
|
||||
},
|
||||
|
||||
godot_audio_resume__sig: 'v',
|
||||
godot_audio_resume: function () {
|
||||
if (GodotAudio.ctx && GodotAudio.ctx.state !== 'running') {
|
||||
GodotAudio.ctx.resume();
|
||||
@@ -158,6 +161,7 @@ const GodotAudio = {
|
||||
},
|
||||
|
||||
godot_audio_capture_start__proxy: 'sync',
|
||||
godot_audio_capture_start__sig: 'v',
|
||||
godot_audio_capture_start: function () {
|
||||
if (GodotAudio.input) {
|
||||
return; // Already started.
|
||||
@@ -168,6 +172,7 @@ const GodotAudio = {
|
||||
},
|
||||
|
||||
godot_audio_capture_stop__proxy: 'sync',
|
||||
godot_audio_capture_stop__sig: 'v',
|
||||
godot_audio_capture_stop: function () {
|
||||
if (GodotAudio.input) {
|
||||
const tracks = GodotAudio.input['mediaStream']['getTracks']();
|
||||
@@ -241,10 +246,12 @@ const GodotAudioWorklet = {
|
||||
},
|
||||
},
|
||||
|
||||
godot_audio_worklet_create__sig: 'vi',
|
||||
godot_audio_worklet_create: function (channels) {
|
||||
GodotAudioWorklet.create(channels);
|
||||
},
|
||||
|
||||
godot_audio_worklet_start__sig: 'viiiii',
|
||||
godot_audio_worklet_start: function (p_in_buf, p_in_size, p_out_buf, p_out_size, p_state) {
|
||||
const out_buffer = GodotRuntime.heapSub(HEAPF32, p_out_buf, p_out_size);
|
||||
const in_buffer = GodotRuntime.heapSub(HEAPF32, p_in_buf, p_in_size);
|
||||
@@ -252,15 +259,18 @@ const GodotAudioWorklet = {
|
||||
GodotAudioWorklet.start(in_buffer, out_buffer, state);
|
||||
},
|
||||
|
||||
godot_audio_worklet_state_wait__sig: 'iiii',
|
||||
godot_audio_worklet_state_wait: function (p_state, p_idx, p_expected, p_timeout) {
|
||||
Atomics.wait(HEAP32, (p_state >> 2) + p_idx, p_expected, p_timeout);
|
||||
return Atomics.load(HEAP32, (p_state >> 2) + p_idx);
|
||||
},
|
||||
|
||||
godot_audio_worklet_state_add__sig: 'iiii',
|
||||
godot_audio_worklet_state_add: function (p_state, p_idx, p_value) {
|
||||
return Atomics.add(HEAP32, (p_state >> 2) + p_idx, p_value);
|
||||
},
|
||||
|
||||
godot_audio_worklet_state_get__sig: 'iii',
|
||||
godot_audio_worklet_state_get: function (p_state, p_idx) {
|
||||
return Atomics.load(HEAP32, (p_state >> 2) + p_idx);
|
||||
},
|
||||
@@ -330,10 +340,12 @@ const GodotAudioScript = {
|
||||
},
|
||||
},
|
||||
|
||||
godot_audio_script_create__sig: 'iii',
|
||||
godot_audio_script_create: function (buffer_length, channel_count) {
|
||||
return GodotAudioScript.create(buffer_length, channel_count);
|
||||
},
|
||||
|
||||
godot_audio_script_start__sig: 'viiiii',
|
||||
godot_audio_script_start: function (p_in_buf, p_in_size, p_out_buf, p_out_size, p_cb) {
|
||||
const onprocess = GodotRuntime.get_func(p_cb);
|
||||
GodotAudioScript.start(p_in_buf, p_in_size, p_out_buf, p_out_size, onprocess);
|
||||
|
||||
Reference in New Issue
Block a user