[aravis] viewer: update spin_button values for exposure and gain.



commit 1161506684b8e84515eaf651fc61bf04d560299b
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Tue Jan 4 23:18:13 2011 +0100

    viewer: update spin_button values for exposure and gain.
    
    Changed fr.po to make git push pass.

 po/fr.po             |   18 +++++++++++++++
 viewer/arv-viewer.ui |   58 ++++++++++++++++++++++++-------------------------
 viewer/arvviewer.c   |   31 ++++++++++++++++++++++++--
 3 files changed, 74 insertions(+), 33 deletions(-)
---
diff --git a/po/fr.po b/po/fr.po
index e69de29..ed1db60 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -0,0 +1,18 @@
+# French translation for aravis
+# Copyright (C) 2010 Emmanuel Pacaud <emmanuel gnome org>
+# This file is distributed under the same license as the aravis package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: aravis master\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-12-04 22:53+0100\n"
+"PO-Revision-Date: 2010-12-04 22:56+0100\n"
+"Last-Translator: Emmanuel Pacaud <emmanuel gnome org>\n"
+"Language-Team: Emmanuel Pacaud <emmanuel gnome org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
+
diff --git a/viewer/arv-viewer.ui b/viewer/arv-viewer.ui
index fe09722..6ab1229 100644
--- a/viewer/arv-viewer.ui
+++ b/viewer/arv-viewer.ui
@@ -89,36 +89,6 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkEntry" id="exposure_entry">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="invisible_char">â?¢</property>
-                    <property name="width_chars">10</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                    <property name="x_options">GTK_FILL</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkEntry" id="gain_entry">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="invisible_char">â?¢</property>
-                    <property name="width_chars">10</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">2</property>
-                    <property name="bottom_attach">3</property>
-                    <property name="x_options">GTK_FILL</property>
-                  </packing>
-                </child>
-                <child>
                   <object class="GtkLabel" id="label5">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
@@ -193,6 +163,34 @@
                     <property name="bottom_attach">3</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkSpinButton" id="exposure_spinbutton">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="invisible_char">â?¢</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
+                    <property name="x_options">GTK_FILL</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkSpinButton" id="gain_spinbutton">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="invisible_char">â?¢</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">2</property>
+                    <property name="bottom_attach">3</property>
+                    <property name="x_options">GTK_FILL</property>
+                  </packing>
+                </child>
               </object>
             </child>
             <child type="label">
diff --git a/viewer/arvviewer.c b/viewer/arvviewer.c
index e84fee9..c28612d 100644
--- a/viewer/arvviewer.c
+++ b/viewer/arvviewer.c
@@ -20,7 +20,8 @@ typedef struct {
 	GtkWidget *main_window;
 	GtkWidget *drawing_area;
 	GtkWidget *camera_combo_box;
-	GtkWidget *exposure_entry;
+	GtkWidget *exposure_spin_button;
+	GtkWidget *gain_spin_button;
 } ArvViewer;
 
 void
@@ -77,6 +78,16 @@ arv_viewer_new_buffer_cb (ArvStream *stream, ArvViewer *viewer)
 }
 
 void
+arv_viewer_exposure_cb (GtkSpinButton *spin_button, ArvViewer *viewer)
+{
+}
+
+void
+arv_viewer_gain_cb (GtkSpinButton *spin_button, ArvViewer *viewer)
+{
+}
+
+void
 arv_viewer_release_camera (ArvViewer *viewer)
 {
 	g_return_if_fail (viewer != NULL);
@@ -120,7 +131,10 @@ arv_viewer_select_camera_cb (GtkComboBox *combo_box, ArvViewer *viewer)
 	unsigned int frame_rate;
 	unsigned int i;
 	gulong window_xid;
-	double exposure;
+	double exposure, exposure_min, exposure_max;
+	gint64 gain, gain_min, gain_max;
+
+	g_return_if_fail (viewer != NULL);
 
 	arv_viewer_release_camera (viewer);
 
@@ -139,6 +153,14 @@ arv_viewer_select_camera_cb (GtkComboBox *combo_box, ArvViewer *viewer)
 	arv_camera_get_region (viewer->camera, NULL, NULL, &width, &height);
 	frame_rate = (unsigned int) (double) (0.5 + arv_camera_get_frame_rate (viewer->camera));
 	exposure = arv_camera_get_exposure_time (viewer->camera);
+	gain = arv_camera_get_gain (viewer->camera);
+	arv_camera_get_exposure_time_bounds (viewer->camera, &exposure_min, &exposure_max);
+	arv_camera_get_gain_bounds (viewer->camera, &gain_min, &gain_max);
+
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (viewer->exposure_spin_button), exposure);
+	gtk_spin_button_set_range (GTK_SPIN_BUTTON (viewer->exposure_spin_button), exposure_min, exposure_max);
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (viewer->gain_spin_button), gain);
+	gtk_spin_button_set_range (GTK_SPIN_BUTTON (viewer->gain_spin_button), gain_min, gain_max);
 
 	arv_camera_start_acquisition (viewer->camera);
 
@@ -204,7 +226,8 @@ arv_viewer_new (void)
 	viewer->camera_combo_box = GTK_WIDGET (gtk_builder_get_object (builder, "camera_combobox"));
 	viewer->main_window = GTK_WIDGET (gtk_builder_get_object (builder, "main_window"));
 	viewer->drawing_area = GTK_WIDGET (gtk_builder_get_object (builder, "video_drawingarea"));
-	viewer->exposure_entry = GTK_WIDGET (gtk_builder_get_object (builder, "exposure_entry"));
+	viewer->exposure_spin_button = GTK_WIDGET (gtk_builder_get_object (builder, "exposure_spinbutton"));
+	viewer->gain_spin_button = GTK_WIDGET (gtk_builder_get_object (builder, "gain_spinbutton"));
 
 	g_object_unref (builder);
 
@@ -216,6 +239,8 @@ arv_viewer_new (void)
 
 	g_signal_connect (viewer->main_window, "destroy", G_CALLBACK (arv_viewer_quit_cb), viewer);
 	g_signal_connect (viewer->camera_combo_box, "changed", G_CALLBACK (arv_viewer_select_camera_cb), viewer);
+	g_signal_connect (viewer->exposure_spin_button, "value-changed", G_CALLBACK (arv_viewer_exposure_cb), viewer);
+	g_signal_connect (viewer->gain_spin_button, "value-changed", G_CALLBACK (arv_viewer_gain_cb), viewer);
 
 	return viewer;
 }



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