summaryrefslogtreecommitdiffstats
path: root/src/cameras
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-04-27 11:28:46 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-04-27 12:25:53 +0200
commit0c9f4799c630c5b26bb866b9074c5a973f0eb92f (patch)
tree34fea5e89548578d7cbb811d6af57d4921f1be05 /src/cameras
parentd2de03fff50637c218317c046ddd3b913afb8e32 (diff)
downloadlibuca-0c9f4799c630c5b26bb866b9074c5a973f0eb92f.tar.gz
libuca-0c9f4799c630c5b26bb866b9074c5a973f0eb92f.tar.bz2
libuca-0c9f4799c630c5b26bb866b9074c5a973f0eb92f.tar.xz
libuca-0c9f4799c630c5b26bb866b9074c5a973f0eb92f.zip
pco: add record modes
Diffstat (limited to 'src/cameras')
-rw-r--r--src/cameras/uca-pco-camera.c60
-rw-r--r--src/cameras/uca-pco-camera.h7
2 files changed, 66 insertions, 1 deletions
diff --git a/src/cameras/uca-pco-camera.c b/src/cameras/uca-pco-camera.c
index cf57352..76664cc 100644
--- a/src/cameras/uca-pco-camera.c
+++ b/src/cameras/uca-pco-camera.c
@@ -77,6 +77,7 @@ enum {
PROP_HAS_DOUBLE_IMAGE_MODE,
PROP_DOUBLE_IMAGE_MODE,
PROP_OFFSET_MODE,
+ PROP_RECORD_MODE,
PROP_COOLING_POINT,
N_PROPERTIES
};
@@ -142,6 +143,29 @@ struct _UcaPcoCameraPrivate {
guint current_image;
};
+/**
+ * UcaPcoCameraRecordMode:
+ * @UCA_PCO_CAMERA_RECORD_MODE_SEQUENCE: Store all frames and stop if necessary
+ * @UCA_PCO_CAMERA_RECORD_MODE_RING_BUFFER: Store frames in ring-buffer fashion
+ * and overwrite if necessary
+ */
+static GType uca_pco_camera_record_mode_get_type(void)
+{
+ static GType record_mode_type = 0;
+
+ if (!record_mode_type) {
+ static GEnumValue record_modes[] = {
+ { UCA_PCO_CAMERA_RECORD_MODE_SEQUENCE, "Store frames in a ring buffer", "ring-buffer" },
+ { UCA_PCO_CAMERA_RECORD_MODE_RING_BUFFER, "Store frames in a ring buffer", "sequence" },
+ { 0, NULL, NULL }
+ };
+
+ record_mode_type = g_enum_register_static("UcaPcoCameraRecordMode", record_modes);
+ }
+
+ return record_mode_type;
+}
+
#define TIMEBASE_INVALID 0xDEAD
static pco_cl_map_entry pco_cl_map[] = {
@@ -540,6 +564,19 @@ static void uca_pco_camera_set_property(GObject *object, guint property_id, cons
}
break;
+ case PROP_RECORD_MODE:
+ {
+ UcaPcoCameraRecordMode mode = (UcaPcoCameraRecordMode) g_value_get_enum(value);
+
+ if (mode == UCA_PCO_CAMERA_RECORD_MODE_SEQUENCE)
+ pco_set_record_mode(priv->pco, 0);
+ else if (mode == UCA_PCO_CAMERA_RECORD_MODE_RING_BUFFER)
+ pco_set_record_mode(priv->pco, 1);
+ else
+ g_warning("Unknown record mode");
+ }
+ break;
+
case PROP_TRIGGER_MODE:
{
UcaCameraTrigger trigger_mode = (UcaCameraTrigger) g_value_get_enum(value);
@@ -685,6 +722,20 @@ static void uca_pco_camera_get_property(GObject *object, guint property_id, GVal
g_value_set_boolean(value, priv->camera_description->has_camram);
break;
+ case PROP_RECORD_MODE:
+ {
+ guint16 mode;
+ pco_get_record_mode(priv->pco, &mode);
+
+ if (mode == 0)
+ g_value_set_enum(value, UCA_PCO_CAMERA_RECORD_MODE_SEQUENCE);
+ else if (mode == 1)
+ g_value_set_enum(value, UCA_PCO_CAMERA_RECORD_MODE_RING_BUFFER);
+ else
+ g_warning("pco record mode not handled");
+ }
+ break;
+
case PROP_TRIGGER_MODE:
{
guint16 mode;
@@ -701,7 +752,7 @@ static void uca_pco_camera_get_property(GObject *object, guint property_id, GVal
g_value_set_enum(value, UCA_CAMERA_TRIGGER_EXTERNAL);
break;
default:
- g_warning("pco trigger mode not handled\n");
+ g_warning("pco trigger mode not handled");
}
}
break;
@@ -838,6 +889,13 @@ static void uca_pco_camera_class_init(UcaPcoCameraClass *klass)
"Use offset mode",
"Use offset mode",
FALSE, G_PARAM_READWRITE);
+
+ pco_properties[PROP_RECORD_MODE] =
+ g_param_spec_enum("record-mode",
+ "Record mode",
+ "Record mode",
+ UCA_TYPE_PCO_CAMERA_RECORDE_MODE, UCA_PCO_CAMERA_RECORD_MODE_SEQUENCE,
+ G_PARAM_READWRITE);
pco_properties[PROP_DELAY_TIME] =
g_param_spec_double("delay-time",
diff --git a/src/cameras/uca-pco-camera.h b/src/cameras/uca-pco-camera.h
index b5f9628..3fc8522 100644
--- a/src/cameras/uca-pco-camera.h
+++ b/src/cameras/uca-pco-camera.h
@@ -42,6 +42,13 @@ typedef struct _UcaPcoCamera UcaPcoCamera;
typedef struct _UcaPcoCameraClass UcaPcoCameraClass;
typedef struct _UcaPcoCameraPrivate UcaPcoCameraPrivate;
+#define UCA_TYPE_PCO_CAMERA_RECORDE_MODE (uca_pco_camera_record_mode_get_type())
+
+typedef enum {
+ UCA_PCO_CAMERA_RECORD_MODE_SEQUENCE,
+ UCA_PCO_CAMERA_RECORD_MODE_RING_BUFFER,
+} UcaPcoCameraRecordMode;
+
/**
* UcaPcoCamera:
*