utils: Adding a function to get volume from string

The allowed volume formats are dB, % or integer.
For example: 10% or 10db or 10.
This commit is contained in:
Flavio Ceolin 2012-10-24 17:29:45 -02:00 committed by Tanu Kaskinen
parent fe0ba245e5
commit dd31d65217
2 changed files with 45 additions and 0 deletions

View file

@ -34,6 +34,7 @@
#endif
#include <pulse/gccmacro.h>
#include <pulse/volume.h>
#include <pulsecore/macro.h>
#include <pulsecore/socket.h>
@ -83,6 +84,8 @@ void pa_reset_priority(void);
int pa_parse_boolean(const char *s) PA_GCC_PURE;
int pa_parse_volume(const char *s, pa_volume_t *volume);
static inline const char *pa_yes_no(pa_bool_t b) {
return b ? "yes" : "no";
}