ao.h | ao.h | |||
---|---|---|---|---|
skipping to change at line 52 | skipping to change at line 52 | |||
#define AO_TYPE_LIVE 1 | #define AO_TYPE_LIVE 1 | |||
#define AO_TYPE_FILE 2 | #define AO_TYPE_FILE 2 | |||
#define AO_ENODRIVER 1 | #define AO_ENODRIVER 1 | |||
#define AO_ENOTFILE 2 | #define AO_ENOTFILE 2 | |||
#define AO_ENOTLIVE 3 | #define AO_ENOTLIVE 3 | |||
#define AO_EBADOPTION 4 | #define AO_EBADOPTION 4 | |||
#define AO_EOPENDEVICE 5 | #define AO_EOPENDEVICE 5 | |||
#define AO_EOPENFILE 6 | #define AO_EOPENFILE 6 | |||
#define AO_EFILEEXISTS 7 | #define AO_EFILEEXISTS 7 | |||
#define AO_EBADFORMAT 8 | ||||
#define AO_EFAIL 100 | #define AO_EFAIL 100 | |||
#define AO_FMT_LITTLE 1 | #define AO_FMT_LITTLE 1 | |||
#define AO_FMT_BIG 2 | #define AO_FMT_BIG 2 | |||
#define AO_FMT_NATIVE 4 | #define AO_FMT_NATIVE 4 | |||
/* --- Structures --- */ | /* --- Structures --- */ | |||
typedef struct ao_info { | typedef struct ao_info { | |||
skipping to change at line 73 | skipping to change at line 74 | |||
char *name; /* full name of driver */ | char *name; /* full name of driver */ | |||
char *short_name; /* short name of driver */ | char *short_name; /* short name of driver */ | |||
char *author; /* driver author */ | char *author; /* driver author */ | |||
char *comment; /* driver comment */ | char *comment; /* driver comment */ | |||
int preferred_byte_format; | int preferred_byte_format; | |||
int priority; | int priority; | |||
char **options; | char **options; | |||
int option_count; | int option_count; | |||
} ao_info; | } ao_info; | |||
typedef struct ao_functions ao_functions; /* Forward decl to make C happy * | typedef struct ao_functions ao_functions; | |||
/ | typedef struct ao_device ao_device; | |||
typedef struct ao_device { | ||||
int type; /* live output or file output? */ | ||||
int driver_id; | ||||
ao_functions *funcs; | ||||
FILE *file; /* File for output if this is a file driver */ | ||||
int client_byte_format; | ||||
int machine_byte_format; | ||||
int driver_byte_format; | ||||
char *swap_buffer; | ||||
int swap_buffer_size; /* Bytes allocated to swap_buffer */ | ||||
void *internal; /* Pointer to driver-specific data */ | ||||
} ao_device; | ||||
typedef struct ao_sample_format { | typedef struct ao_sample_format { | |||
int bits; /* bits per sample */ | int bits; /* bits per sample */ | |||
int rate; /* samples per second (in a single channel) */ | int rate; /* samples per second (in a single channel) */ | |||
int channels; /* number of audio channels */ | int channels; /* number of audio channels */ | |||
int byte_format; /* Byte ordering in sample, see constants below */ | int byte_format; /* Byte ordering in sample, see constants below */ | |||
char *matrix; /* input channel location/ordering */ | ||||
} ao_sample_format; | } ao_sample_format; | |||
struct ao_functions { | ||||
int (*test)(void); | ||||
ao_info* (*driver_info)(void); | ||||
int (*device_init)(ao_device *device); | ||||
int (*set_option)(ao_device *device, const char *key, | ||||
const char *value); | ||||
int (*open)(ao_device *device, ao_sample_format *format); | ||||
int (*play)(ao_device *device, const char *output_samples, | ||||
uint_32 num_bytes); | ||||
int (*close)(ao_device *device); | ||||
void (*device_clear)(ao_device *device); | ||||
char* (*file_extension)(void); | ||||
}; | ||||
typedef struct ao_option { | typedef struct ao_option { | |||
char *key; | char *key; | |||
char *value; | char *value; | |||
struct ao_option *next; | struct ao_option *next; | |||
} ao_option; | } ao_option; | |||
#if defined(AO_BUILDING_LIBAO) | ||||
#include "ao_private.h" | ||||
#endif | ||||
/* --- Functions --- */ | /* --- Functions --- */ | |||
/* library setup/teardown */ | /* library setup/teardown */ | |||
void ao_initialize(void); | void ao_initialize(void); | |||
void ao_shutdown(void); | void ao_shutdown(void); | |||
/* device setup/playback/teardown */ | /* device setup/playback/teardown */ | |||
int ao_append_option(ao_option **options, const char *key, | int ao_append_global_option(const char *key, | |||
const char *value); | const char *value); | |||
void ao_free_options(ao_option *options); | int ao_append_option(ao_option **options, | |||
ao_device* ao_open_live(int driver_id, ao_sample_format *format, | const char *key, | |||
ao_option *option); | const char *value); | |||
ao_device* ao_open_file(int driver_id, const char *filename, int overwrite, | void ao_free_options(ao_option *options); | |||
ao_sample_format *format, ao_option *option); | ao_device* ao_open_live(int driver_id, | |||
ao_sample_format *format, | ||||
ao_option *option); | ||||
ao_device* ao_open_file(int driver_id, | ||||
const char *filename, | ||||
int overwrite, | ||||
ao_sample_format *format, | ||||
ao_option *option); | ||||
int ao_play(ao_device *device, char *output_samples, uint_32 num_bytes); | int ao_play(ao_device *device, | |||
int ao_close(ao_device *device); | char *output_samples, | |||
uint_32 num_bytes); | ||||
int ao_close(ao_device *device); | ||||
/* driver information */ | /* driver information */ | |||
int ao_driver_id(const char *short_name); | int ao_driver_id(const char *short_name); | |||
int ao_default_driver_id(void); | int ao_default_driver_id(void); | |||
ao_info *ao_driver_info(int driver_id); | ao_info *ao_driver_info(int driver_id); | |||
ao_info **ao_driver_info_list(int *driver_count); | ao_info **ao_driver_info_list(int *driver_count); | |||
char *ao_file_extension(int driver_id); | char *ao_file_extension(int driver_id); | |||
/* miscellaneous */ | /* miscellaneous */ | |||
int ao_is_big_endian(void); | int ao_is_big_endian(void); | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif /* __cplusplus */ | #endif /* __cplusplus */ | |||
#endif /* __AO_H__ */ | #endif /* __AO_H__ */ | |||
End of changes. 10 change blocks. | ||||
47 lines changed or deleted | 35 lines changed or added | |||