Search
lxdream.org :: lxdream/src/aica/audio.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/aica/audio.h
changeset 697:479b8c213f61
prev657:c4143facbfcb
next700:4650d0c7f6f9
author nkeynes
date Sun Jun 22 04:01:27 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Commit work-in-progress CoreAudio driver
(along with various changes to the audio subsystem)
file annotate diff log raw
1.1 --- a/src/aica/audio.h Wed Apr 16 10:12:12 2008 +0000
1.2 +++ b/src/aica/audio.h Sun Jun 22 04:01:27 2008 +0000
1.3 @@ -31,13 +31,20 @@
1.4 #define AUDIO_FMT_8BIT 0
1.5 #define AUDIO_FMT_16BIT 1
1.6 #define AUDIO_FMT_ADPCM 2
1.7 +#define AUDIO_FMT_FLOAT 3 // 32-bit -1.0 to 1.0
1.8 #define AUDIO_FMT_MONO 0
1.9 #define AUDIO_FMT_STEREO 4
1.10 #define AUDIO_FMT_SIGNED 0
1.11 #define AUDIO_FMT_UNSIGNED 8
1.12 +
1.13 +#define AUDIO_FMT_SAMPLE_MASK 3
1.14
1.15 #define AUDIO_FMT_16ST (AUDIO_FMT_16BIT|AUDIO_FMT_STEREO)
1.16 +#define AUDIO_FMT_FLOATST (AUDIO_FMT_FLOAT|AUDIO_FMT_STEREO)
1.17
1.18 +#define DEFAULT_SAMPLE_RATE 44100
1.19 +#define DEFAULT_SAMPLE_FORMAT AUDIO_FMT_16ST
1.20 +
1.21 typedef enum { LOOP_OFF = 0, LOOP_ON = 1, LOOP_LOOPED = 2 } loop_t;
1.22
1.23 typedef struct audio_channel {
1.24 @@ -68,17 +75,15 @@
1.25
1.26 typedef struct audio_driver {
1.27 char *name;
1.28 - gboolean (*init)( );
1.29 - gboolean (*set_output_format)( uint32_t sample_rate, uint32_t format );
1.30 + uint32_t sample_rate;
1.31 + uint32_t sample_format;
1.32 + gboolean (*init)( );
1.33 + void (*start)( );
1.34 gboolean (*process_buffer)( audio_buffer_t buffer );
1.35 - gboolean (*close)( );
1.36 + void (*stop)( );
1.37 + gboolean (*shutdown)( );
1.38 } *audio_driver_t;
1.39
1.40 -extern struct audio_driver audio_null_driver;
1.41 -extern struct audio_driver audio_pulse_driver;
1.42 -extern struct audio_driver audio_esd_driver;
1.43 -extern struct audio_driver audio_alsa_driver;
1.44 -
1.45 audio_driver_t get_audio_driver_by_name( const char *name );
1.46
1.47 /**
1.48 @@ -86,8 +91,7 @@
1.49 * output buffers, flushing any current data and reallocating as
1.50 * necessary. Must be called before attempting to generate any audio.
1.51 */
1.52 -gboolean audio_set_driver( audio_driver_t driver, uint32_t samplerate,
1.53 - int format );
1.54 +gboolean audio_set_driver( audio_driver_t driver );
1.55
1.56 /**
1.57 * Mark the current write buffer as full and prepare the next buffer for
1.58 @@ -122,4 +126,4 @@
1.59 #ifdef __cplusplus
1.60 }
1.61 #endif
1.62 -#endif
1.63 +#endif
1.64 \ No newline at end of file
.