medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 03796536a0751c52d8b14305f64671891b44aeb1
parent 004d883818a53ccd90bd438adddba67a662f9f99
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Mon Oct 24 23:11:28 +0300

Shuffle things into platform_audio_output.h

Diffstat:
linux_audio_output.cc | 2+-
linux_audio_output.h | 10----------
platform_audio_output.h | 22++++++++++++++++++----
3 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/linux_audio_output.cc b/linux_audio_output.cc @@ -7,7 +7,7 @@ #include "intrinsics.h" #include "log.h" #include "platform_library.h" -#include "linux_audio_output.h" +#include "platform_audio_output.h" // copied from alsa headers static int ( *_snd_lib_error_set_handler )( snd_lib_error_handler_t handler ) = NULL; diff --git a/linux_audio_output.h b/linux_audio_output.h @@ -3,22 +3,12 @@ #include <alsa/asoundlib.h> -#include "intrinsics.h" #include "platform_thread.h" -#define AUDIO_OUTPUT_CALLBACK( f ) void f( s16 * output_samples, s32 num_output_samples ) -typedef AUDIO_OUTPUT_CALLBACK( AudioOutputCallback ); - struct AudioOutputDevice { snd_pcm_t * pcm; Thread thread; AudioOutputCallback * callback; }; -void audio_output_init(); -void audio_output_term(); - -void audio_output_open( AudioOutputDevice * device, AudioOutputCallback callback ); -void audio_output_close( AudioOutputDevice * device ); - #endif // _LINUX_AUDIO_H_ diff --git a/platform_audio_output.h b/platform_audio_output.h @@ -1,10 +1,24 @@ -// #ifndef _PLATFORM_AUDIO_H_ -// #define _PLATFORM_AUDIO_H_ +#ifndef _PLATFORM_AUDIO_H_ +#define _PLATFORM_AUDIO_H_ -#if defined( __linux__ ) +#include "intrinsics.h" +#include "platform.h" + +#define AUDIO_OUTPUT_CALLBACK( f ) void f( s16 * output_samples, s32 num_output_samples ) +typedef AUDIO_OUTPUT_CALLBACK( AudioOutputCallback ); + +struct AudioOutputDevice; + +void audio_output_init(); +void audio_output_term(); + +void audio_output_open( AudioOutputDevice * device, AudioOutputCallback callback ); +void audio_output_close( AudioOutputDevice * device ); + +#if PLATFORM_LINUX #include "linux_audio_output.h" #else #error new platform #endif -// #endif // _PLATFORM_AUDIO_H_ +#endif // _PLATFORM_AUDIO_H_