summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2013-12-12 15:49:33 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2013-12-12 15:49:33 +0100
commit5e0222e521c43ccc7074856cf43ecc8d1bcaaec8 (patch)
treee6608d81bdc36277120f90f1702ca54b9c7b034b
parent8d07daf747c5061596072b3ecdfffbb2fcd11ef7 (diff)
downloaduca-5e0222e521c43ccc7074856cf43ecc8d1bcaaec8.tar.gz
uca-5e0222e521c43ccc7074856cf43ecc8d1bcaaec8.tar.bz2
uca-5e0222e521c43ccc7074856cf43ecc8d1bcaaec8.tar.xz
uca-5e0222e521c43ccc7074856cf43ecc8d1bcaaec8.zip
Add new API call uca_camera_is_recording
-rw-r--r--src/uca-camera.c16
-rw-r--r--src/uca-camera.h1
-rw-r--r--test/test-mock.c10
3 files changed, 21 insertions, 6 deletions
diff --git a/src/uca-camera.c b/src/uca-camera.c
index 2f0744e..ee2c432 100644
--- a/src/uca-camera.c
+++ b/src/uca-camera.c
@@ -597,6 +597,22 @@ uca_camera_stop_recording (UcaCamera *camera, GError **error)
}
/**
+ * uca_camera_is_recording:
+ * @camera: A #UcaCamera object
+ *
+ * Convenience function to ask the current recording status
+ *
+ * Return value: %TRUE if recording is ongoing
+ * Since: 1.5
+ */
+gboolean
+uca_camera_is_recording (UcaCamera *camera)
+{
+ g_return_val_if_fail (UCA_IS_CAMERA (camera), FALSE);
+ return camera->priv->is_recording;
+}
+
+/**
* uca_camera_start_readout:
* @camera: A #UcaCamera object
* @error: Location to store a #UcaCameraError error or %NULL
diff --git a/src/uca-camera.h b/src/uca-camera.h
index cf21609..c11644d 100644
--- a/src/uca-camera.h
+++ b/src/uca-camera.h
@@ -143,6 +143,7 @@ void uca_camera_start_recording (UcaCamera *camera,
GError **error);
void uca_camera_stop_recording (UcaCamera *camera,
GError **error);
+gboolean uca_camera_is_recording (UcaCamera *camera);
void uca_camera_start_readout (UcaCamera *camera,
GError **error);
void uca_camera_stop_readout (UcaCamera *camera,
diff --git a/test/test-mock.c b/test/test-mock.c
index 7876f5b..e66ef8f 100644
--- a/test/test-mock.c
+++ b/test/test-mock.c
@@ -136,16 +136,14 @@ test_recording_property (Fixture *fixture, gconstpointer data)
gboolean is_recording = FALSE;
uca_camera_start_recording (camera, NULL);
- g_object_get (G_OBJECT (camera),
- "is-recording", &is_recording,
- NULL);
+ g_object_get (G_OBJECT (camera), "is-recording", &is_recording, NULL);
g_assert (is_recording == TRUE);
+ g_assert (uca_camera_is_recording (camera));
uca_camera_stop_recording (camera, NULL);
- g_object_get (G_OBJECT (camera),
- "is-recording", &is_recording,
- NULL);
+ g_object_get (G_OBJECT (camera), "is-recording", &is_recording, NULL);
g_assert (is_recording == FALSE);
+ g_assert (!uca_camera_is_recording (camera));
}
static void