summaryrefslogtreecommitdiff
path: root/include/control.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-10-24 13:04:14 +0200
committerTakashi Iwai <tiwai@suse.de>2007-10-24 13:04:14 +0200
commitf38e5feca3723603beea79c8f78e39414ff66bbd (patch)
tree406f9932ca0fc6f191f1c199cb3cd558c8b2ca53 /include/control.h
parent631f7cde828e5f2ee4442cf3d02f01b00d12bb31 (diff)
downloadalsa-lib-f38e5feca3723603beea79c8f78e39414ff66bbd.tar.gz
Export dB conversion helper functions
Export helper functions to convert dB level and range. snd_tlv_*dB*() are to convert dB level or range directly from TLV data. snd_ctl_*dB*() are to get dB level or range from a control element.
Diffstat (limited to 'include/control.h')
-rw-r--r--include/control.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/control.h b/include/control.h
index 33faea01..e61362d0 100644
--- a/include/control.h
+++ b/include/control.h
@@ -442,6 +442,21 @@ const void * snd_ctl_elem_value_get_bytes(const snd_ctl_elem_value_t *obj);
void snd_ctl_elem_value_get_iec958(const snd_ctl_elem_value_t *obj, snd_aes_iec958_t *ptr);
void snd_ctl_elem_value_set_iec958(snd_ctl_elem_value_t *obj, const snd_aes_iec958_t *ptr);
+int snd_tlv_parse_dB_info(unsigned int *tlv, unsigned int tlv_size,
+ unsigned int **db_tlvp);
+int snd_tlv_get_dB_range(unsigned int *tlv, long rangemin, long rangemax,
+ long *min, long *max);
+int snd_tlv_convert_to_dB(unsigned int *tlv, long rangemin, long rangemax,
+ long volume, long *db_gain);
+int snd_tlv_convert_from_dB(unsigned int *tlv, long rangemin, long rangemax,
+ long db_gain, long *value, int xdir);
+int snd_ctl_get_dB_range(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
+ long *min, long *max);
+int snd_ctl_convert_to_dB(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
+ long volume, long *db_gain);
+int snd_ctl_convert_from_dB(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id,
+ long db_gain, long *value, int xdir);
+
/**
* \defgroup HControl High level Control Interface
* \ingroup Control