filename | src/aica/audio.c |
changeset | 531:f0fee3ba71d1 |
prev | 465:3bd7be575792 |
next | 561:533f6b478071 |
author | nkeynes |
date | Thu Nov 22 11:10:15 2007 +0000 (16 years ago) |
permissions | -rw-r--r-- |
last change | Re-add "Load Binary" menu item (misplaced in GUI rewrite) Prevent running with no code loaded |
file | annotate | diff | log | raw |
1.1 --- a/src/aica/audio.c Sat Oct 27 05:47:21 2007 +00001.2 +++ b/src/aica/audio.c Thu Nov 22 11:10:15 2007 +00001.3 @@ -24,6 +24,13 @@1.4 #include <assert.h>1.5 #include <string.h>1.7 +audio_driver_t audio_driver_list[] = {1.8 +#ifdef HAVE_ESOUND1.9 + &audio_esd_driver,1.10 +#endif1.11 + &audio_null_driver,1.12 + NULL };1.13 +1.14 #define NUM_BUFFERS 31.15 #define MS_PER_BUFFER 1001.17 @@ -61,6 +68,21 @@1.18 return (read == AUDIO_CHANNEL_COUNT ? 0 : -1 );1.19 }1.21 +audio_driver_t get_audio_driver_by_name( const char *name )1.22 +{1.23 + int i;1.24 + if( name == NULL ) {1.25 + return audio_driver_list[0];1.26 + }1.27 + for( i=0; audio_driver_list[i] != NULL; i++ ) {1.28 + if( strcasecmp( audio_driver_list[i]->name, name ) == 0 ) {1.29 + return audio_driver_list[i];1.30 + }1.31 + }1.32 +1.33 + return NULL;1.34 +}1.35 +1.36 /**1.37 * Set the output driver, sample rate and format. Also initializes the1.38 * output buffers, flushing any current data and reallocating as
.