mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Added snd_config_get_ireal function
This commit is contained in:
parent
81512cb3f3
commit
aa68b89c37
2 changed files with 22 additions and 0 deletions
|
|
@ -112,6 +112,7 @@ int snd_config_set_pointer(snd_config_t *config, const void *ptr);
|
||||||
int snd_config_get_id(snd_config_t *config, const char **value);
|
int snd_config_get_id(snd_config_t *config, const char **value);
|
||||||
int snd_config_get_integer(snd_config_t *config, long *value);
|
int snd_config_get_integer(snd_config_t *config, long *value);
|
||||||
int snd_config_get_real(snd_config_t *config, double *value);
|
int snd_config_get_real(snd_config_t *config, double *value);
|
||||||
|
int snd_config_get_ireal(snd_config_t *config, double *value);
|
||||||
int snd_config_get_string(snd_config_t *config, const char **value);
|
int snd_config_get_string(snd_config_t *config, const char **value);
|
||||||
int snd_config_get_ascii(snd_config_t *config, char **value);
|
int snd_config_get_ascii(snd_config_t *config, char **value);
|
||||||
int snd_config_get_pointer(snd_config_t *config, const void **value);
|
int snd_config_get_pointer(snd_config_t *config, const void **value);
|
||||||
|
|
|
||||||
21
src/conf.c
21
src/conf.c
|
|
@ -1808,6 +1808,27 @@ int snd_config_get_real(snd_config_t *config, double *ptr)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Get the value of a real or integer config node
|
||||||
|
* \param config Config node handle
|
||||||
|
* \param ptr Returned value pointer
|
||||||
|
* \return 0 on success otherwise a negative error code
|
||||||
|
*
|
||||||
|
* Note: If the config type is integer, it is converted
|
||||||
|
* to the double type on the fly.
|
||||||
|
*/
|
||||||
|
int snd_config_get_ireal(snd_config_t *config, double *ptr)
|
||||||
|
{
|
||||||
|
assert(config && ptr);
|
||||||
|
if (config->type == SND_CONFIG_TYPE_REAL)
|
||||||
|
*ptr = config->u.real;
|
||||||
|
else if (config->type == SND_CONFIG_TYPE_INTEGER)
|
||||||
|
*ptr = config->u.integer;
|
||||||
|
else
|
||||||
|
return -EINVAL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Get the value of a string config node
|
* \brief Get the value of a string config node
|
||||||
* \param config Config node handle
|
* \param config Config node handle
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue