From 034ada738c5d7ce117b6f84ec8a37297a198fbaf Mon Sep 17 00:00:00 2001 From: MysterD Date: Sun, 8 May 2022 00:29:17 -0700 Subject: [PATCH] Re-ran autogen --- autogen/lua_definitions/functions.lua | 75 +++++ docs/lua/functions-4.md | 389 ++++++++++++++++++++++++++ docs/lua/functions.md | 70 +++++ src/pc/lua/smlua_functions_autogen.c | 166 ++++++++++- 4 files changed, 692 insertions(+), 8 deletions(-) diff --git a/autogen/lua_definitions/functions.lua b/autogen/lua_definitions/functions.lua index 1f1a725f1..acad9c888 100644 --- a/autogen/lua_definitions/functions.lua +++ b/autogen/lua_definitions/functions.lua @@ -7217,6 +7217,18 @@ function get_temp_s32_pointer(initialValue) -- ... end +--- @param audio_stream integer +--- @return number +function get_tempo_audio(audio_stream) + -- ... +end + +--- @param audio_stream integer +--- @return number +function get_volume_audio(audio_stream) + -- ... +end + --- @param type HudDisplayValue --- @return integer function hud_get_value(type) @@ -7271,6 +7283,19 @@ function movtexqc_register(name, level, area, type) -- ... end +--- @param audio_stream integer +--- @return nil +function pause_audio(audio_stream) + -- ... +end + +--- @param audio_stream integer +--- @param restart boolean +--- @return nil +function play_audio(audio_stream, restart) + -- ... +end + --- @param transType integer --- @param time integer --- @param red integer @@ -7294,6 +7319,20 @@ function set_environment_region(index, value) -- ... end +--- @param audio_stream integer +--- @param freq number +--- @return nil +function set_frequency_audio(audio_stream, freq) + -- ... +end + +--- @param audio_stream integer +--- @param looping boolean +--- @return nil +function set_looping_audio(audio_stream, looping) + -- ... +end + --- @param far number --- @return number function set_override_far(far) @@ -7312,6 +7351,42 @@ function set_override_near(near) -- ... end +--- @param audio_stream integer +--- @param pos number +--- @return nil +function set_position_audio(audio_stream, pos) + -- ... +end + +--- @param audio_stream integer +--- @param initial_freq number +--- @param speed number +--- @param pitch boolean +--- @return nil +function set_speed_audio(audio_stream, initial_freq, speed, pitch) + -- ... +end + +--- @param audio_stream integer +--- @param tempo number +--- @return nil +function set_tempo_audio(audio_stream, tempo) + -- ... +end + +--- @param audio_stream integer +--- @param volume number +--- @return nil +function set_volume_audio(audio_stream, volume) + -- ... +end + +--- @param audio_stream integer +--- @return nil +function stop_audio(audio_stream) + -- ... +end + --- @param aDelay integer --- @return boolean function warp_exit_level(aDelay) diff --git a/docs/lua/functions-4.md b/docs/lua/functions-4.md index 69b1c7c86..1e15454f7 100644 --- a/docs/lua/functions-4.md +++ b/docs/lua/functions-4.md @@ -4757,6 +4757,66 @@
+## [destroy_audio](#destroy_audio) + +### Lua Example +`destroy_audio(audio_stream)` + +### Parameters +| Field | Type | +| ----- | ---- | +| audio_stream | `integer` | + +### Returns +- None + +### C Prototype +`void destroy_audio(u32 audio_stream);` + +[:arrow_up_small:](#) + +
+ +## [destroy_sample](#destroy_sample) + +### Lua Example +`destroy_sample(audio_stream)` + +### Parameters +| Field | Type | +| ----- | ---- | +| audio_stream | `integer` | + +### Returns +- None + +### C Prototype +`void destroy_sample(u32 audio_stream);` + +[:arrow_up_small:](#) + +
+ +## [get_audio_from_sample](#get_audio_from_sample) + +### Lua Example +`local integerValue = get_audio_from_sample(sample)` + +### Parameters +| Field | Type | +| ----- | ---- | +| sample | `integer` | + +### Returns +- `integer` + +### C Prototype +`u32 get_audio_from_sample(u32 sample);` + +[:arrow_up_small:](#) + +
+ ## [get_current_save_file_num](#get_current_save_file_num) ### Lua Example @@ -4795,6 +4855,26 @@
+## [get_frequency_audio](#get_frequency_audio) + +### Lua Example +`local numberValue = get_frequency_audio(audio_stream)` + +### Parameters +| Field | Type | +| ----- | ---- | +| audio_stream | `integer` | + +### Returns +- `number` + +### C Prototype +`f32 get_frequency_audio(u32 audio_stream);` + +[:arrow_up_small:](#) + +
+ ## [get_hand_foot_pos_x](#get_hand_foot_pos_x) ### Lua Example @@ -4858,6 +4938,26 @@
+## [get_looping_audio](#get_looping_audio) + +### Lua Example +`local booleanValue = get_looping_audio(audio_stream)` + +### Parameters +| Field | Type | +| ----- | ---- | +| audio_stream | `integer` | + +### Returns +- `boolean` + +### C Prototype +`bool get_looping_audio(u32 audio_stream);` + +[:arrow_up_small:](#) + +
+ ## [get_network_area_timer](#get_network_area_timer) ### Lua Example @@ -4876,6 +4976,26 @@
+## [get_position_audio](#get_position_audio) + +### Lua Example +`local numberValue = get_position_audio(audio_stream)` + +### Parameters +| Field | Type | +| ----- | ---- | +| audio_stream | `integer` | + +### Returns +- `number` + +### C Prototype +`f32 get_position_audio(u32 audio_stream);` + +[:arrow_up_small:](#) + +
+ ## [get_temp_s32_pointer](#get_temp_s32_pointer) ### Lua Example @@ -4896,6 +5016,46 @@
+## [get_tempo_audio](#get_tempo_audio) + +### Lua Example +`local numberValue = get_tempo_audio(audio_stream)` + +### Parameters +| Field | Type | +| ----- | ---- | +| audio_stream | `integer` | + +### Returns +- `number` + +### C Prototype +`f32 get_tempo_audio(u32 audio_stream);` + +[:arrow_up_small:](#) + +
+ +## [get_volume_audio](#get_volume_audio) + +### Lua Example +`local numberValue = get_volume_audio(audio_stream)` + +### Parameters +| Field | Type | +| ----- | ---- | +| audio_stream | `integer` | + +### Returns +- `number` + +### C Prototype +`f32 get_volume_audio(u32 audio_stream);` + +[:arrow_up_small:](#) + +
+ ## [hud_get_value](#hud_get_value) ### Lua Example @@ -4997,6 +5157,46 @@
+## [load_audio](#load_audio) + +### Lua Example +`local integerValue = load_audio(file_name)` + +### Parameters +| Field | Type | +| ----- | ---- | +| file_name | `string` | + +### Returns +- `integer` + +### C Prototype +`u32 load_audio(const char* file_name);` + +[:arrow_up_small:](#) + +
+ +## [load_sample](#load_sample) + +### Lua Example +`local integerValue = load_sample(file_name)` + +### Parameters +| Field | Type | +| ----- | ---- | +| file_name | `string` | + +### Returns +- `integer` + +### C Prototype +`u32 load_sample(const char* file_name);` + +[:arrow_up_small:](#) + +
+ ## [movtexqc_register](#movtexqc_register) ### Lua Example @@ -5020,6 +5220,47 @@
+## [pause_audio](#pause_audio) + +### Lua Example +`pause_audio(audio_stream)` + +### Parameters +| Field | Type | +| ----- | ---- | +| audio_stream | `integer` | + +### Returns +- None + +### C Prototype +`void pause_audio(u32 audio_stream);` + +[:arrow_up_small:](#) + +
+ +## [play_audio](#play_audio) + +### Lua Example +`play_audio(audio_stream, restart)` + +### Parameters +| Field | Type | +| ----- | ---- | +| audio_stream | `integer` | +| restart | `boolean` | + +### Returns +- None + +### C Prototype +`void play_audio(u32 audio_stream, bool restart);` + +[:arrow_up_small:](#) + +
+ ## [play_transition](#play_transition) ### Lua Example @@ -5085,6 +5326,48 @@
+## [set_frequency_audio](#set_frequency_audio) + +### Lua Example +`set_frequency_audio(audio_stream, freq)` + +### Parameters +| Field | Type | +| ----- | ---- | +| audio_stream | `integer` | +| freq | `number` | + +### Returns +- None + +### C Prototype +`void set_frequency_audio(u32 audio_stream, f32 freq);` + +[:arrow_up_small:](#) + +
+ +## [set_looping_audio](#set_looping_audio) + +### Lua Example +`set_looping_audio(audio_stream, looping)` + +### Parameters +| Field | Type | +| ----- | ---- | +| audio_stream | `integer` | +| looping | `boolean` | + +### Returns +- None + +### C Prototype +`void set_looping_audio(u32 audio_stream, bool looping);` + +[:arrow_up_small:](#) + +
+ ## [set_override_far](#set_override_far) ### Lua Example @@ -5145,6 +5428,112 @@
+## [set_position_audio](#set_position_audio) + +### Lua Example +`set_position_audio(audio_stream, pos)` + +### Parameters +| Field | Type | +| ----- | ---- | +| audio_stream | `integer` | +| pos | `number` | + +### Returns +- None + +### C Prototype +`void set_position_audio(u32 audio_stream, f32 pos);` + +[:arrow_up_small:](#) + +
+ +## [set_speed_audio](#set_speed_audio) + +### Lua Example +`set_speed_audio(audio_stream, initial_freq, speed, pitch)` + +### Parameters +| Field | Type | +| ----- | ---- | +| audio_stream | `integer` | +| initial_freq | `number` | +| speed | `number` | +| pitch | `boolean` | + +### Returns +- None + +### C Prototype +`void set_speed_audio(u32 audio_stream, f32 initial_freq, f32 speed, bool pitch);` + +[:arrow_up_small:](#) + +
+ +## [set_tempo_audio](#set_tempo_audio) + +### Lua Example +`set_tempo_audio(audio_stream, tempo)` + +### Parameters +| Field | Type | +| ----- | ---- | +| audio_stream | `integer` | +| tempo | `number` | + +### Returns +- None + +### C Prototype +`void set_tempo_audio(u32 audio_stream, f32 tempo);` + +[:arrow_up_small:](#) + +
+ +## [set_volume_audio](#set_volume_audio) + +### Lua Example +`set_volume_audio(audio_stream, volume)` + +### Parameters +| Field | Type | +| ----- | ---- | +| audio_stream | `integer` | +| volume | `number` | + +### Returns +- None + +### C Prototype +`void set_volume_audio(u32 audio_stream, f32 volume);` + +[:arrow_up_small:](#) + +
+ +## [stop_audio](#stop_audio) + +### Lua Example +`stop_audio(audio_stream)` + +### Parameters +| Field | Type | +| ----- | ---- | +| audio_stream | `integer` | + +### Returns +- None + +### C Prototype +`void stop_audio(u32 audio_stream);` + +[:arrow_up_small:](#) + +
+ ## [warp_exit_level](#warp_exit_level) ### Lua Example diff --git a/docs/lua/functions.md b/docs/lua/functions.md index 4f4dec62e..766be0117 100644 --- a/docs/lua/functions.md +++ b/docs/lua/functions.md @@ -14,6 +14,8 @@ - [network_send_object](#network_send_object) - [network_send_to](#network_send_to) - [network_send](#network_send) + - [djui_hud_render_texture](#djui_hud_render_texture) + - [get_texture_info](#get_texture_info)
@@ -1337,25 +1339,44 @@ - [camera_freeze](functions-4.md#camera_freeze) - [camera_unfreeze](functions-4.md#camera_unfreeze) - [deref_s32_pointer](functions-4.md#deref_s32_pointer) + - [destroy_audio](functions-4.md#destroy_audio) + - [destroy_sample](functions-4.md#destroy_sample) + - [get_audio_from_sample](functions-4.md#get_audio_from_sample) - [get_current_save_file_num](functions-4.md#get_current_save_file_num) - [get_environment_region](functions-4.md#get_environment_region) + - [get_frequency_audio](functions-4.md#get_frequency_audio) - [get_hand_foot_pos_x](functions-4.md#get_hand_foot_pos_x) - [get_hand_foot_pos_y](functions-4.md#get_hand_foot_pos_y) - [get_hand_foot_pos_z](functions-4.md#get_hand_foot_pos_z) + - [get_looping_audio](functions-4.md#get_looping_audio) - [get_network_area_timer](functions-4.md#get_network_area_timer) + - [get_position_audio](functions-4.md#get_position_audio) - [get_temp_s32_pointer](functions-4.md#get_temp_s32_pointer) + - [get_tempo_audio](functions-4.md#get_tempo_audio) + - [get_volume_audio](functions-4.md#get_volume_audio) - [hud_get_value](functions-4.md#hud_get_value) - [hud_hide](functions-4.md#hud_hide) - [hud_render_power_meter](functions-4.md#hud_render_power_meter) - [hud_set_value](functions-4.md#hud_set_value) - [hud_show](functions-4.md#hud_show) + - [load_audio](functions-4.md#load_audio) + - [load_sample](functions-4.md#load_sample) - [movtexqc_register](functions-4.md#movtexqc_register) + - [pause_audio](functions-4.md#pause_audio) + - [play_audio](functions-4.md#play_audio) - [play_transition](functions-4.md#play_transition) - [save_file_set_using_backup_slot](functions-4.md#save_file_set_using_backup_slot) - [set_environment_region](functions-4.md#set_environment_region) + - [set_frequency_audio](functions-4.md#set_frequency_audio) + - [set_looping_audio](functions-4.md#set_looping_audio) - [set_override_far](functions-4.md#set_override_far) - [set_override_fov](functions-4.md#set_override_fov) - [set_override_near](functions-4.md#set_override_near) + - [set_position_audio](functions-4.md#set_position_audio) + - [set_speed_audio](functions-4.md#set_speed_audio) + - [set_tempo_audio](functions-4.md#set_tempo_audio) + - [set_volume_audio](functions-4.md#set_volume_audio) + - [stop_audio](functions-4.md#stop_audio) - [warp_exit_level](functions-4.md#warp_exit_level) - [warp_restart_level](functions-4.md#warp_restart_level) - [warp_to_castle](functions-4.md#warp_to_castle) @@ -1574,6 +1595,55 @@ The `reliable` field will ensure that the packet arrives, but should be used spa
+## [djui_hud_render_texture](#djui_hud_render_texture) + +Renders a texture to the screen. + +### Lua Example +`djui_hud_render_texture(texInfo, x, y, scaleW, scaleH)` + +### Parameters +| Field | Type | +| ----- | ---- | +| texInfo | [TextureInfo](structs.md#TextureInfo) | +| x | `number` | +| y | `number` | +| scaleW | `number` | +| scaleH | `number` | + +### Returns +- None + +### C Prototype +`void djui_hud_render_texture(struct TextureInfo* texInfo, f32 x, f32 y, f32 scaleW, f32 scaleH);` + +[:arrow_up_small:](#) + +
+ +## [get_texture_info](#get_texture_info) + +Retrieves a texture by name. + +### Lua Example +`get_texture_info(textureName)` + +### Parameters +| Field | Type | +| ----- | ---- | +| textureName | `string` | + +### Returns +- [TextureInfo](structs.md#TextureInfo) + +### C Prototype +`N/A` + +[:arrow_up_small:](#) + +
+ --- 1 | [2](functions-2.md) | [3](functions-3.md) | [4](functions-4.md) | [next >](functions-2.md)] + diff --git a/src/pc/lua/smlua_functions_autogen.c b/src/pc/lua/smlua_functions_autogen.c index 67132d4a3..6c1121d92 100644 --- a/src/pc/lua/smlua_functions_autogen.c +++ b/src/pc/lua/smlua_functions_autogen.c @@ -14711,7 +14711,7 @@ int smlua_func_destroy_audio(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } u32 audio_stream = smlua_to_integer(L, 1); - if (!gSmLuaConvertSuccess) { return 0; } + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } destroy_audio(audio_stream); @@ -14722,7 +14722,7 @@ int smlua_func_destroy_sample(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } u32 audio_stream = smlua_to_integer(L, 1); - if (!gSmLuaConvertSuccess) { return 0; } + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } destroy_sample(audio_stream); @@ -14733,7 +14733,7 @@ int smlua_func_get_audio_from_sample(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } u32 sample = smlua_to_integer(L, 1); - if (!gSmLuaConvertSuccess) { return 0; } + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } lua_pushinteger(L, get_audio_from_sample(sample)); @@ -14764,7 +14764,7 @@ int smlua_func_get_frequency_audio(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } u32 audio_stream = smlua_to_integer(L, 1); - if (!gSmLuaConvertSuccess) { return 0; } + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } lua_pushnumber(L, get_frequency_audio(audio_stream)); @@ -14814,7 +14814,7 @@ int smlua_func_get_looping_audio(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } u32 audio_stream = smlua_to_integer(L, 1); - if (!gSmLuaConvertSuccess) { return 0; } + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } lua_pushboolean(L, get_looping_audio(audio_stream)); @@ -14834,7 +14834,7 @@ int smlua_func_get_position_audio(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } u32 audio_stream = smlua_to_integer(L, 1); - if (!gSmLuaConvertSuccess) { return 0; } + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } lua_pushnumber(L, get_position_audio(audio_stream)); @@ -14852,6 +14852,28 @@ int smlua_func_get_temp_s32_pointer(lua_State* L) { return 1; } +int smlua_func_get_tempo_audio(lua_State* L) { + if(!smlua_functions_valid_param_count(L, 1)) { return 0; } + + u32 audio_stream = smlua_to_integer(L, 1); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } + + lua_pushnumber(L, get_tempo_audio(audio_stream)); + + return 1; +} + +int smlua_func_get_volume_audio(lua_State* L) { + if(!smlua_functions_valid_param_count(L, 1)) { return 0; } + + u32 audio_stream = smlua_to_integer(L, 1); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } + + lua_pushnumber(L, get_volume_audio(audio_stream)); + + return 1; +} + int smlua_func_hud_get_value(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } @@ -14917,7 +14939,7 @@ int smlua_func_load_audio(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } const char* file_name = smlua_to_string(L, 1); - if (!gSmLuaConvertSuccess) { return 0; } + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } lua_pushinteger(L, load_audio(file_name)); @@ -14928,7 +14950,7 @@ int smlua_func_load_sample(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } const char* file_name = smlua_to_string(L, 1); - if (!gSmLuaConvertSuccess) { return 0; } + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } lua_pushinteger(L, load_sample(file_name)); @@ -14952,6 +14974,30 @@ int smlua_func_movtexqc_register(lua_State* L) { return 1; } +int smlua_func_pause_audio(lua_State* L) { + if(!smlua_functions_valid_param_count(L, 1)) { return 0; } + + u32 audio_stream = smlua_to_integer(L, 1); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } + + pause_audio(audio_stream); + + return 1; +} + +int smlua_func_play_audio(lua_State* L) { + if(!smlua_functions_valid_param_count(L, 2)) { return 0; } + + u32 audio_stream = smlua_to_integer(L, 1); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } + bool restart = smlua_to_boolean(L, 2); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; } + + play_audio(audio_stream, restart); + + return 1; +} + int smlua_func_play_transition(lua_State* L) { if(!smlua_functions_valid_param_count(L, 5)) { return 0; } @@ -14995,6 +15041,32 @@ int smlua_func_set_environment_region(lua_State* L) { return 1; } +int smlua_func_set_frequency_audio(lua_State* L) { + if(!smlua_functions_valid_param_count(L, 2)) { return 0; } + + u32 audio_stream = smlua_to_integer(L, 1); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } + f32 freq = smlua_to_number(L, 2); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; } + + set_frequency_audio(audio_stream, freq); + + return 1; +} + +int smlua_func_set_looping_audio(lua_State* L) { + if(!smlua_functions_valid_param_count(L, 2)) { return 0; } + + u32 audio_stream = smlua_to_integer(L, 1); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } + bool looping = smlua_to_boolean(L, 2); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; } + + set_looping_audio(audio_stream, looping); + + return 1; +} + int smlua_func_set_override_far(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } @@ -15028,6 +15100,73 @@ int smlua_func_set_override_near(lua_State* L) { return 1; } +int smlua_func_set_position_audio(lua_State* L) { + if(!smlua_functions_valid_param_count(L, 2)) { return 0; } + + u32 audio_stream = smlua_to_integer(L, 1); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } + f32 pos = smlua_to_number(L, 2); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; } + + set_position_audio(audio_stream, pos); + + return 1; +} + +int smlua_func_set_speed_audio(lua_State* L) { + if(!smlua_functions_valid_param_count(L, 4)) { return 0; } + + u32 audio_stream = smlua_to_integer(L, 1); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } + f32 initial_freq = smlua_to_number(L, 2); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; } + f32 speed = smlua_to_number(L, 3); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 3"); return 0; } + bool pitch = smlua_to_boolean(L, 4); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 4"); return 0; } + + set_speed_audio(audio_stream, initial_freq, speed, pitch); + + return 1; +} + +int smlua_func_set_tempo_audio(lua_State* L) { + if(!smlua_functions_valid_param_count(L, 2)) { return 0; } + + u32 audio_stream = smlua_to_integer(L, 1); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } + f32 tempo = smlua_to_number(L, 2); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; } + + set_tempo_audio(audio_stream, tempo); + + return 1; +} + +int smlua_func_set_volume_audio(lua_State* L) { + if(!smlua_functions_valid_param_count(L, 2)) { return 0; } + + u32 audio_stream = smlua_to_integer(L, 1); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } + f32 volume = smlua_to_number(L, 2); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; } + + set_volume_audio(audio_stream, volume); + + return 1; +} + +int smlua_func_stop_audio(lua_State* L) { + if(!smlua_functions_valid_param_count(L, 1)) { return 0; } + + u32 audio_stream = smlua_to_integer(L, 1); + if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } + + stop_audio(audio_stream); + + return 1; +} + int smlua_func_warp_exit_level(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } @@ -17265,6 +17404,8 @@ void smlua_bind_functions_autogen(void) { smlua_bind_function(L, "get_network_area_timer", smlua_func_get_network_area_timer); smlua_bind_function(L, "get_position_audio", smlua_func_get_position_audio); smlua_bind_function(L, "get_temp_s32_pointer", smlua_func_get_temp_s32_pointer); + smlua_bind_function(L, "get_tempo_audio", smlua_func_get_tempo_audio); + smlua_bind_function(L, "get_volume_audio", smlua_func_get_volume_audio); smlua_bind_function(L, "hud_get_value", smlua_func_hud_get_value); smlua_bind_function(L, "hud_hide", smlua_func_hud_hide); smlua_bind_function(L, "hud_render_power_meter", smlua_func_hud_render_power_meter); @@ -17273,12 +17414,21 @@ void smlua_bind_functions_autogen(void) { smlua_bind_function(L, "load_audio", smlua_func_load_audio); smlua_bind_function(L, "load_sample", smlua_func_load_sample); smlua_bind_function(L, "movtexqc_register", smlua_func_movtexqc_register); + smlua_bind_function(L, "pause_audio", smlua_func_pause_audio); + smlua_bind_function(L, "play_audio", smlua_func_play_audio); smlua_bind_function(L, "play_transition", smlua_func_play_transition); smlua_bind_function(L, "save_file_set_using_backup_slot", smlua_func_save_file_set_using_backup_slot); smlua_bind_function(L, "set_environment_region", smlua_func_set_environment_region); + smlua_bind_function(L, "set_frequency_audio", smlua_func_set_frequency_audio); + smlua_bind_function(L, "set_looping_audio", smlua_func_set_looping_audio); smlua_bind_function(L, "set_override_far", smlua_func_set_override_far); smlua_bind_function(L, "set_override_fov", smlua_func_set_override_fov); smlua_bind_function(L, "set_override_near", smlua_func_set_override_near); + smlua_bind_function(L, "set_position_audio", smlua_func_set_position_audio); + smlua_bind_function(L, "set_speed_audio", smlua_func_set_speed_audio); + smlua_bind_function(L, "set_tempo_audio", smlua_func_set_tempo_audio); + smlua_bind_function(L, "set_volume_audio", smlua_func_set_volume_audio); + smlua_bind_function(L, "stop_audio", smlua_func_stop_audio); smlua_bind_function(L, "warp_exit_level", smlua_func_warp_exit_level); smlua_bind_function(L, "warp_restart_level", smlua_func_warp_restart_level); smlua_bind_function(L, "warp_to_castle", smlua_func_warp_to_castle);