[aravis] Add arv_device_get_enumeration_feature_available_strings.



commit 1ae698066150c31a6db7134ba20e4186a28ad182
Author: Jure Varlec <jure varlec ad-vega si>
Date:   Sun Jul 1 18:48:21 2012 +0200

    Add arv_device_get_enumeration_feature_available_strings.

 src/arvdevice.c |   30 ++++++++++++++++++++++++++++++
 src/arvdevice.h |    1 +
 2 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/src/arvdevice.c b/src/arvdevice.c
index e2f8153..eda5064 100644
--- a/src/arvdevice.c
+++ b/src/arvdevice.c
@@ -487,6 +487,36 @@ arv_device_get_enumeration_feature_available_values (ArvDevice *device, const ch
 	return values;
 }
 
+const char **
+arv_device_get_enumeration_feature_available_strings (ArvDevice *device, const char *feature, guint *n_values)
+{
+	ArvGcNode *node;
+	GError *error = NULL;
+	const char ** strings = NULL;
+
+	if (n_values != NULL)
+		*n_values = 0;
+
+	g_return_val_if_fail (ARV_IS_DEVICE (device), NULL);
+
+	node = arv_device_get_feature (device, feature);
+
+	if (ARV_IS_GC_ENUMERATION (node))
+		strings = arv_gc_enumeration_get_available_string_values (ARV_GC_ENUMERATION (node), n_values, &error);
+	else
+		arv_warning_device ("[ArvDevice::get_enumeration_feature_available_strings] Node '%s' is not an enumeration",
+				    feature);
+
+	if (error != NULL) {
+		_set_status (device, error->code, error->message);
+		g_error_free (error);
+
+		return NULL;
+	}
+
+	return strings;
+}
+
 ArvDeviceStatus
 arv_device_get_status (ArvDevice *device)
 {
diff --git a/src/arvdevice.h b/src/arvdevice.h
index 41c2c0b..db7c402 100644
--- a/src/arvdevice.h
+++ b/src/arvdevice.h
@@ -114,6 +114,7 @@ void 		arv_device_get_float_feature_bounds 	(ArvDevice *device, const char *feat
 							 double *min, double *max);
 
 gint64 *	arv_device_get_enumeration_feature_available_values	(ArvDevice *device, const char *feature, guint *n_values);
+const char **	arv_device_get_enumeration_feature_available_strings	(ArvDevice *device, const char *feature, guint *n_values);
 
 ArvDeviceStatus arv_device_get_status			(ArvDevice *device);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]