diff options
author | Thiago Santos <thiagoss@osg.samsung.com> | 2015-04-27 19:28:57 -0300 |
---|---|---|
committer | Thiago Santos <thiagoss@osg.samsung.com> | 2015-04-27 21:14:09 -0300 |
commit | cb56a6b32bd2f1c0afbbc4d5c29a6b4f5a62c807 (patch) | |
tree | 75eb4c2951466884f7d0ee52e995e4146535faea /tests/examples | |
parent | 31b13485595074a2cde4aefcd2d65a99e68cd63f (diff) | |
download | gstreamer-plugins-bad-cb56a6b32bd2f1c0afbbc4d5c29a6b4f5a62c807.tar.gz |
examples: gst-camera: add zoom property to UI
Add a slider to modify the zoom in camerabin
Diffstat (limited to 'tests/examples')
-rw-r--r-- | tests/examples/camerabin2/gst-camera2.c | 7 | ||||
-rw-r--r-- | tests/examples/camerabin2/gst-camera2.h | 3 | ||||
-rw-r--r-- | tests/examples/camerabin2/gst-camera2.ui | 36 |
3 files changed, 46 insertions, 0 deletions
diff --git a/tests/examples/camerabin2/gst-camera2.c b/tests/examples/camerabin2/gst-camera2.c index 0b656a54c..5104d3b0f 100644 --- a/tests/examples/camerabin2/gst-camera2.c +++ b/tests/examples/camerabin2/gst-camera2.c @@ -203,6 +203,13 @@ on_formatComboBox_changed (GtkWidget * widget, gpointer data) } } +void +on_zoomScale_value_changed (GtkWidget * widget, gpointer data) +{ + g_object_set (camera, "zoom", + (gfloat) gtk_range_get_value (GTK_RANGE (widget)), NULL); +} + static GstBusSyncReply bus_sync_callback (GstBus * bus, GstMessage * message, gpointer data) { diff --git a/tests/examples/camerabin2/gst-camera2.h b/tests/examples/camerabin2/gst-camera2.h index 8477dacff..825d10a4e 100644 --- a/tests/examples/camerabin2/gst-camera2.h +++ b/tests/examples/camerabin2/gst-camera2.h @@ -48,4 +48,7 @@ on_viewfinderArea_realize (GtkWidget * widget, gpointer data); void on_formatComboBox_changed (GtkWidget * widget, gpointer data); +void +on_zoomScale_value_changed (GtkWidget * widget, gpointer data); + #endif /* __GST_CAMERA_BIN_H__ */ diff --git a/tests/examples/camerabin2/gst-camera2.ui b/tests/examples/camerabin2/gst-camera2.ui index af05fd7b5..52bcfc69a 100644 --- a/tests/examples/camerabin2/gst-camera2.ui +++ b/tests/examples/camerabin2/gst-camera2.ui @@ -2,6 +2,13 @@ <!-- Generated with glade 3.18.3 --> <interface> <requires lib="gtk+" version="3.0"/> + <object class="GtkAdjustment" id="zoomadjustment"> + <property name="lower">1</property> + <property name="upper">10</property> + <property name="value">1</property> + <property name="step_increment">0.10000000000000001</property> + <property name="page_increment">1</property> + </object> <object class="GtkWindow" id="mainWindow"> <property name="can_focus">False</property> <property name="default_width">800</property> @@ -44,6 +51,7 @@ <property name="xalign">0</property> <property name="active">True</property> <property name="draw_indicator">True</property> + <property name="group">imageRButton</property> <signal name="toggled" handler="on_videoRButton_toggled" swapped="no"/> </object> <packing> @@ -147,6 +155,34 @@ <property name="position">4</property> </packing> </child> + <child> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Zoom</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">5</property> + </packing> + </child> + <child> + <object class="GtkScale" id="zoomScale"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="adjustment">zoomadjustment</property> + <property name="fill_level">10</property> + <property name="round_digits">1</property> + <property name="value_pos">right</property> + <signal name="value-changed" handler="on_zoomScale_value_changed" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">6</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> |