summaryrefslogtreecommitdiffstats
path: root/src
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
parent3761b79dc771022e2f39fb22708d7436f5f02e12 (diff)
downloaduca-5105d4fa81e4566ab9dd654ea3d9a7597766e746.tar.gz
uca-5105d4fa81e4566ab9dd654ea3d9a7597766e746.tar.bz2
uca-5105d4fa81e4566ab9dd654ea3d9a7597766e746.tar.xz
uca-5105d4fa81e4566ab9dd654ea3d9a7597766e746.zip
Add start/stop signal
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt8
-rw-r--r--src/cameras/uca-mock-camera.c5
-rw-r--r--src/cameras/uca-pco-camera.c4
-rw-r--r--src/uca-camera.c25
-rw-r--r--src/uca-camera.h2
5 files changed, 35 insertions, 9 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index edc9fa5..f2124da 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -130,10 +130,10 @@ set_target_properties(uca-gobject PROPERTIES
VERSION ${UCA_ABI_VERSION}
SOVERSION ${UCA_VERSION_MINOR})
-target_link_libraries(uca-gobject ${GLIB2_LIBRARIES} ${GOBJECT2_LIBRARIES}
- ${PCO_LIBRARIES}
- ${CLSERME4_LIBRARY}
- ${FGLIB5_LIBRARY})
+target_link_libraries(uca-gobject
+ ${GLIB2_LIBRARIES}
+ ${GOBJECT2_LIBRARIES}
+ ${uca_LIBS})
# --- Install target ----------------------------------------------------------
diff --git a/src/cameras/uca-mock-camera.c b/src/cameras/uca-mock-camera.c
index 8a40bcd..c4f790d 100644
--- a/src/cameras/uca-mock-camera.c
+++ b/src/cameras/uca-mock-camera.c
@@ -89,7 +89,6 @@ static void uca_mock_camera_set_property(GObject *object, guint property_id, con
{
g_return_if_fail(UCA_IS_MOCK_CAMERA(object));
UcaMockCameraPrivate *priv = UCA_MOCK_CAMERA_GET_PRIVATE(object);
- g_signal_emit_by_name(object, "property-changed", pspec->name, NULL);
switch (property_id) {
case PROP_FRAMERATE:
@@ -97,8 +96,10 @@ static void uca_mock_camera_set_property(GObject *object, guint property_id, con
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
- break;
+ return;
}
+
+ g_signal_emit_by_name(object, "property-changed", pspec->name);
}
static void uca_mock_camera_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
diff --git a/src/cameras/uca-pco-camera.c b/src/cameras/uca-pco-camera.c
index 0e1267c..d543806 100644
--- a/src/cameras/uca-pco-camera.c
+++ b/src/cameras/uca-pco-camera.c
@@ -181,8 +181,10 @@ static void uca_pco_camera_set_property(GObject *object, guint property_id, cons
switch (property_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
- break;
+ return;
}
+
+ g_signal_emit_by_name(object, "property-changed", pspec->name);
}
static void uca_pco_camera_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
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)
diff --git a/src/uca-camera.h b/src/uca-camera.h
index 1117bd1..1a6e6d1 100644
--- a/src/uca-camera.h
+++ b/src/uca-camera.h
@@ -58,6 +58,8 @@ struct _UcaCameraClass {
void (*grab) (UcaCamera *camera, gchar *data, GError **error);
void (*property_changed) (UcaCamera *camera, const gchar *name, gpointer user_data);
+ void (*recording_started) (UcaCamera *camera);
+ void (*recording_stopped) (UcaCamera *camera);
};
void uca_camera_start_recording(UcaCamera *camera, GError **error);