diff --git a/docs/api-reference/data.md b/docs/api-reference/data.md index ad035d4..2c530a5 100644 --- a/docs/api-reference/data.md +++ b/docs/api-reference/data.md @@ -37,4 +37,22 @@ fn sprite_width(sheet_index: i32) -> i32; // Returns the number of sprites within the sprite sheet. If an invalid sprite sheet index is passed in, // the function will return -1. fn sprite_count(sheet_index: i32) -> i32; + +// Returns the length of the requested song in seconds. +// If the song is invalid, will return NaN. +fn bgm_length_secs(bgm_index: i32) -> f32; + +// Returns the length of the requested song in frames. +// The result of this function is always rounded up, ensuring that this sequence will be completed if +// the complete number of frames have passed. +fn bgm_length_frames(bgm_index: i32) -> i32; + +// Returns the length of the requested song in seconds. +// If the sfx is invalid, will return NaN. +fn sfx_length_secs(sfx_index: i32) -> f32; + +// Returns the length of the requested song in frames. +// The result of this function is always rounded up, ensuring that this sequence will be completed if +// the complete number of frames have passed. +fn sfx_length_frames(sfx_index: i32) -> i32; ``` diff --git a/docs/api-reference/index.md b/docs/api-reference/index.md index 27300f1..2382f22 100644 --- a/docs/api-reference/index.md +++ b/docs/api-reference/index.md @@ -52,6 +52,10 @@ extern "C" { pub fn sprite_height(sprite_sheet: i32) -> i32; pub fn sprite_width(sprite_sheet: i32) -> i32; pub fn sprite_count(sprite_sheet: i32) -> i32; + pub fn bgm_length_secs(bgm_index: i32) -> f32; + pub fn bgm_length_frames(bgm_index: i32) -> i32; + pub fn sfx_length_secs(sfx_index: i32) -> f32; + pub fn sfx_length_frames(sfx_index: i32) -> i32; } // Graphics Params