summaryrefslogtreecommitdiffstats
path: root/src/uca-camera.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2012-03-03 16:39:06 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2012-03-03 16:39:06 +0100
commit5105d4fa81e4566ab9dd654ea3d9a7597766e746 (patch)
tree371cacd4854209583b4b40ed946cbe62af321ec3 /src/uca-camera.c
parent3761b79dc771022e2f39fb22708d7436f5f02e12 (diff)
downloadlibuca-5105d4fa81e4566ab9dd654ea3d9a7597766e746.tar.gz
libuca-5105d4fa81e4566ab9dd654ea3d9a7597766e746.tar.bz2
libuca-5105d4fa81e4566ab9dd654ea3d9a7597766e746.tar.xz
libuca-5105d4fa81e4566ab9dd654ea3d9a7597766e746.zip
Add start/stop signal
Diffstat (limited to 'src/uca-camera.c')
-rw-r--r--src/uca-camera.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/uca-camera.c b/src/uca-camera.c
index 9fda4a1..57b4e50 100644
--- a/src/uca-camera.c
+++ b/src/uca-camera.c
@@ -33,6 +33,8 @@ GQuark uca_camera_error_quark()
}
enum {
+ RECORDING_STARTED,
+ RECORDING_STOPPED,
PROPERTY_CHANGED,
LAST_SIGNAL
};
@@ -61,7 +63,6 @@ static guint camera_signals[LAST_SIGNAL] = { 0 };
static void uca_camera_set_property(GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
{
-
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
}
@@ -159,7 +160,25 @@ static void uca_camera_class_init(UcaCameraClass *klass)
G_STRUCT_OFFSET(UcaCameraClass, property_changed),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 0);
+ G_TYPE_NONE, 1, G_TYPE_STRING);
+
+ camera_signals[RECORDING_STARTED] =
+ g_signal_new("recording-started",
+ G_OBJECT_CLASS_TYPE(gobject_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET(UcaCameraClass, recording_started),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0, NULL);
+
+ camera_signals[RECORDING_STOPPED] =
+ g_signal_new("recording-stopped",
+ G_OBJECT_CLASS_TYPE(gobject_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET(UcaCameraClass, recording_stopped),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0, NULL);
g_type_class_add_private(klass, sizeof(UcaCameraPrivate));
}
@@ -187,6 +206,7 @@ void uca_camera_start_recording(UcaCamera *camera, GError **error)
camera->priv->recording = TRUE;
(*klass->start_recording)(camera, error);
+ g_signal_emit_by_name(G_OBJECT(camera), "recording-started");
}
void uca_camera_stop_recording(UcaCamera *camera, GError **error)
@@ -206,6 +226,7 @@ void uca_camera_stop_recording(UcaCamera *camera, GError **error)
camera->priv->recording = FALSE;
(*klass->stop_recording)(camera, error);
+ g_signal_emit_by_name(G_OBJECT(camera), "recording-stopped");
}
void uca_camera_grab(UcaCamera *camera, gchar *data, GError **error)