From 2276dc7ad067f7af7504783239103c1abd7b4433 Mon Sep 17 00:00:00 2001 From: Vlad-Stefan Harbuz Date: Mon, 7 Feb 2022 13:08:52 +0100 Subject: refactor names from e.g. sdl2::init() to sdl2::SDL_Init() Signed-off-by: Vlad-Stefan Harbuz --- sdl2/mixer/general.ha | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'sdl2/mixer/general.ha') diff --git a/sdl2/mixer/general.ha b/sdl2/mixer/general.ha index 32c7b38..4f819bf 100644 --- a/sdl2/mixer/general.ha +++ b/sdl2/mixer/general.ha @@ -1,7 +1,7 @@ use sdl2; // Flags for [[init]]. -export type init_flags = enum { +export type MIX_InitFlags = enum { FLAC = 0x00000001, MOD = 0x00000002, MP3 = 0x00000008, @@ -11,42 +11,42 @@ export type init_flags = enum { }; // The default mixer has 8 simultaneous mixing channels -export def CHANNELS: int = 8; +export def MIX_CHANNELS: int = 8; // Good default frequency for a PC soundcard -export def DEFAULT_FREQUENCY: int = 22050; +export def MIX_DEFAULT_FREQUENCY: int = 22050; // Good default channels for a PC soundcard -export def DEFAULT_CHANNELS: int = 2; +export def MIX_DEFAULT_CHANNELS: int = 2; // XXX: This should choose MSB on a big-endian system: // Good default format for a PC soundcard -export def DEFAULT_FORMAT: sdl2::audio_format = sdl2::AUDIO_S16LSB; +export def MIX_DEFAULT_FORMAT: sdl2::SDL_AudioFormat = sdl2::AUDIO_S16LSB; -@symbol("Mix_Init") fn _init(flags: int) int; +@symbol("Mix_Init") fn _Mix_Init(flags: int) int; // Loads dynamic libraries and prepares them for use. Flags should be -// one or more flags from [[init_flags]] OR'd together. -export fn init(flags: init_flags) (void | sdl2::error) = { - return sdl2::wrapvoid(_init(flags)); +// one or more flags from [[MIX_InitFlags]] OR'd together. +export fn Mix_Init(flags: MIX_InitFlags) (void | sdl2::error) = { + return sdl2::wrapvoid(_Mix_Init(flags)); }; -// Unloads libraries loaded with [[init]]. -export @symbol("Mix_Quit") fn quit() void; +// Unloads libraries loaded with [[Mix_Init]]. +export @symbol("Mix_Quit") fn Mix_Quit() void; -@symbol("Mix_OpenAudio") fn _openaudio(frequency: int, +@symbol("Mix_OpenAudio") fn _Mix_OpenAudio(frequency: int, format: u16, channels: int, chunksize: int) int; // Open the mixer with a certain audio format -export fn open_audio( +export fn Mix_OpenAudio( frequency: int, - format: sdl2::audio_format, + format: sdl2::SDL_AudioFormat, channels: int, chunksize: int, ) (void | sdl2::error) = { - return sdl2::wrapvoid(_openaudio(frequency, format, channels, chunksize)); + return sdl2::wrapvoid(_Mix_OpenAudio(frequency, format, channels, chunksize)); }; // Close the mixer, halting all playing audio -export @symbol("Mix_CloseAudio") fn close_audio() void; +export @symbol("Mix_CloseAudio") fn Mix_CloseAudio() void; -- cgit v1.2.3