From c7b0d014b3a568ceb2db5d582a57cb7002face5e Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 8 Mar 2011 13:56:00 +0100 Subject: Add more offset properties --- test/control.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/control.c b/test/control.c index baf6ee2..5444755 100644 --- a/test/control.c +++ b/test/control.c @@ -144,18 +144,19 @@ void fill_tree_store(GtkTreeStore *tree_store, struct uca_camera_t *cam) for (int prop_id = 0; prop_id < UCA_PROP_LAST; prop_id++) { property = uca_get_full_property(prop_id); + uint32_t result = UCA_NO_ERROR; switch (property->type) { case uca_string: - cam->get_property(cam, prop_id, value_string); + result = cam->get_property(cam, prop_id, value_string); break; case uca_uint8t: - cam->get_property(cam, prop_id, &value_8); + result = cam->get_property(cam, prop_id, &value_8); g_sprintf(value_string, "%d", value_8); break; case uca_uint32t: - cam->get_property(cam, prop_id, &value_32); + result = cam->get_property(cam, prop_id, &value_32); g_sprintf(value_string, "%d", value_32); break; } @@ -165,6 +166,9 @@ void fill_tree_store(GtkTreeStore *tree_store, struct uca_camera_t *cam) get_first_level_root(tree_store, &iter, tokens[0]); find_recursively(tree_store, &iter, &child, tokens, 1); + if (result == UCA_ERR_PROP_INVALID) + g_sprintf(value_string, "n/a"); + int count = 0; while (tokens[count++] != NULL); -- cgit v1.2.3