mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 15:51:11 +00:00
examples: gst-camera: add zoom property to UI
Add a slider to modify the zoom in camerabin
This commit is contained in:
parent
31b1348559
commit
cb56a6b32b
3 changed files with 46 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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__ */
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue