diff options
Diffstat (limited to 'src/audio/audio.h')
-rw-r--r-- | src/audio/audio.h | 112 |
1 files changed, 108 insertions, 4 deletions
diff --git a/src/audio/audio.h b/src/audio/audio.h index 319a86c..984e1ea 100644 --- a/src/audio/audio.h +++ b/src/audio/audio.h @@ -2,13 +2,117 @@ #define HONEY_AUDIO_H #include <lua.h> +#include <miniaudio.h> + + +ma_sound_group * to_sound_group(lua_State *L, int index); +void ma_push_node(lua_State *L, ma_node *n); + +#define AUDIO_METATABLES \ + X("ma.engine", ma_engine_tname) \ + X("ma.node", ma_node_tname) \ + X("ma.sound", ma_sound_tname) \ + +#define X(name, mt) extern const char *mt; +AUDIO_METATABLES +#undef X -extern const char *audio_engine_tname; #define AUDIO_FUNCTIONS \ - X("engine_init", audio_engine_init) \ - X("engine_uninit", audio_engine_uninit) \ - X("engine_play_sound", audio_engine_play_sound) \ + /* engine */ \ + X("ma_engine_init", ma_engine_init_bind) \ + X("ma_engine_uninit", ma_engine_uninit_bind) \ + X("ma_engine_get_endpoint", ma_engine_get_endpoint_bind) \ + X("ma_engine_get_time", ma_engine_get_time_bind) \ + X("ma_engine_set_time", ma_engine_set_time_bind) \ + X("ma_engine_get_channels", ma_engine_get_channels_bind) \ + X("ma_engine_get_sample_rate", ma_engine_get_sample_rate_bind) \ + X("ma_engine_start", ma_engine_start_bind) \ + X("ma_engine_stop", ma_engine_stop_bind) \ + X("ma_engine_set_volume", ma_engine_set_volume_bind) \ + X("ma_engine_set_gain_db", ma_engine_set_gain_db_bind) \ + X("ma_engine_get_listener_count", ma_engine_get_listener_count_bind) \ + X("ma_engine_find_closest_listener", ma_engine_find_closest_listener_bind) \ + X("ma_engine_listener_set_position", ma_engine_listener_set_position_bind) \ + X("ma_engine_listener_get_position", ma_engine_listener_get_position_bind) \ + X("ma_engine_listener_set_direction", ma_engine_listener_set_direction_bind) \ + X("ma_engine_listener_get_direction", ma_engine_listener_get_direction_bind) \ + X("ma_engine_listener_set_velocity", ma_engine_listener_set_velocity_bind) \ + X("ma_engine_listener_get_velocity", ma_engine_listener_get_velocity_bind) \ + X("ma_engine_listener_set_cone", ma_engine_listener_set_cone_bind) \ + X("ma_engine_listener_get_cone", ma_engine_listener_get_cone_bind) \ + X("ma_engine_listener_set_world_up", ma_engine_listener_set_world_up_bind) \ + X("ma_engine_listener_get_world_up", ma_engine_listener_get_world_up_bind) \ + X("ma_engine_listener_set_enabled", ma_engine_listener_set_enabled_bind) \ + X("ma_engine_listener_is_enabled", ma_engine_listener_is_enabled_bind) \ + X("ma_engine_play_sound_ex", ma_engine_play_sound_ex_bind) \ + X("ma_engine_play_sound", ma_engine_play_sound_bind) \ +\ + /* sound */ \ + X("ma_sound_init_from_file", ma_sound_init_from_file_bind) \ + X("ma_sound_init_copy", ma_sound_init_copy_bind) \ + X("ma_sound_uninit", ma_sound_uninit_bind) \ + X("ma_sound_start", ma_sound_start_bind) \ + X("ma_sound_stop", ma_sound_stop_bind) \ + X("ma_sound_set_volume", ma_sound_set_volume_bind) \ + X("ma_sound_get_volume", ma_sound_get_volume_bind) \ + X("ma_sound_set_pan", ma_sound_set_pan_bind) \ + X("ma_sound_get_pan", ma_sound_get_pan_bind) \ + X("ma_sound_set_pan_mode", ma_sound_set_pan_mode_bind) \ + X("ma_sound_get_pan_mode", ma_sound_get_pan_mode_bind) \ + X("ma_sound_set_pitch", ma_sound_set_pitch_bind) \ + X("ma_sound_get_pitch", ma_sound_get_pitch_bind) \ + X("ma_sound_set_spatialization_enabled", ma_sound_set_spatialization_enabled_bind) \ + X("ma_sound_is_spatialization_enabled", ma_sound_is_spatialization_enabled_bind) \ + X("ma_sound_set_pinned_listener_index", ma_sound_set_pinned_listener_index_bind) \ + X("ma_sound_get_pinned_listener_index", ma_sound_get_pinned_listener_index_bind) \ + X("ma_sound_get_listener_index", ma_sound_get_listener_index_bind) \ + X("ma_sound_get_direction_to_listener", ma_sound_get_direction_to_listener_bind) \ + X("ma_sound_set_position", ma_sound_set_position_bind) \ + X("ma_sound_get_position", ma_sound_get_position_bind) \ + X("ma_sound_set_direction", ma_sound_set_direction_bind) \ + X("ma_sound_get_direction", ma_sound_get_direction_bind) \ + X("ma_sound_set_velocity", ma_sound_set_velocity_bind) \ + X("ma_sound_get_velocity", ma_sound_get_velocity_bind) \ + X("ma_sound_set_attenuation_model", ma_sound_set_attenuation_model_bind) \ + X("ma_sound_get_attenuation_model", ma_sound_get_attenuation_model_bind) \ + X("ma_sound_set_positioning", ma_sound_set_positioning_bind) \ + X("ma_sound_get_positioning", ma_sound_get_positioning_bind) \ + X("ma_sound_set_rolloff", ma_sound_set_rolloff_bind) \ + X("ma_sound_get_rolloff", ma_sound_get_rolloff_bind) \ + X("ma_sound_set_min_gain", ma_sound_set_min_gain_bind) \ + X("ma_sound_get_min_gain", ma_sound_get_min_gain_bind) \ + X("ma_sound_set_max_gain", ma_sound_set_max_gain_bind) \ + X("ma_sound_get_max_gain", ma_sound_get_max_gain_bind) \ + X("ma_sound_set_min_distance", ma_sound_set_min_distance_bind) \ + X("ma_sound_get_min_distance", ma_sound_get_min_distance_bind) \ + X("ma_sound_set_max_distance", ma_sound_set_max_distance_bind) \ + X("ma_sound_get_max_distance", ma_sound_get_max_distance_bind) \ + X("ma_sound_set_cone", ma_sound_set_cone_bind) \ + X("ma_sound_get_cone", ma_sound_get_cone_bind) \ + X("ma_sound_set_doppler_factor", ma_sound_set_doppler_factor_bind) \ + X("ma_sound_get_doppler_factor", ma_sound_get_doppler_factor_bind) \ + X("ma_sound_set_directional_attenuation_factor", ma_sound_set_directional_attenuation_factor_bind) \ + X("ma_sound_get_directional_attenuation_factor", ma_sound_get_directional_attenuation_factor_bind) \ + X("ma_sound_set_fade_in_pcm_frames", ma_sound_set_fade_in_pcm_frames_bind) \ + X("ma_sound_set_fade_in_milliseconds", ma_sound_set_fade_in_milliseconds_bind) \ + X("ma_sound_get_current_fade_volume", ma_sound_get_current_fade_volume_bind) \ + X("ma_sound_set_start_time_in_pcm_frames", ma_sound_set_start_time_in_pcm_frames_bind) \ + X("ma_sound_set_start_time_in_milliseconds", ma_sound_set_start_time_in_milliseconds_bind) \ + X("ma_sound_set_stop_time_in_pcm_frames", ma_sound_set_stop_time_in_pcm_frames_bind) \ + X("ma_sound_set_stop_time_in_milliseconds", ma_sound_set_stop_time_in_milliseconds_bind) \ + X("ma_sound_is_playing", ma_sound_is_playing_bind) \ + X("ma_sound_get_time_in_pcm_frames", ma_sound_get_time_in_pcm_frames_bind) \ + X("ma_sound_set_looping", ma_sound_set_looping_bind) \ + X("ma_sound_is_looping", ma_sound_is_looping_bind) \ + X("ma_sound_at_end", ma_sound_at_end_bind) \ + X("ma_sound_seek_to_pcm_frame", ma_sound_seek_to_pcm_frame_bind) \ + X("ma_sound_get_data_format", ma_sound_get_data_format_bind) \ + X("ma_sound_get_cursor_in_pcm_frames", ma_sound_get_cursor_in_pcm_frames_bind) \ + X("ma_sound_get_length_in_pcm_frames", ma_sound_get_length_in_pcm_frames_bind) \ + X("ma_sound_get_cursor_in_seconds", ma_sound_get_cursor_in_seconds_bind) \ + X("ma_sound_get_length_in_seconds", ma_sound_get_length_in_seconds_bind) \ + #define X(name, func) int func(lua_State *L); AUDIO_FUNCTIONS |