diff options
author | Mihael Koep <koep@schneide.com> | 2012-09-06 18:02:10 +0200 |
---|---|---|
committer | Mihael Koep <koep@schneide.com> | 2012-09-06 18:02:10 +0200 |
commit | 7122b2c6fd1ae34438d019c72c10ec84776171d6 (patch) | |
tree | 270873e262d14a7ab15b493f8ae431b18c5dfc1b /src/cameras/uca-dexela-camera.c | |
parent | 2fad826eb9b5ca6a2825193e864545e2d4976966 (diff) | |
download | libuca-7122b2c6fd1ae34438d019c72c10ec84776171d6.tar.gz libuca-7122b2c6fd1ae34438d019c72c10ec84776171d6.tar.bz2 libuca-7122b2c6fd1ae34438d019c72c10ec84776171d6.tar.xz libuca-7122b2c6fd1ae34438d019c72c10ec84776171d6.zip |
Implement exposure time property.
Diffstat (limited to 'src/cameras/uca-dexela-camera.c')
-rw-r--r-- | src/cameras/uca-dexela-camera.c | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/src/cameras/uca-dexela-camera.c b/src/cameras/uca-dexela-camera.c index b68f40e..14d7899 100644 --- a/src/cameras/uca-dexela-camera.c +++ b/src/cameras/uca-dexela-camera.c @@ -79,22 +79,6 @@ UcaDexelaCamera *uca_dexela_camera_new(GError **error) return camera; } -static void uca_dexela_camera_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) -{ - //UcaDexelaCameraPrivate *priv = UCA_DEXELA_CAMERA_GET_PRIVATE(object); - - switch (property_id) { - case PROP_EXPOSURE_TIME: - { - // TODO set exposure time - } - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); - return; - } -} - static void uca_dexela_camera_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { //UcaDexelaCameraPrivate *priv = UCA_DEXELA_CAMERA_GET_PRIVATE(object); @@ -109,7 +93,7 @@ static void uca_dexela_camera_get_property(GObject *object, guint property_id, G } case PROP_EXPOSURE_TIME: { - // TODO read exposure time + g_value_set_double(value, getExposureTimeMicros() / 10e6d); break; } default: @@ -120,24 +104,46 @@ static void uca_dexela_camera_get_property(GObject *object, guint property_id, G } } +static void uca_dexela_camera_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + //UcaDexelaCameraPrivate *priv = UCA_DEXELA_CAMERA_GET_PRIVATE(object); + + switch (property_id) { + case PROP_EXPOSURE_TIME: + { + const gdouble exposureTimeInSeconds = g_value_get_double(value); + setExposureTimeMicros(exposureTimeInSeconds * 10e6d); + } + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); + return; + } +} + static void uca_dexela_camera_start_recording(UcaCamera *camera, GError **error) { + g_debug("start recording called"); } static void uca_dexela_camera_stop_recording(UcaCamera *camera, GError **error) { + g_debug("stop recording called"); } static void uca_dexela_camera_start_readout(UcaCamera *camera, GError **error) { + g_debug("start readout called"); } static void uca_dexela_camera_trigger(UcaCamera *camera, GError **error) { + g_debug("trigger called"); } static void uca_dexela_camera_grab(UcaCamera *camera, gpointer *data, GError **error) { + g_debug("grab called"); } static void uca_dexela_camera_finalize(GObject *object) @@ -160,9 +166,9 @@ static void uca_dexela_camera_class_init(UcaDexelaCameraClass *klass) camera_class->trigger = uca_dexela_camera_trigger; camera_class->grab = uca_dexela_camera_grab; - for (guint i = 0; base_overrideables[i] != 0; i++) + 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]]); - + } for (guint id = N_BASE_PROPERTIES; id < N_PROPERTIES; id++) { g_object_class_install_property(gobject_class, id, dexela_properties[id]); } |