mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-10 13:30:01 -05:00
Added documentation for instrument and midi event functions.
Removed snd_enum_() macros. Documentation changes in asoundlib.h.
This commit is contained in:
parent
8eceb0cdc2
commit
c20c954f3d
30 changed files with 440 additions and 227 deletions
|
|
@ -636,7 +636,7 @@ static const char *snd_pcm_tstamp_mode_names[] = {
|
|||
const char *snd_pcm_stream_name(snd_pcm_stream_t stream)
|
||||
{
|
||||
assert(stream <= SND_PCM_STREAM_LAST);
|
||||
return snd_pcm_stream_names[snd_enum_to_int(stream)];
|
||||
return snd_pcm_stream_names[stream];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -647,7 +647,7 @@ const char *snd_pcm_stream_name(snd_pcm_stream_t stream)
|
|||
const char *snd_pcm_access_name(snd_pcm_access_t acc)
|
||||
{
|
||||
assert(acc <= SND_PCM_ACCESS_LAST);
|
||||
return snd_pcm_access_names[snd_enum_to_int(acc)];
|
||||
return snd_pcm_access_names[acc];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -658,7 +658,7 @@ const char *snd_pcm_access_name(snd_pcm_access_t acc)
|
|||
const char *snd_pcm_format_name(snd_pcm_format_t format)
|
||||
{
|
||||
assert(format <= SND_PCM_FORMAT_LAST);
|
||||
return snd_pcm_format_names[snd_enum_to_int(format)];
|
||||
return snd_pcm_format_names[format];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -669,7 +669,7 @@ const char *snd_pcm_format_name(snd_pcm_format_t format)
|
|||
const char *snd_pcm_format_description(snd_pcm_format_t format)
|
||||
{
|
||||
assert(format <= SND_PCM_FORMAT_LAST);
|
||||
return snd_pcm_format_descriptions[snd_enum_to_int(format)];
|
||||
return snd_pcm_format_descriptions[format];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -680,9 +680,9 @@ const char *snd_pcm_format_description(snd_pcm_format_t format)
|
|||
snd_pcm_format_t snd_pcm_format_value(const char* name)
|
||||
{
|
||||
snd_pcm_format_t format;
|
||||
for (format = 0; format <= SND_PCM_FORMAT_LAST; snd_enum_incr(format)) {
|
||||
if (snd_pcm_format_names[snd_enum_to_int(format)] &&
|
||||
strcasecmp(name, snd_pcm_format_names[snd_enum_to_int(format)]) == 0) {
|
||||
for (format = 0; format <= SND_PCM_FORMAT_LAST; format++) {
|
||||
if (snd_pcm_format_names[format] &&
|
||||
strcasecmp(name, snd_pcm_format_names[format]) == 0) {
|
||||
return format;
|
||||
}
|
||||
}
|
||||
|
|
@ -697,7 +697,7 @@ snd_pcm_format_t snd_pcm_format_value(const char* name)
|
|||
const char *snd_pcm_subformat_name(snd_pcm_subformat_t subformat)
|
||||
{
|
||||
assert(subformat <= SND_PCM_SUBFORMAT_LAST);
|
||||
return snd_pcm_subformat_names[snd_enum_to_int(subformat)];
|
||||
return snd_pcm_subformat_names[subformat];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -708,7 +708,7 @@ const char *snd_pcm_subformat_name(snd_pcm_subformat_t subformat)
|
|||
const char *snd_pcm_subformat_description(snd_pcm_subformat_t subformat)
|
||||
{
|
||||
assert(subformat <= SND_PCM_SUBFORMAT_LAST);
|
||||
return snd_pcm_subformat_descriptions[snd_enum_to_int(subformat)];
|
||||
return snd_pcm_subformat_descriptions[subformat];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -719,10 +719,12 @@ const char *snd_pcm_subformat_description(snd_pcm_subformat_t subformat)
|
|||
const char *snd_pcm_start_mode_name(snd_pcm_start_t mode)
|
||||
{
|
||||
assert(mode <= SND_PCM_START_LAST);
|
||||
return snd_pcm_start_mode_names[snd_enum_to_int(mode)];
|
||||
return snd_pcm_start_mode_names[mode];
|
||||
}
|
||||
|
||||
#ifndef DOC_HIDDEN
|
||||
link_warning(snd_pcm_start_mode_name, "Warning: start_mode is deprecated, consider to use start_threshold");
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief (DEPRECATED) get name of PCM xrun mode setting
|
||||
|
|
@ -732,10 +734,12 @@ link_warning(snd_pcm_start_mode_name, "Warning: start_mode is deprecated, consid
|
|||
const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode)
|
||||
{
|
||||
assert(mode <= SND_PCM_XRUN_LAST);
|
||||
return snd_pcm_xrun_mode_names[snd_enum_to_int(mode)];
|
||||
return snd_pcm_xrun_mode_names[mode];
|
||||
}
|
||||
|
||||
#ifndef DOC_HIDDEN
|
||||
link_warning(snd_pcm_xrun_mode_name, "Warning: xrun_mode is deprecated, consider to use stop_threshold");
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief get name of PCM tstamp mode setting
|
||||
|
|
@ -745,7 +749,7 @@ link_warning(snd_pcm_xrun_mode_name, "Warning: xrun_mode is deprecated, consider
|
|||
const char *snd_pcm_tstamp_mode_name(snd_pcm_tstamp_t mode)
|
||||
{
|
||||
assert(mode <= SND_PCM_TSTAMP_LAST);
|
||||
return snd_pcm_tstamp_mode_names[snd_enum_to_int(mode)];
|
||||
return snd_pcm_tstamp_mode_names[mode];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -756,7 +760,7 @@ const char *snd_pcm_tstamp_mode_name(snd_pcm_tstamp_t mode)
|
|||
const char *snd_pcm_state_name(snd_pcm_state_t state)
|
||||
{
|
||||
assert(state <= SND_PCM_STATE_LAST);
|
||||
return snd_pcm_state_names[snd_enum_to_int(state)];
|
||||
return snd_pcm_state_names[state];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1867,7 +1871,7 @@ int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params)
|
|||
*/
|
||||
int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t val)
|
||||
{
|
||||
return snd_pcm_hw_param_set(pcm, params, SND_TEST, SND_PCM_HW_PARAM_ACCESS, snd_enum_to_int(val), 0);
|
||||
return snd_pcm_hw_param_set(pcm, params, SND_TEST, SND_PCM_HW_PARAM_ACCESS, val, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1879,7 +1883,7 @@ int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, s
|
|||
*/
|
||||
int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t val)
|
||||
{
|
||||
return snd_pcm_hw_param_set(pcm, params, SND_TRY, SND_PCM_HW_PARAM_ACCESS, snd_enum_to_int(val), 0);
|
||||
return snd_pcm_hw_param_set(pcm, params, SND_TRY, SND_PCM_HW_PARAM_ACCESS, val, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1890,7 +1894,7 @@ int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, sn
|
|||
*/
|
||||
snd_pcm_access_t snd_pcm_hw_params_set_access_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||
{
|
||||
return snd_int_to_enum(snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_ACCESS, NULL));
|
||||
return snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_ACCESS, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1901,7 +1905,7 @@ snd_pcm_access_t snd_pcm_hw_params_set_access_first(snd_pcm_t *pcm, snd_pcm_hw_p
|
|||
*/
|
||||
snd_pcm_access_t snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||
{
|
||||
return snd_int_to_enum(snd_pcm_hw_param_set_last(pcm, params, SND_PCM_HW_PARAM_ACCESS, NULL));
|
||||
return snd_pcm_hw_param_set_last(pcm, params, SND_PCM_HW_PARAM_ACCESS, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1969,7 +1973,7 @@ int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, sn
|
|||
*/
|
||||
snd_pcm_format_t snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||
{
|
||||
return snd_int_to_enum(snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_FORMAT, NULL));
|
||||
return snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_FORMAT, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1980,7 +1984,7 @@ snd_pcm_format_t snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_p
|
|||
*/
|
||||
snd_pcm_format_t snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||
{
|
||||
return snd_int_to_enum(snd_pcm_hw_param_set_last(pcm, params, SND_PCM_HW_PARAM_FORMAT, NULL));
|
||||
return snd_pcm_hw_param_set_last(pcm, params, SND_PCM_HW_PARAM_FORMAT, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2015,7 +2019,7 @@ void snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_form
|
|||
*/
|
||||
int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t val)
|
||||
{
|
||||
return snd_pcm_hw_param_set(pcm, params, SND_TEST, SND_PCM_HW_PARAM_SUBFORMAT, snd_enum_to_int(val), 0);
|
||||
return snd_pcm_hw_param_set(pcm, params, SND_TEST, SND_PCM_HW_PARAM_SUBFORMAT, val, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2037,7 +2041,7 @@ int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params)
|
|||
*/
|
||||
int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t val)
|
||||
{
|
||||
return snd_pcm_hw_param_set(pcm, params, SND_TRY, SND_PCM_HW_PARAM_SUBFORMAT, snd_enum_to_int(val), 0);
|
||||
return snd_pcm_hw_param_set(pcm, params, SND_TRY, SND_PCM_HW_PARAM_SUBFORMAT, val, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2048,7 +2052,7 @@ int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
|||
*/
|
||||
snd_pcm_subformat_t snd_pcm_hw_params_set_subformat_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||
{
|
||||
return snd_int_to_enum(snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_SUBFORMAT, NULL));
|
||||
return snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_SUBFORMAT, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2059,7 +2063,7 @@ snd_pcm_subformat_t snd_pcm_hw_params_set_subformat_first(snd_pcm_t *pcm, snd_pc
|
|||
*/
|
||||
snd_pcm_subformat_t snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||
{
|
||||
return snd_int_to_enum(snd_pcm_hw_param_set_last(pcm, params, SND_PCM_HW_PARAM_SUBFORMAT, NULL));
|
||||
return snd_pcm_hw_param_set_last(pcm, params, SND_PCM_HW_PARAM_SUBFORMAT, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -3368,7 +3372,7 @@ int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
|
|||
{
|
||||
assert(pcm && params);
|
||||
assert(pcm->setup);
|
||||
params->tstamp_mode = snd_enum_to_int(pcm->tstamp_mode);
|
||||
params->tstamp_mode = pcm->tstamp_mode;
|
||||
params->period_step = pcm->period_step;
|
||||
params->sleep_min = pcm->sleep_min;
|
||||
params->avail_min = pcm->avail_min;
|
||||
|
|
@ -3537,7 +3541,7 @@ int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_s
|
|||
{
|
||||
assert(pcm && params);
|
||||
assert(val <= SND_PCM_TSTAMP_LAST);
|
||||
params->tstamp_mode = snd_enum_to_int(val);
|
||||
params->tstamp_mode = val;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -3549,7 +3553,7 @@ int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_s
|
|||
snd_pcm_tstamp_t snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params)
|
||||
{
|
||||
assert(params);
|
||||
return snd_int_to_enum(params->tstamp_mode);
|
||||
return params->tstamp_mode;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -3829,7 +3833,7 @@ void snd_pcm_status_copy(snd_pcm_status_t *dst, const snd_pcm_status_t *src)
|
|||
snd_pcm_state_t snd_pcm_status_get_state(const snd_pcm_status_t *obj)
|
||||
{
|
||||
assert(obj);
|
||||
return snd_int_to_enum(obj->state);
|
||||
return obj->state;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -3961,7 +3965,7 @@ unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj)
|
|||
snd_pcm_stream_t snd_pcm_info_get_stream(const snd_pcm_info_t *obj)
|
||||
{
|
||||
assert(obj);
|
||||
return snd_int_to_enum(obj->stream);
|
||||
return obj->stream;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -4016,7 +4020,7 @@ const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj)
|
|||
snd_pcm_class_t snd_pcm_info_get_class(const snd_pcm_info_t *obj)
|
||||
{
|
||||
assert(obj);
|
||||
return snd_int_to_enum(obj->dev_class);
|
||||
return obj->dev_class;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -4027,7 +4031,7 @@ snd_pcm_class_t snd_pcm_info_get_class(const snd_pcm_info_t *obj)
|
|||
snd_pcm_subclass_t snd_pcm_info_get_subclass(const snd_pcm_info_t *obj)
|
||||
{
|
||||
assert(obj);
|
||||
return snd_int_to_enum(obj->dev_subclass);
|
||||
return obj->dev_subclass;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -4082,7 +4086,7 @@ void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val)
|
|||
void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val)
|
||||
{
|
||||
assert(obj);
|
||||
obj->stream = snd_enum_to_int(val);
|
||||
obj->stream = val;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -4183,7 +4187,7 @@ snd_pcm_sframes_t snd_pcm_read_areas(snd_pcm_t *pcm, const snd_pcm_channel_area_
|
|||
if (size > pcm->xfer_align)
|
||||
size -= size % pcm->xfer_align;
|
||||
|
||||
switch (snd_enum_to_int(state)) {
|
||||
switch (state) {
|
||||
case SND_PCM_STATE_PREPARED:
|
||||
if (size >= pcm->start_threshold) {
|
||||
err = snd_pcm_start(pcm);
|
||||
|
|
@ -4267,7 +4271,7 @@ snd_pcm_sframes_t snd_pcm_write_areas(snd_pcm_t *pcm, const snd_pcm_channel_area
|
|||
if (size > pcm->xfer_align)
|
||||
size -= size % pcm->xfer_align;
|
||||
|
||||
switch (snd_enum_to_int(state)) {
|
||||
switch (state) {
|
||||
case SND_PCM_STATE_PREPARED:
|
||||
case SND_PCM_STATE_RUNNING:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -545,7 +545,7 @@ int snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name, int card, int device, in
|
|||
if ((ret = snd_ctl_hw_open(&ctl, NULL, card, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
switch (snd_enum_to_int(stream)) {
|
||||
switch (stream) {
|
||||
case SND_PCM_STREAM_PLAYBACK:
|
||||
filefmt = SNDRV_FILE_PCM_STREAM_PLAYBACK;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
*/
|
||||
int snd_pcm_format_signed(snd_pcm_format_t format)
|
||||
{
|
||||
switch (snd_enum_to_int(format)) {
|
||||
switch (format) {
|
||||
case SNDRV_PCM_FORMAT_S8:
|
||||
case SNDRV_PCM_FORMAT_S16_LE:
|
||||
case SNDRV_PCM_FORMAT_S16_BE:
|
||||
|
|
@ -88,7 +88,7 @@ int snd_pcm_format_linear(snd_pcm_format_t format)
|
|||
*/
|
||||
int snd_pcm_format_little_endian(snd_pcm_format_t format)
|
||||
{
|
||||
switch (snd_enum_to_int(format)) {
|
||||
switch (format) {
|
||||
case SNDRV_PCM_FORMAT_S16_LE:
|
||||
case SNDRV_PCM_FORMAT_U16_LE:
|
||||
case SNDRV_PCM_FORMAT_S24_LE:
|
||||
|
|
@ -150,7 +150,7 @@ int snd_pcm_format_cpu_endian(snd_pcm_format_t format)
|
|||
*/
|
||||
int snd_pcm_format_width(snd_pcm_format_t format)
|
||||
{
|
||||
switch (snd_enum_to_int(format)) {
|
||||
switch (format) {
|
||||
case SNDRV_PCM_FORMAT_S8:
|
||||
case SNDRV_PCM_FORMAT_U8:
|
||||
return 8;
|
||||
|
|
@ -194,7 +194,7 @@ int snd_pcm_format_width(snd_pcm_format_t format)
|
|||
*/
|
||||
int snd_pcm_format_physical_width(snd_pcm_format_t format)
|
||||
{
|
||||
switch (snd_enum_to_int(format)) {
|
||||
switch (format) {
|
||||
case SNDRV_PCM_FORMAT_S8:
|
||||
case SNDRV_PCM_FORMAT_U8:
|
||||
return 8;
|
||||
|
|
@ -237,7 +237,7 @@ int snd_pcm_format_physical_width(snd_pcm_format_t format)
|
|||
*/
|
||||
ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples)
|
||||
{
|
||||
switch (snd_enum_to_int(format)) {
|
||||
switch (format) {
|
||||
case SNDRV_PCM_FORMAT_S8:
|
||||
case SNDRV_PCM_FORMAT_U8:
|
||||
return samples;
|
||||
|
|
@ -283,7 +283,7 @@ ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples)
|
|||
*/
|
||||
u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format)
|
||||
{
|
||||
switch (snd_enum_to_int(format)) {
|
||||
switch (format) {
|
||||
case SNDRV_PCM_FORMAT_S8:
|
||||
case SNDRV_PCM_FORMAT_S16_LE:
|
||||
case SNDRV_PCM_FORMAT_S16_BE:
|
||||
|
|
@ -518,5 +518,5 @@ snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_end
|
|||
default:
|
||||
return SND_PCM_FORMAT_UNKNOWN;
|
||||
}
|
||||
return snd_int_to_enum(((int(*)[2][2])linear_formats)[width][!!unsignd][!!big_endian]);
|
||||
return ((int(*)[2][2])linear_formats)[width][!!unsignd][!!big_endian];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ int snd_pcm_channel_info(snd_pcm_t *pcm, snd_pcm_channel_info_t *info)
|
|||
int snd_pcm_channel_info_shm(snd_pcm_t *pcm, snd_pcm_channel_info_t *info,
|
||||
int shmid)
|
||||
{
|
||||
switch (snd_enum_to_int(pcm->access)) {
|
||||
switch (pcm->access) {
|
||||
case SND_PCM_ACCESS_MMAP_INTERLEAVED:
|
||||
case SND_PCM_ACCESS_RW_INTERLEAVED:
|
||||
info->first = info->channel * pcm->sample_bits;
|
||||
|
|
@ -367,7 +367,7 @@ snd_pcm_sframes_t snd_pcm_write_mmap(snd_pcm_t *pcm, snd_pcm_uframes_t size)
|
|||
snd_pcm_uframes_t cont = pcm->buffer_size - offset;
|
||||
if (cont < frames)
|
||||
frames = cont;
|
||||
switch (snd_enum_to_int(pcm->access)) {
|
||||
switch (pcm->access) {
|
||||
case SND_PCM_ACCESS_MMAP_INTERLEAVED:
|
||||
{
|
||||
const snd_pcm_channel_area_t *a = snd_pcm_mmap_areas(pcm);
|
||||
|
|
@ -413,7 +413,7 @@ snd_pcm_sframes_t snd_pcm_read_mmap(snd_pcm_t *pcm, snd_pcm_uframes_t size)
|
|||
snd_pcm_uframes_t cont = pcm->buffer_size - offset;
|
||||
if (cont < frames)
|
||||
frames = cont;
|
||||
switch (snd_enum_to_int(pcm->access)) {
|
||||
switch (pcm->access) {
|
||||
case SND_PCM_ACCESS_MMAP_INTERLEAVED:
|
||||
{
|
||||
const snd_pcm_channel_area_t *a = snd_pcm_mmap_areas(pcm);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ static int snd_pcm_null_async(snd_pcm_t *pcm ATTRIBUTE_UNUSED, int sig ATTRIBUTE
|
|||
static int snd_pcm_null_info(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_info_t * info)
|
||||
{
|
||||
memset(info, 0, sizeof(*info));
|
||||
info->stream = snd_enum_to_int(pcm->stream);
|
||||
info->stream = pcm->stream;
|
||||
info->card = -1;
|
||||
strncpy(info->id, pcm->name, sizeof(info->id));
|
||||
strncpy(info->name, pcm->name, sizeof(info->name));
|
||||
|
|
@ -74,7 +74,7 @@ static int snd_pcm_null_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
|
|||
{
|
||||
snd_pcm_null_t *null = pcm->private_data;
|
||||
memset(status, 0, sizeof(*status));
|
||||
status->state = snd_enum_to_int(null->state);
|
||||
status->state = null->state;
|
||||
status->trigger_tstamp = null->trigger_tstamp;
|
||||
gettimeofday(&status->tstamp, 0);
|
||||
status->avail = pcm->buffer_size;
|
||||
|
|
@ -154,7 +154,7 @@ static int snd_pcm_null_pause(snd_pcm_t *pcm, int enable)
|
|||
static snd_pcm_sframes_t snd_pcm_null_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
|
||||
{
|
||||
snd_pcm_null_t *null = pcm->private_data;
|
||||
switch (snd_enum_to_int(null->state)) {
|
||||
switch (null->state) {
|
||||
case SND_PCM_STATE_RUNNING:
|
||||
snd_pcm_mmap_hw_backward(pcm, frames);
|
||||
/* Fall through */
|
||||
|
|
@ -169,7 +169,7 @@ static snd_pcm_sframes_t snd_pcm_null_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t f
|
|||
static snd_pcm_sframes_t snd_pcm_null_fwd(snd_pcm_t *pcm, snd_pcm_uframes_t size)
|
||||
{
|
||||
snd_pcm_null_t *null = pcm->private_data;
|
||||
switch (snd_enum_to_int(null->state)) {
|
||||
switch (null->state) {
|
||||
case SND_PCM_STATE_RUNNING:
|
||||
snd_pcm_mmap_hw_forward(pcm, size);
|
||||
/* Fall through */
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ int snd_pcm_hw_param_set_integer(snd_pcm_t *pcm,
|
|||
{
|
||||
snd_pcm_hw_params_t save;
|
||||
int err;
|
||||
switch (snd_enum_to_int(mode)) {
|
||||
switch (mode) {
|
||||
case SND_CHANGE:
|
||||
break;
|
||||
case SND_TRY:
|
||||
|
|
@ -373,7 +373,7 @@ int snd_pcm_hw_param_set_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
|||
{
|
||||
snd_pcm_hw_params_t save;
|
||||
int err;
|
||||
switch (snd_enum_to_int(mode)) {
|
||||
switch (mode) {
|
||||
case SND_CHANGE:
|
||||
break;
|
||||
case SND_TRY:
|
||||
|
|
@ -445,7 +445,7 @@ int snd_pcm_hw_param_set_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
|||
{
|
||||
snd_pcm_hw_params_t save;
|
||||
int err;
|
||||
switch (snd_enum_to_int(mode)) {
|
||||
switch (mode) {
|
||||
case SND_CHANGE:
|
||||
break;
|
||||
case SND_TRY:
|
||||
|
|
@ -553,7 +553,7 @@ int snd_pcm_hw_param_set_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
|||
{
|
||||
snd_pcm_hw_params_t save;
|
||||
int err;
|
||||
switch (snd_enum_to_int(mode)) {
|
||||
switch (mode) {
|
||||
case SND_CHANGE:
|
||||
break;
|
||||
case SND_TRY:
|
||||
|
|
@ -645,7 +645,7 @@ int snd_pcm_hw_param_set(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
|||
{
|
||||
snd_pcm_hw_params_t save;
|
||||
int err;
|
||||
switch (snd_enum_to_int(mode)) {
|
||||
switch (mode) {
|
||||
case SND_CHANGE:
|
||||
break;
|
||||
case SND_TRY:
|
||||
|
|
@ -700,7 +700,7 @@ int snd_pcm_hw_param_set_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
|||
{
|
||||
snd_pcm_hw_params_t save;
|
||||
int err;
|
||||
switch (snd_enum_to_int(mode)) {
|
||||
switch (mode) {
|
||||
case SND_CHANGE:
|
||||
break;
|
||||
case SND_TRY:
|
||||
|
|
@ -1049,13 +1049,13 @@ void snd_pcm_hw_param_dump(const snd_pcm_hw_params_t *params,
|
|||
const char *s;
|
||||
switch (var) {
|
||||
case SND_PCM_HW_PARAM_ACCESS:
|
||||
s = snd_pcm_access_name(snd_int_to_enum(k));
|
||||
s = snd_pcm_access_name(k);
|
||||
break;
|
||||
case SND_PCM_HW_PARAM_FORMAT:
|
||||
s = snd_pcm_format_name(snd_int_to_enum(k));
|
||||
s = snd_pcm_format_name(k);
|
||||
break;
|
||||
case SND_PCM_HW_PARAM_SUBFORMAT:
|
||||
s = snd_pcm_subformat_name(snd_int_to_enum(k));
|
||||
s = snd_pcm_subformat_name(k);
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
|
|
@ -1100,7 +1100,7 @@ const char *snd_pcm_hw_param_names[] = {
|
|||
const char *snd_pcm_hw_param_name(snd_pcm_hw_param_t param)
|
||||
{
|
||||
assert(param <= SND_PCM_HW_PARAM_LAST);
|
||||
return snd_pcm_hw_param_names[snd_enum_to_int(param)];
|
||||
return snd_pcm_hw_param_names[param];
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
|
@ -1561,7 +1561,7 @@ static int snd_pcm_hw_rule_format(snd_pcm_hw_params_t *params,
|
|||
snd_pcm_format_t k;
|
||||
snd_mask_t *mask = hw_param_mask(params, rule->var);
|
||||
snd_interval_t *i = hw_param_interval(params, rule->deps[0]);
|
||||
for (k = 0; k <= SND_PCM_FORMAT_LAST; snd_enum_incr(k)) {
|
||||
for (k = 0; k <= SND_PCM_FORMAT_LAST; k++) {
|
||||
int bits;
|
||||
if (!snd_pcm_format_mask_test(mask, k))
|
||||
continue;
|
||||
|
|
@ -1589,7 +1589,7 @@ static int snd_pcm_hw_rule_sample_bits(snd_pcm_hw_params_t *params,
|
|||
int c, changed = 0;
|
||||
min = UINT_MAX;
|
||||
max = 0;
|
||||
for (k = 0; k <= SND_PCM_FORMAT_LAST; snd_enum_incr(k)) {
|
||||
for (k = 0; k <= SND_PCM_FORMAT_LAST; k++) {
|
||||
int bits;
|
||||
if (!snd_pcm_format_mask_test(mask, k))
|
||||
continue;
|
||||
|
|
@ -2022,7 +2022,7 @@ static int snd_pcm_sw_params_default(snd_pcm_t *pcm, snd_pcm_sw_params_t *params
|
|||
{
|
||||
assert(pcm && params);
|
||||
assert(pcm->setup);
|
||||
params->tstamp_mode = snd_enum_to_int(SND_PCM_TSTAMP_NONE);
|
||||
params->tstamp_mode = SND_PCM_TSTAMP_NONE;
|
||||
params->period_step = 1;
|
||||
params->sleep_min = 0;
|
||||
params->avail_min = pcm->period_size;
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ static snd_pcm_format_t snd_pcm_plug_slave_format(snd_pcm_format_t format, const
|
|||
return format;
|
||||
if (!snd_pcm_format_mask_test(&lin, format)) {
|
||||
unsigned int i;
|
||||
switch (snd_enum_to_int(format)) {
|
||||
switch (format) {
|
||||
case SND_PCM_FORMAT_MU_LAW:
|
||||
case SND_PCM_FORMAT_A_LAW:
|
||||
case SND_PCM_FORMAT_IMA_ADPCM:
|
||||
|
|
@ -179,9 +179,9 @@ static snd_pcm_format_t snd_pcm_plug_slave_format(snd_pcm_format_t format, const
|
|||
}
|
||||
|
||||
#define SND_PCM_FMTBIT_PLUG (SND_PCM_FMTBIT_LINEAR | \
|
||||
(1 << snd_enum_to_int(SND_PCM_FORMAT_MU_LAW)) | \
|
||||
(1 << snd_enum_to_int(SND_PCM_FORMAT_A_LAW)) | \
|
||||
(1 << snd_enum_to_int(SND_PCM_FORMAT_IMA_ADPCM)))
|
||||
(1 << SND_PCM_FORMAT_MU_LAW) | \
|
||||
(1 << SND_PCM_FORMAT_A_LAW) | \
|
||||
(1 << SND_PCM_FORMAT_IMA_ADPCM))
|
||||
|
||||
|
||||
static void snd_pcm_plug_clear(snd_pcm_t *pcm)
|
||||
|
|
@ -299,7 +299,7 @@ static int snd_pcm_plug_change_format(snd_pcm_t *pcm, snd_pcm_t **new, snd_pcm_p
|
|||
clt->channels != slv->channels)
|
||||
return 0;
|
||||
cfmt = clt->format;
|
||||
switch (snd_enum_to_int(clt->format)) {
|
||||
switch (clt->format) {
|
||||
case SND_PCM_FORMAT_MU_LAW:
|
||||
f = snd_pcm_mulaw_open;
|
||||
break;
|
||||
|
|
@ -320,7 +320,7 @@ static int snd_pcm_plug_change_format(snd_pcm_t *pcm, snd_pcm_t **new, snd_pcm_p
|
|||
clt->rate == slv->rate &&
|
||||
clt->channels == clt->channels)
|
||||
return 0;
|
||||
switch (snd_enum_to_int(slv->format)) {
|
||||
switch (slv->format) {
|
||||
case SND_PCM_FORMAT_MU_LAW:
|
||||
f = snd_pcm_mulaw_open;
|
||||
break;
|
||||
|
|
@ -455,7 +455,7 @@ static int snd_pcm_plug_hw_refine_schange(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
|
|||
sformat_mask = snd_pcm_hw_param_get_mask(sparams,
|
||||
SND_PCM_HW_PARAM_FORMAT);
|
||||
snd_mask_none(&sfmt_mask);
|
||||
for (format = 0; format <= SND_PCM_FORMAT_LAST; snd_enum_incr(format)) {
|
||||
for (format = 0; format <= SND_PCM_FORMAT_LAST; format++) {
|
||||
snd_pcm_format_t f;
|
||||
if (!snd_pcm_format_mask_test(format_mask, format))
|
||||
continue;
|
||||
|
|
@ -530,7 +530,7 @@ static int snd_pcm_plug_hw_refine_cchange(snd_pcm_t *pcm ATTRIBUTE_UNUSED,
|
|||
sformat_mask = snd_pcm_hw_param_get_mask(sparams,
|
||||
SND_PCM_HW_PARAM_FORMAT);
|
||||
snd_mask_none(&fmt_mask);
|
||||
for (format = 0; format <= SND_PCM_FORMAT_LAST; snd_enum_incr(format)) {
|
||||
for (format = 0; format <= SND_PCM_FORMAT_LAST; format++) {
|
||||
snd_pcm_format_t f;
|
||||
if (!snd_pcm_format_mask_test(format_mask, format))
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ static snd_pcm_uframes_t _snd_pcm_share_slave_forward(snd_pcm_share_slave_t *sla
|
|||
list_for_each(i, &slave->clients) {
|
||||
snd_pcm_share_t *share = list_entry(i, snd_pcm_share_t, list);
|
||||
snd_pcm_t *pcm = share->pcm;
|
||||
switch (snd_enum_to_int(share->state)) {
|
||||
switch (share->state) {
|
||||
case SND_PCM_STATE_RUNNING:
|
||||
break;
|
||||
case SND_PCM_STATE_DRAINING:
|
||||
|
|
@ -193,7 +193,7 @@ static snd_pcm_uframes_t _snd_pcm_share_missing(snd_pcm_t *pcm)
|
|||
snd_pcm_uframes_t missing = INT_MAX;
|
||||
snd_pcm_sframes_t ready_missing;
|
||||
// printf("state=%d hw_ptr=%d appl_ptr=%d slave appl_ptr=%d safety=%d silence=%d\n", share->state, slave->hw_ptr, share->appl_ptr, *slave->pcm->appl_ptr, slave->safety_threshold, slave->silence_frames);
|
||||
switch (snd_enum_to_int(share->state)) {
|
||||
switch (share->state) {
|
||||
case SND_PCM_STATE_RUNNING:
|
||||
break;
|
||||
case SND_PCM_STATE_DRAINING:
|
||||
|
|
@ -232,7 +232,7 @@ static snd_pcm_uframes_t _snd_pcm_share_missing(snd_pcm_t *pcm)
|
|||
missing = safety_missing;
|
||||
}
|
||||
}
|
||||
switch (snd_enum_to_int(share->state)) {
|
||||
switch (share->state) {
|
||||
case SND_PCM_STATE_DRAINING:
|
||||
if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
|
||||
if (hw_avail <= 0) {
|
||||
|
|
@ -683,7 +683,7 @@ static int snd_pcm_share_status(snd_pcm_t *pcm, snd_pcm_status_t *status)
|
|||
goto _end;
|
||||
_notrunning:
|
||||
status->delay = sd + d;
|
||||
status->state = snd_enum_to_int(share->state);
|
||||
status->state = share->state;
|
||||
status->trigger_tstamp = share->trigger_tstamp;
|
||||
_end:
|
||||
Pthread_mutex_unlock(&slave->mutex);
|
||||
|
|
@ -702,7 +702,7 @@ static int _snd_pcm_share_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
|
|||
snd_pcm_share_slave_t *slave = share->slave;
|
||||
int err = 0;
|
||||
snd_pcm_sframes_t sd;
|
||||
switch (snd_enum_to_int(share->state)) {
|
||||
switch (share->state) {
|
||||
case SND_PCM_STATE_XRUN:
|
||||
return -EPIPE;
|
||||
case SND_PCM_STATE_RUNNING:
|
||||
|
|
@ -919,7 +919,7 @@ static snd_pcm_sframes_t _snd_pcm_share_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
|
|||
snd_pcm_share_t *share = pcm->private_data;
|
||||
snd_pcm_share_slave_t *slave = share->slave;
|
||||
snd_pcm_sframes_t n;
|
||||
switch (snd_enum_to_int(share->state)) {
|
||||
switch (share->state) {
|
||||
case SND_PCM_STATE_RUNNING:
|
||||
break;
|
||||
case SND_PCM_STATE_PREPARED:
|
||||
|
|
@ -1007,7 +1007,7 @@ static int snd_pcm_share_drain(snd_pcm_t *pcm)
|
|||
snd_pcm_share_slave_t *slave = share->slave;
|
||||
int err = 0;
|
||||
Pthread_mutex_lock(&slave->mutex);
|
||||
switch (snd_enum_to_int(share->state)) {
|
||||
switch (share->state) {
|
||||
case SND_PCM_STATE_OPEN:
|
||||
err = -EBADFD;
|
||||
goto _end;
|
||||
|
|
@ -1020,7 +1020,7 @@ static int snd_pcm_share_drain(snd_pcm_t *pcm)
|
|||
break;
|
||||
}
|
||||
if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
|
||||
switch (snd_enum_to_int(share->state)) {
|
||||
switch (share->state) {
|
||||
case SND_PCM_STATE_XRUN:
|
||||
share->state = SND_PCM_STATE_SETUP;
|
||||
goto _end;
|
||||
|
|
@ -1037,7 +1037,7 @@ static int snd_pcm_share_drain(snd_pcm_t *pcm)
|
|||
break;
|
||||
}
|
||||
} else {
|
||||
switch (snd_enum_to_int(share->state)) {
|
||||
switch (share->state) {
|
||||
case SND_PCM_STATE_RUNNING:
|
||||
_snd_pcm_share_stop(pcm, SND_PCM_STATE_DRAINING);
|
||||
_snd_pcm_share_update(pcm);
|
||||
|
|
@ -1065,7 +1065,7 @@ static int snd_pcm_share_drop(snd_pcm_t *pcm)
|
|||
snd_pcm_share_slave_t *slave = share->slave;
|
||||
int err = 0;
|
||||
Pthread_mutex_lock(&slave->mutex);
|
||||
switch (snd_enum_to_int(share->state)) {
|
||||
switch (share->state) {
|
||||
case SND_PCM_STATE_OPEN:
|
||||
err = -EBADFD;
|
||||
goto _end;
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ static snd_pcm_state_t snd_pcm_shm_state(snd_pcm_t *pcm)
|
|||
snd_pcm_shm_t *shm = pcm->private_data;
|
||||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
ctrl->cmd = SND_PCM_IOCTL_STATE;
|
||||
return snd_int_to_enum(snd_pcm_shm_action(pcm));
|
||||
return snd_pcm_shm_action(pcm);
|
||||
}
|
||||
|
||||
static int snd_pcm_shm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
|
||||
|
|
@ -591,7 +591,7 @@ int snd_pcm_shm_open(snd_pcm_t **pcmp, const char *name, const char *sockname, c
|
|||
memcpy(req->name, sname, snamelen);
|
||||
req->dev_type = SND_DEV_TYPE_PCM;
|
||||
req->transport_type = SND_TRANSPORT_TYPE_SHM;
|
||||
req->stream = snd_enum_to_int(stream);
|
||||
req->stream = stream;
|
||||
req->mode = mode;
|
||||
req->namelen = snamelen;
|
||||
err = write(sock, req, reqlen);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue