From 9f2fc81df2ad6731b521bd7dfd523ee10f63be90 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Mon, 30 May 2016 15:34:29 -0700 Subject: update to openal --- src/audio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/audio.h') diff --git a/src/audio.h b/src/audio.h index 1140a60a..ec00f7b5 100644 --- a/src/audio.h +++ b/src/audio.h @@ -107,7 +107,7 @@ void SetMusicPitch(int index, float pitch); RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingPoint); void CloseRawAudioContext(RawAudioContext ctx); -int BufferRawAudioContext(RawAudioContext ctx, void *data, int numberElements); // returns number of elements buffered +int BufferRawAudioContext(RawAudioContext ctx, void *data, unsigned short numberElements); // returns number of elements buffered #ifdef __cplusplus } -- cgit v1.2.3 From 90e1ed2b5e54a9b6c69be3dd2b71d1e4f3632c33 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Wed, 1 Jun 2016 20:09:00 -0700 Subject: mod player added --- src/audio.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/audio.h') diff --git a/src/audio.h b/src/audio.h index ec00f7b5..ca56032e 100644 --- a/src/audio.h +++ b/src/audio.h @@ -41,8 +41,9 @@ //---------------------------------------------------------------------------------- #ifndef __cplusplus // Boolean type - #ifndef true + #if !defined(_STDBOOL_H) typedef enum { false, true } bool; + #define _STDBOOL_H #endif #endif -- cgit v1.2.3 From af1eb5453acc2772afbc316375c403b31a742626 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Thu, 2 Jun 2016 02:02:23 -0700 Subject: I added audio errors The only thing I did not change was the _g for globals. Is there any other way we can mark globals? --- src/audio.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/audio.h') diff --git a/src/audio.h b/src/audio.h index ca56032e..4baa30df 100644 --- a/src/audio.h +++ b/src/audio.h @@ -47,10 +47,29 @@ #endif #endif +typedef enum { + ERROR_RAW_CONTEXT_CREATION = -20, + ERROR_XM_CONTEXT_CREATION, + ERROR_MOD_CONTEXT_CREATION, + ERROR_MIX_CHANNEL_CREATION, + ERROR_MUSIC_CHANNEL_CREATION, + ERROR_LOADING_XM, + ERROR_LOADING_MOD, + ERROR_LOADING_WAV, + ERROR_LOADING_OGG, + ERROR_OUT_OF_MIX_CHANNELS, + ERROR_EXTENSION_NOT_RECOGNIZED, + ERROR_UNABLE_TO_OPEN_RRES_FILE, + ERROR_INVALID_RRES_FILE, + ERROR_INVALID_RRES_RESOURCE, + ERROR_UNINITIALIZED_CHANNELS +} AudioError; + // Sound source type typedef struct Sound { unsigned int source; unsigned int buffer; + AudioError error; // if there was any error during the creation or use of this Sound } Sound; // Wave type, defines audio wave data @@ -64,6 +83,7 @@ typedef struct Wave { typedef int RawAudioContext; + #ifdef __cplusplus extern "C" { // Prevents name mangling of functions #endif -- cgit v1.2.3 From cf2975d062a991d69fde60c3cdc043a8a39a09dc Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Thu, 2 Jun 2016 02:31:25 -0700 Subject: convenient way to combine errors --- src/audio.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/audio.h') diff --git a/src/audio.h b/src/audio.h index 4baa30df..a7475566 100644 --- a/src/audio.h +++ b/src/audio.h @@ -48,21 +48,21 @@ #endif typedef enum { - ERROR_RAW_CONTEXT_CREATION = -20, - ERROR_XM_CONTEXT_CREATION, - ERROR_MOD_CONTEXT_CREATION, - ERROR_MIX_CHANNEL_CREATION, - ERROR_MUSIC_CHANNEL_CREATION, - ERROR_LOADING_XM, - ERROR_LOADING_MOD, - ERROR_LOADING_WAV, - ERROR_LOADING_OGG, - ERROR_OUT_OF_MIX_CHANNELS, - ERROR_EXTENSION_NOT_RECOGNIZED, - ERROR_UNABLE_TO_OPEN_RRES_FILE, - ERROR_INVALID_RRES_FILE, - ERROR_INVALID_RRES_RESOURCE, - ERROR_UNINITIALIZED_CHANNELS + ERROR_RAW_CONTEXT_CREATION = 1, + ERROR_XM_CONTEXT_CREATION = 2, + ERROR_MOD_CONTEXT_CREATION = 4, + ERROR_MIX_CHANNEL_CREATION = 8, + ERROR_MUSIC_CHANNEL_CREATION = 16, + ERROR_LOADING_XM = 32, + ERROR_LOADING_MOD = 64, + ERROR_LOADING_WAV = 128, + ERROR_LOADING_OGG = 256, + ERROR_OUT_OF_MIX_CHANNELS = 512, + ERROR_EXTENSION_NOT_RECOGNIZED = 1024, + ERROR_UNABLE_TO_OPEN_RRES_FILE = 2048, + ERROR_INVALID_RRES_FILE = 4096, + ERROR_INVALID_RRES_RESOURCE = 8192, + ERROR_UNINITIALIZED_CHANNELS = 16384 } AudioError; // Sound source type -- cgit v1.2.3