diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/tinyalsa/mixer.h | 30 | ||||
-rw-r--r-- | include/tinyalsa/pcm.h | 42 | ||||
-rw-r--r-- | include/tinyalsa/version.h | 8 |
3 files changed, 52 insertions, 28 deletions
diff --git a/include/tinyalsa/mixer.h b/include/tinyalsa/mixer.h index 4de6133..f743f6e 100644 --- a/include/tinyalsa/mixer.h +++ b/include/tinyalsa/mixer.h @@ -69,9 +69,13 @@ struct mixer *mixer_open(unsigned int card); void mixer_close(struct mixer *mixer); -const char *mixer_get_name(struct mixer *mixer); +const char *mixer_get_name(const struct mixer *mixer); -unsigned int mixer_get_num_ctls(struct mixer *mixer); +unsigned int mixer_get_num_ctls(const struct mixer *mixer); + +unsigned int mixer_get_num_ctls_by_name(const struct mixer *mixer, const char *name); + +const struct mixer_ctl *mixer_get_ctl_const(const struct mixer *mixer, unsigned int id); struct mixer_ctl *mixer_get_ctl(struct mixer *mixer, unsigned int id); @@ -81,17 +85,17 @@ struct mixer_ctl *mixer_get_ctl_by_name_and_index(struct mixer *mixer, const char *name, unsigned int index); -unsigned int mixer_ctl_get_id(struct mixer_ctl *ctl); +unsigned int mixer_ctl_get_id(const struct mixer_ctl *ctl); -const char *mixer_ctl_get_name(struct mixer_ctl *ctl); +const char *mixer_ctl_get_name(const struct mixer_ctl *ctl); -enum mixer_ctl_type mixer_ctl_get_type(struct mixer_ctl *ctl); +enum mixer_ctl_type mixer_ctl_get_type(const struct mixer_ctl *ctl); -const char *mixer_ctl_get_type_string(struct mixer_ctl *ctl); +const char *mixer_ctl_get_type_string(const struct mixer_ctl *ctl); -unsigned int mixer_ctl_get_num_values(struct mixer_ctl *ctl); +unsigned int mixer_ctl_get_num_values(const struct mixer_ctl *ctl); -unsigned int mixer_ctl_get_num_enums(struct mixer_ctl *ctl); +unsigned int mixer_ctl_get_num_enums(const struct mixer_ctl *ctl); const char *mixer_ctl_get_enum_string(struct mixer_ctl *ctl, unsigned int enum_id); @@ -102,13 +106,13 @@ const char *mixer_ctl_get_enum_string(struct mixer_ctl *ctl, unsigned int enum_i void mixer_ctl_update(struct mixer_ctl *ctl); /* Set and get mixer controls */ -int mixer_ctl_get_percent(struct mixer_ctl *ctl, unsigned int id); +int mixer_ctl_get_percent(const struct mixer_ctl *ctl, unsigned int id); int mixer_ctl_set_percent(struct mixer_ctl *ctl, unsigned int id, int percent); -int mixer_ctl_get_value(struct mixer_ctl *ctl, unsigned int id); +int mixer_ctl_get_value(const struct mixer_ctl *ctl, unsigned int id); -int mixer_ctl_get_array(struct mixer_ctl *ctl, void *array, size_t count); +int mixer_ctl_get_array(const struct mixer_ctl *ctl, void *array, size_t count); int mixer_ctl_set_value(struct mixer_ctl *ctl, unsigned int id, int value); @@ -117,9 +121,9 @@ int mixer_ctl_set_array(struct mixer_ctl *ctl, const void *array, size_t count); int mixer_ctl_set_enum_by_string(struct mixer_ctl *ctl, const char *string); /* Determe range of integer mixer controls */ -int mixer_ctl_get_range_min(struct mixer_ctl *ctl); +int mixer_ctl_get_range_min(const struct mixer_ctl *ctl); -int mixer_ctl_get_range_max(struct mixer_ctl *ctl); +int mixer_ctl_get_range_max(const struct mixer_ctl *ctl); #if defined(__cplusplus) } /* extern "C" */ diff --git a/include/tinyalsa/pcm.h b/include/tinyalsa/pcm.h index 3d9dfaa..1d84eed 100644 --- a/include/tinyalsa/pcm.h +++ b/include/tinyalsa/pcm.h @@ -223,43 +223,63 @@ struct pcm_params *pcm_params_get(unsigned int card, unsigned int device, void pcm_params_free(struct pcm_params *pcm_params); -struct pcm_mask *pcm_params_get_mask(struct pcm_params *pcm_params, enum pcm_param param); +const struct pcm_mask *pcm_params_get_mask(const struct pcm_params *pcm_params, enum pcm_param param); -unsigned int pcm_params_get_min(struct pcm_params *pcm_params, enum pcm_param param); +unsigned int pcm_params_get_min(const struct pcm_params *pcm_params, enum pcm_param param); -unsigned int pcm_params_get_max(struct pcm_params *pcm_params, enum pcm_param param); +unsigned int pcm_params_get_max(const struct pcm_params *pcm_params, enum pcm_param param); struct pcm; struct pcm *pcm_open(unsigned int card, unsigned int device, unsigned int flags, - struct pcm_config *config); + const struct pcm_config *config); int pcm_close(struct pcm *pcm); -int pcm_is_ready(struct pcm *pcm); +int pcm_is_ready(const struct pcm *pcm); -int pcm_get_file_descriptor(struct pcm *pcm); +unsigned int pcm_get_channels(const struct pcm *pcm); -const char *pcm_get_error(struct pcm *pcm); +unsigned int pcm_get_rate(const struct pcm *pcm); + +enum pcm_format pcm_get_format(const struct pcm *pcm); + +int pcm_get_file_descriptor(const struct pcm *pcm); + +const char *pcm_get_error(const struct pcm *pcm); unsigned int pcm_format_to_bits(enum pcm_format format); -unsigned int pcm_get_buffer_size(struct pcm *pcm); +unsigned int pcm_get_buffer_size(const struct pcm *pcm); -unsigned int pcm_frames_to_bytes(struct pcm *pcm, unsigned int frames); +unsigned int pcm_frames_to_bytes(const struct pcm *pcm, unsigned int frames); -unsigned int pcm_bytes_to_frames(struct pcm *pcm, unsigned int bytes); +unsigned int pcm_bytes_to_frames(const struct pcm *pcm, unsigned int bytes); int pcm_get_htimestamp(struct pcm *pcm, unsigned int *avail, struct timespec *tstamp); -unsigned int pcm_get_subdevice(struct pcm *pcm); +unsigned int pcm_get_subdevice(const struct pcm *pcm); + +int pcm_writei(struct pcm *pcm, const void *data, unsigned int frame_count); + +int pcm_readi(struct pcm *pcm, void *data, unsigned int frame_count); + +#ifdef __GNUC__ + +int pcm_write(struct pcm *pcm, const void *data, unsigned int count) __attribute((deprecated)); + +int pcm_read(struct pcm *pcm, void *data, unsigned int count) __attribute((deprecated)); + +#else int pcm_write(struct pcm *pcm, const void *data, unsigned int count); int pcm_read(struct pcm *pcm, void *data, unsigned int count); +#endif + int pcm_mmap_write(struct pcm *pcm, const void *data, unsigned int count); int pcm_mmap_read(struct pcm *pcm, void *data, unsigned int count); diff --git a/include/tinyalsa/version.h b/include/tinyalsa/version.h index b92e030..5d71840 100644 --- a/include/tinyalsa/version.h +++ b/include/tinyalsa/version.h @@ -31,13 +31,13 @@ #define TINYALSA_VERSION_MAJOR 1 -#define TINYALSA_VERSION_MINOR 0 +#define TINYALSA_VERSION_MINOR 1 -#define TINYALSA_VERSION_PATCH 3 +#define TINYALSA_VERSION_PATCH 0 -#define TINYALSA_VERSION 0x010003UL +#define TINYALSA_VERSION 0x010100UL -#define TINYALSA_VERSION_STRING "1.0.3" +#define TINYALSA_VERSION_STRING "1.1.0" #endif /* TINYALSA_VERSION_H */ |