diff options
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)); |