diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-04-13 14:05:18 +0530 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-05-15 10:09:35 +0530 |
commit | 8d076d09902fe618e69f3d71e42299bffe2af437 (patch) | |
tree | 6160fab6ebfb646e79988efd729e3aed23a20ad8 /src/pulse/format.h | |
parent | 62f56a9f6b01c277a8c4f15625473df4b73bd208 (diff) |
format: Extend properties to handle lists/ranges
This replaces the simple string used by pa_format_info's proplist with a
JSON string (accessed via new API only). This allows us to express lists
and ranges more cleanly, and embed type information for future
extensibility.
We use json-c for JSON parsing. This is a lightweight depdency (32 KB on
my system) and avoids the hassle of having to reinvent a JSON parser.
Also included is a test which verifies functionality and is
valgrind-clean.
Diffstat (limited to 'src/pulse/format.h')
-rw-r--r-- | src/pulse/format.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pulse/format.h b/src/pulse/format.h index b0efe502..0498e68a 100644 --- a/src/pulse/format.h +++ b/src/pulse/format.h @@ -102,6 +102,17 @@ int pa_format_info_is_compatible(pa_format_info *first, pa_format_info *second); /** Return a human-readable string representing the given format. \since 1.0 */ char *pa_format_info_snprint(char *s, size_t l, const pa_format_info *f); +/** Sets an integer property on the given format info */ +void pa_format_info_set_prop_int(pa_format_info *f, const char *key, int value); +/** Sets a property with a list of integer values on the given format info */ +void pa_format_info_set_prop_int_array(pa_format_info *f, const char *key, const int *values, int n_values); +/** Sets a property which can have any value in a given integer range on the given format info */ +void pa_format_info_set_prop_int_range(pa_format_info *f, const char *key, int min, int max); +/** Sets a string property on the given format info */ +void pa_format_info_set_prop_string(pa_format_info *f, const char *key, const char *value); +/** Sets a property with a list of string values on the given format info */ +void pa_format_info_set_prop_string_array(pa_format_info *f, const char *key, const char **values, int n_values); + PA_C_DECL_END #endif |