[cheese/videobalance: 3/4] Add gconf brightness property



commit 8098dbd205c4883f99bf9c4caddfd3e7decd734d
Author: Filippo Argiolas <filippo argiolas gmail com>
Date:   Wed Apr 22 21:57:58 2009 +0200

    Add gconf brightness property
    
    Add a gconf property to store the new brightness setting
---
 data/cheese.schemas.in |   14 +++++++++++++-
 src/cheese-gconf.c     |   20 ++++++++++++++++++++
 src/cheese-gconf.h     |    1 +
 3 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/data/cheese.schemas.in b/data/cheese.schemas.in
index 9f56b58..2657868 100644
--- a/data/cheese.schemas.in
+++ b/data/cheese.schemas.in
@@ -64,7 +64,19 @@
 				<long>The height resolution of the image captured from the camera</long>
 			</locale>
     </schema>
-    	
+
+		<schema>
+			<key>/schemas/apps/cheese/brightness</key>
+			<applyto>/apps/cheese/brightness</applyto>
+			<owner>cheese</owner>
+			<type>float</type>
+			<default>0</default>
+			<locale name="C">
+				<short>Picture brightness</short>
+				<long>Brightness correction on the image coming from the webcam</long>
+			</locale>
+    </schema>
+
     <schema>
 			<key>/schemas/apps/cheese/video_path</key>
 			<applyto>/apps/cheese/video_path</applyto>
diff --git a/src/cheese-gconf.c b/src/cheese-gconf.c
index aa97999..c72e0cd 100644
--- a/src/cheese-gconf.c
+++ b/src/cheese-gconf.c
@@ -113,6 +113,11 @@ cheese_gconf_get_property (GObject *object, guint prop_id, GValue *value,
                                                     CHEESE_GCONF_PREFIX "/y_resolution",
                                                     NULL));
       break;
+    case GCONF_PROP_BRIGHTNESS:
+      g_value_set_double (value, gconf_client_get_float (priv->client,
+                                                         CHEESE_GCONF_PREFIX "/brightness",
+                                                         NULL));
+      break;
     case GCONF_PROP_VIDEO_PATH:
       g_value_set_string (value, gconf_client_get_string (priv->client,
                                                           CHEESE_GCONF_PREFIX "/video_path",
@@ -213,6 +218,12 @@ cheese_gconf_set_property (GObject *object, guint prop_id, const GValue *value,
                             g_value_get_int (value),
                             NULL);
       break;
+    case GCONF_PROP_BRIGHTNESS:
+      gconf_client_set_float (priv->client,
+                              CHEESE_GCONF_PREFIX "/brightness",
+                              g_value_get_double (value),
+                              NULL);
+      break;
     case GCONF_PROP_VIDEO_PATH:
       gconf_client_set_string (priv->client,
                                CHEESE_GCONF_PREFIX "/video_path",
@@ -296,6 +307,15 @@ cheese_gconf_class_init (CheeseGConfClass *klass)
                                                      0,
                                                      G_PARAM_READWRITE));
 
+  g_object_class_install_property (object_class, GCONF_PROP_BRIGHTNESS,
+                                   g_param_spec_double ("gconf_prop_brightness",
+                                                        NULL,
+                                                        NULL,
+                                                        -G_MAXFLOAT,
+                                                        G_MAXFLOAT,
+                                                        0.0,
+                                                        G_PARAM_READWRITE));
+
   g_object_class_install_property (object_class, GCONF_PROP_VIDEO_PATH,
                                    g_param_spec_string ("gconf_prop_video_path",
                                                         NULL,
diff --git a/src/cheese-gconf.h b/src/cheese-gconf.h
index 324d2e8..37cbfc3 100644
--- a/src/cheese-gconf.h
+++ b/src/cheese-gconf.h
@@ -47,6 +47,7 @@ enum
   GCONF_PROP_SELECTED_EFFECTS,
   GCONF_PROP_X_RESOLUTION,
   GCONF_PROP_Y_RESOLUTION,
+  GCONF_PROP_BRIGHTNESS,
   GCONF_PROP_VIDEO_PATH,
   GCONF_PROP_PHOTO_PATH,
   GCONF_PROP_ENABLE_DELETE



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]