mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-12-16 08:56:42 -05:00
Added I/O classes
This commit is contained in:
parent
da4d6f5ee8
commit
e283a3f642
32 changed files with 1882 additions and 226 deletions
|
|
@ -3,8 +3,8 @@ sysinclude_HEADERS = asoundlib.h
|
|||
|
||||
# This is the order they will be concatenated into asoundlib.h!
|
||||
#
|
||||
header_files=header.h version.h global.h error.h control.h mixer.h pcm.h \
|
||||
rawmidi.h timer.h hwdep.h seq.h seqmid.h seq_midi_event.h \
|
||||
header_files=header.h version.h global.h input.h output.h error.h control.h mixer.h \
|
||||
pcm.h rawmidi.h timer.h hwdep.h seq.h seqmid.h seq_midi_event.h \
|
||||
conv.h instr.h conf.h footer.h
|
||||
|
||||
noinst_HEADERS=$(header_files) search.h list.h aserver.h local.h
|
||||
|
|
|
|||
|
|
@ -24,10 +24,20 @@ struct _snd_config {
|
|||
snd_config_t *father;
|
||||
};
|
||||
|
||||
static inline snd_config_type_t snd_config_type(snd_config_t *config)
|
||||
{
|
||||
return config->type;
|
||||
}
|
||||
|
||||
static inline char *snd_config_id(snd_config_t *config)
|
||||
{
|
||||
return config->id;
|
||||
}
|
||||
|
||||
int snd_config_top(snd_config_t **config);
|
||||
|
||||
int snd_config_load(snd_config_t *config, FILE *fp);
|
||||
int snd_config_save(snd_config_t *config, FILE *fp);
|
||||
int snd_config_load(snd_config_t *config, snd_input_t *in);
|
||||
int snd_config_save(snd_config_t *config, snd_output_t *out);
|
||||
|
||||
int snd_config_search(snd_config_t *config, char *key, snd_config_t **result);
|
||||
int snd_config_searchv(snd_config_t *config,
|
||||
|
|
@ -62,15 +72,8 @@ typedef struct list_head *snd_config_iterator_t;
|
|||
|
||||
#define snd_config_entry(iterator) list_entry(iterator, snd_config_t, list)
|
||||
|
||||
static inline snd_config_type_t snd_config_type(snd_config_t *config)
|
||||
{
|
||||
return config->type;
|
||||
}
|
||||
|
||||
static inline char *snd_config_id(snd_config_t *config)
|
||||
{
|
||||
return config->id;
|
||||
}
|
||||
snd_config_type_t snd_config_type(snd_config_t *config);
|
||||
char *snd_config_id(snd_config_t *config);
|
||||
|
||||
extern snd_config_t *snd_config;
|
||||
int snd_config_update();
|
||||
|
|
|
|||
15
include/input.h
Normal file
15
include/input.h
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
typedef struct _snd_input snd_input_t;
|
||||
|
||||
typedef enum _snd_input_type {
|
||||
SND_INPUT_STDIO,
|
||||
SND_INPUT_BUFFER,
|
||||
} snd_input_type_t;
|
||||
|
||||
int snd_input_stdio_open(snd_input_t **inputp, const char *file);
|
||||
int snd_input_stdio_attach(snd_input_t **inputp, FILE *fp, int close);
|
||||
int snd_input_buffer_open(snd_input_t **inputp, const char *buffer, int size);
|
||||
int snd_input_close(snd_input_t *input);
|
||||
int snd_input_scanf(snd_input_t *input, const char *format, ...) __attribute__ ((format (scanf, 2, 3)));
|
||||
char *snd_input_gets(snd_input_t *input, char *str, size_t size);
|
||||
int snd_input_getc(snd_input_t *input);
|
||||
17
include/output.h
Normal file
17
include/output.h
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
typedef struct _snd_output snd_output_t;
|
||||
|
||||
typedef enum _snd_output_type {
|
||||
SND_OUTPUT_STDIO,
|
||||
SND_OUTPUT_BUFFER,
|
||||
} snd_output_type_t;
|
||||
|
||||
int snd_output_stdio_open(snd_output_t **outputp, const char *file);
|
||||
int snd_output_stdio_attach(snd_output_t **outputp, FILE *fp, int close);
|
||||
int snd_output_buffer_open(snd_output_t **outputp);
|
||||
size_t snd_output_buffer_string(snd_output_t *output, char **buf);
|
||||
int snd_output_close(snd_output_t *output);
|
||||
int snd_output_printf(snd_output_t *output, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
|
||||
int snd_output_puts(snd_output_t *output, const char *str);
|
||||
int snd_output_putc(snd_output_t *output, int c);
|
||||
int snd_output_flush(snd_output_t *output);
|
||||
|
|
@ -76,11 +76,11 @@ snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t
|
|||
snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
|
||||
snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
|
||||
|
||||
int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, FILE *fp);
|
||||
int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, FILE *fp);
|
||||
int snd_pcm_dump_setup(snd_pcm_t *pcm, FILE *fp);
|
||||
int snd_pcm_dump(snd_pcm_t *pcm, FILE *fp);
|
||||
int snd_pcm_status_dump(snd_pcm_status_t *status, FILE *fp);
|
||||
int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out);
|
||||
int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out);
|
||||
int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out);
|
||||
int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out);
|
||||
int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out);
|
||||
int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
|
||||
int snd_pcm_unlink(snd_pcm_t *pcm);
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm,
|
|||
snd_pcm_hw_params_t *fail,
|
||||
snd_pcm_hw_params_t *success,
|
||||
unsigned int depth,
|
||||
FILE *fp);
|
||||
snd_output_t *out);
|
||||
|
||||
int snd_pcm_hw_params_info_rate(const snd_pcm_hw_params_t *params,
|
||||
unsigned int *rate_num,
|
||||
|
|
@ -167,7 +167,7 @@ int snd_pcm_hw_params_info_msbits(const snd_pcm_hw_params_t *params);
|
|||
int snd_pcm_hw_params_info_flags(const snd_pcm_hw_params_t *params);
|
||||
int snd_pcm_hw_params_info_fifo_size(const snd_pcm_hw_params_t *params);
|
||||
int snd_pcm_hw_params_info_dig_groups(const snd_pcm_hw_params_t *params);
|
||||
int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params, FILE *fp);
|
||||
int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params, snd_output_t *out);
|
||||
|
||||
typedef struct _snd_pcm_hw_strategy snd_pcm_hw_strategy_t;
|
||||
|
||||
|
|
@ -212,7 +212,7 @@ int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
|
|||
int snd_pcm_sw_param_set(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_sw_param_t var, unsigned int val);
|
||||
int snd_pcm_sw_param_near(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_sw_param_t var, unsigned int val);
|
||||
int snd_pcm_sw_param_value(snd_pcm_sw_params_t *params, snd_pcm_sw_param_t var);
|
||||
int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, FILE *fp);
|
||||
int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out);
|
||||
|
||||
/* mmap */
|
||||
const snd_pcm_channel_area_t *snd_pcm_mmap_areas(snd_pcm_t *pcm);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue