#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(dead_code)]
use core::ffi::{c_int, c_uint, c_void};
#[cfg(target_arch = "wasm32")]
extern crate scsynth_wasm32_libc;
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
unsafe extern "C" {
pub fn scsynth_default_world_options(out: *mut WorldOptions);
pub fn scsynth_reply_context(addr: *mut ReplyAddress) -> *mut c_void;
pub fn scsynth_copy_buffer(
world: *mut World,
index: c_uint,
func: ScBufferFunc,
ctx: *mut c_void,
) -> c_int;
}
pub type ScBufferFunc = Option<
unsafe extern "C" fn(
ctx: *mut c_void,
data: *const f32,
num_samples: c_int,
num_channels: c_int,
num_frames: c_int,
),
>;
unsafe extern "C" {
pub fn scsynth_set_log_func(func: ScLogFunc, ctx: *mut c_void);
}
pub type ScLogFunc =
Option<unsafe extern "C" fn(ctx: *mut c_void, text: *const core::ffi::c_char, len: c_int)>;
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" {
pub fn scsynth_pump(
world: *mut World,
input: *const f32,
num_input_channels: c_int,
output: *mut f32,
num_output_channels: c_int,
num_frames: c_int,
);
}
#[cfg(target_arch = "wasm32")]
unsafe extern "C" {
pub fn World_Cleanup(world: *mut World, unload_plugins: bool);
pub fn scsynth_wasm_new(options: *mut WorldOptions) -> *mut World;
pub fn scsynth_wasm_perform(
world: *mut World,
data: *const u8,
size: c_int,
reply_func: ReplyFunc,
reply_ctx: *mut c_void,
);
pub fn scsynth_wasm_pump(
world: *mut World,
input: *const f32,
num_input_channels: c_int,
output: *mut f32,
num_output_channels: c_int,
num_frames: c_int,
);
}