diff options
author | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2012-04-19 16:48:56 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2012-04-19 16:48:56 +0200 |
commit | 8abab6618860f9d8688a4653de258c8673bfc662 (patch) | |
tree | abf0b6fe966c535ebdb33eb21ee87d99e6678877 /src/cameras/uca-pco-camera.c | |
parent | b7b8f2fe74b02780774c51f740519469982231a1 (diff) | |
parent | 42e3c64fa57039d7673c61f909b5fd40a437bdfd (diff) | |
download | uca-8abab6618860f9d8688a4653de258c8673bfc662.tar.gz uca-8abab6618860f9d8688a4653de258c8673bfc662.tar.bz2 uca-8abab6618860f9d8688a4653de258c8673bfc662.tar.xz uca-8abab6618860f9d8688a4653de258c8673bfc662.zip |
Merge branch 'rewrite-props'
Diffstat (limited to 'src/cameras/uca-pco-camera.c')
-rw-r--r-- | src/cameras/uca-pco-camera.c | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/src/cameras/uca-pco-camera.c b/src/cameras/uca-pco-camera.c index a2eb259..b808766 100644 --- a/src/cameras/uca-pco-camera.c +++ b/src/cameras/uca-pco-camera.c @@ -70,7 +70,12 @@ GQuark uca_pco_camera_error_quark() } enum { - PROP_0, + PROP_NAME = N_BASE_PROPERTIES, + PROP_COOLING_POINT, + N_PROPERTIES +}; + +static gint base_overrideables[] = { PROP_SENSOR_WIDTH, PROP_SENSOR_HEIGHT, PROP_SENSOR_BITDEPTH, @@ -85,28 +90,7 @@ enum { PROP_ROI_HEIGHT, PROP_HAS_STREAMING, PROP_HAS_CAMRAM_RECORDING, - N_INTERFACE_PROPERTIES, - - PROP_NAME, - PROP_COOLING_POINT, - N_PROPERTIES -}; - -static const gchar *base_overrideables[N_PROPERTIES] = { - "sensor-width", - "sensor-height", - "sensor-bitdepth", - "sensor-horizontal-binning", - "sensor-horizontal-binnings", - "sensor-vertical-binning", - "sensor-vertical-binnings", - "max-frame-rate", - "roi-x", - "roi-y", - "roi-width", - "roi-height", - "has-streaming", - "has-camram-recording" + 0 }; static GParamSpec *pco_properties[N_PROPERTIES] = { NULL, }; @@ -572,8 +556,8 @@ static void uca_pco_camera_class_init(UcaPcoCameraClass *klass) camera_class->start_readout = uca_pco_camera_start_readout; camera_class->grab = uca_pco_camera_grab; - for (guint id = PROP_0 + 1; id < N_INTERFACE_PROPERTIES; id++) - g_object_class_override_property(gobject_class, id, base_overrideables[id-1]); + for (guint i = 0; base_overrideables[i] != 0; i++) + g_object_class_override_property(gobject_class, base_overrideables[i], uca_camera_props[base_overrideables[i]]); pco_properties[PROP_NAME] = g_param_spec_string("name", @@ -592,7 +576,7 @@ static void uca_pco_camera_class_init(UcaPcoCameraClass *klass) "Cooling point of the camera", 0, 10, 5, G_PARAM_READWRITE); - for (guint id = N_INTERFACE_PROPERTIES + 1; id < N_PROPERTIES; id++) + for (guint id = N_BASE_PROPERTIES; id < N_PROPERTIES; id++) g_object_class_install_property(gobject_class, id, pco_properties[id]); g_type_class_add_private(klass, sizeof(UcaPcoCameraPrivate)); |